diff --git a/Jenkinsfile b/Jenkinsfile index e0d75c90..817e9d29 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -166,6 +166,36 @@ pipeline { } } } + stage('Release documentation') { + when { + anyOf { + branch 'master' + branch 'release' + } + } + agent { + docker { + image 'springci/spring-hateoas-openjdk8-with-graphviz-and-jq:latest' + args '-v $HOME/.m2:/tmp/jenkins-home/.m2' + } + } + options { timeout(time: 20, unit: 'MINUTES') } + + environment { + ARTIFACTORY = credentials('02bd1690-b54f-4c9f-819d-a77cb7a9822c') + } + + steps { + script { + sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,distribute ' + + '-Dartifactory.server=https://repo.spring.io ' + + "-Dartifactory.username=${ARTIFACTORY_USR} " + + "-Dartifactory.password=${ARTIFACTORY_PSW} " + + "-Dartifactory.distribution-repository=temp-private-local " + + '-Dmaven.test.skip=true deploy -B' + } + } + } stage('Promote to Bintray') { when { branch 'release' diff --git a/pom.xml b/pom.xml index 7e6e3b12..ce3aa11c 100644 --- a/pom.xml +++ b/pom.xml @@ -1,5 +1,6 @@ - + 4.0.0 org.springframework.hateoas @@ -48,20 +49,20 @@ Apache License, Version 2.0 https://www.apache.org/licenses/LICENSE-2.0 - Copyright 2011-2019 the original author or authors. + Copyright 2011-2019 the original author or authors. - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at - https://www.apache.org/licenses/LICENSE-2.0 + https://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. - See the License for the specific language governing permissions and - limitations under the License. + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied. + See the License for the specific language governing permissions and + limitations under the License. @@ -155,16 +156,21 @@ distribute ${project.build.directory}/shared-resources + ${project.build.directory}/generated-asciidoc-sources/source/ + + ${project.build.directory}/generated-docs + true + true + true true + true true @@ -176,6 +182,13 @@ zip true + + org.springframework.data.build + spring-data-build-resources + 2.2.0.BUILD-SNAPSHOT + zip + true + @@ -195,168 +208,122 @@ unpack-dependencies - prepare-package + generate-resources io.spring.docresources spring-doc-resources - ${project.build.directory}/refdocs/ + zip + true + ${generated-asciidoc-sources.directory} + + + + unpack-shared-resources + + unpack-dependencies + + generate-resources + + ${project.groupId} + spring-data-build-resources + zip + true + ${shared.resources} - - zip - true - - - - - org.apache.maven.plugins - maven-resources-plugin - - - copy-asciidoc-resources - prepare-package - - copy-resources - - - ${project.build.directory}/refdocs/ - - - src/main/asciidoc - false - - - - - - - - - org.asciidoctor - asciidoctor-maven-plugin - 1.5.7.1 - - - org.asciidoctor - asciidoctorj-pdf - 1.5.0-alpha.18 - - - org.asciidoctor - asciidoctorj-diagram - 1.5.18 - - - - - - html - prepare-package - - process-asciidoc - - - html5 - highlight.js - ${project.reporting.outputDirectory}/reference/html - false - - ${basedir}/src/docs/java/org/springframework/hateoas - ${basedir}/src/docs/resources/org/springframework/hateoas - shared - true - font - true - css/ - spring.css - js/highlight - atom-one-dark-reasonable - - - asciidoctor-diagram - - - - - - pdf - prepare-package - - process-asciidoc - - - pdf - coderay - - ${basedir}/src/docs/java/org/springframework/hateoas - - - - - - - - ${project.build.directory}/refdocs/ - index.adoc - book - - ${project.version} - ${project.name} - ${project.version} - true - 4 - true - ${project.basedir} - - - + + + + org.projectlombok + lombok-maven-plugin + 1.18.4.0 + + + generate-sources + + delombok + + + ${project.root}/target/generated-sources/delombok + + + + + org.apache.maven.plugins maven-javadoc-plugin - javadoc - prepare-package + aggregate-javadoc - javadoc + aggregate + package + + ${project.root}/target/site/apidocs + - - ${project.reporting.outputDirectory}/api - + org.apache.maven.plugins maven-antrun-plugin 1.8 copy-documentation-resources - prepare-package - - run - + generate-resources - + - - - + + + - + + + run + + + + + create-generated-docs-resources + process-resources + + + + + + + + + + + + + + + + + + + run + @@ -364,20 +331,40 @@ prepare-package - - - - - run - - - - copy-changelog - prepare-package - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -389,90 +376,181 @@ - - org.codehaus.mojo - wagon-maven-plugin - - ${project.build.directory} - static-dot-s2 - scp://docs.af.pivotal.io - - - - - - - - upload-static-resources - deploy - - upload - - - ${project.reporting.outputDirectory} - ** - /var/www/domains/spring.io/www/htdocs/autorepo/docs/spring-hateoas/${project.version} - true - - - - - - make-resources-group-writable - deploy - - sshexec - - - - - - - - - - - - - + - org.codehaus.mojo - build-helper-maven-plugin - 1.10 + org.asciidoctor + asciidoctor-maven-plugin + 2.0.0-RC.1 + + + org.jruby + jruby + 9.2.6.0 + + + org.asciidoctor + asciidoctorj + 2.0.0-RC.1 + + + org.asciidoctor + asciidoctorj-pdf + 1.5.0-alpha.16 + + + org.asciidoctor + asciidoctorj-epub3 + 1.5.0-alpha.8.1 + + + + + + html + compile + + process-asciidoc + + + ${generated-asciidoc-sources.directory} + index.adoc + html5 + ${generated-docs.directory} + highlight.js + + js/highlight + atom-one-dark-reasonable + true + true + ./css + spring.css + left + + + + + + + + + + book + + book + shared + font + false + images + ${project.version} + ${project.name} + ${project.version} + ${spring.version} + true + 4 + true + + + + + + + + org.apache.maven.plugins + maven-assembly-plugin - attach-zip + docs - attach-artifact + single package - - - ${project.build.directory}/${project.artifactId}-${project.version}.zip - zip - - + + src/docs/resources/assemblies/docs.xml + + spring-hateoas-${project.version} + true - --> + + - org.apache.maven.plugins - maven-deploy-plugin - - true - + org.jfrog.buildinfo + artifactory-maven-plugin + 2.6.1 + + + deploy-docs + + publish + + deploy + + + false + + + spring-hateoas-docs + spring-hateoas-docs + false + docs + + + + Spring Data Docs spring-hateoas ${project.version} + 1 + + + {{artifactory.server}} + {{artifactory.username}} + {{artifactory.password}} + {{artifactory.distribution-repository}} + {{artifactory.distribution-repository}} + *-docs.zip + + + + - diff --git a/src/docs/resources/assemblies/docs.xml b/src/docs/resources/assemblies/docs.xml new file mode 100644 index 00000000..cd32fb1b --- /dev/null +++ b/src/docs/resources/assemblies/docs.xml @@ -0,0 +1,40 @@ + + + docs + + dir + zip + + false + + + + src/main/resources + + changelog.txt + license.txt + notice.txt + + + dos + + + + target/site/reference + reference + + + + target/site/apidocs + api + + +