From db1fa0acd5798e98f3b3267bf232e866347b90e2 Mon Sep 17 00:00:00 2001 From: Greg Turnquist Date: Wed, 17 Jul 2019 14:35:16 -0500 Subject: [PATCH] #1024 - Publish documentation using CI server. By letting the CI server assemble and publish documentation to docs.spring.io, we can ensure publicly posted docs are up-to-date. Resolves #1037 by backporting to 0.25.x. --- Jenkinsfile | 30 ++ pom.xml | 445 ++++++++++++++++--------- src/main/resources/assemblies/docs.xml | 40 +++ 3 files changed, 349 insertions(+), 166 deletions(-) create mode 100644 src/main/resources/assemblies/docs.xml diff --git a/Jenkinsfile b/Jenkinsfile index 434c57fb..507f7474 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -102,6 +102,36 @@ pipeline { } } } + stage('Release documentation') { + when { + anyOf { + branch '0.25.x' + branch 'release-0.x' + } + } + 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-0.x' diff --git a/pom.xml b/pom.xml index 513cb0b4..753ea311 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 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. @@ -199,29 +200,27 @@ distribute ${project.build.directory}/shared-resources + ${project.build.directory}/generated-asciidoc-sources/source/ + + ${project.build.directory}/generated-docs + true + true + true true + true true ${basedir} 0.1.0.RELEASE - - org.springframework.data.build - spring-data-build-resources - 1.9.13.RELEASE - provided - zip - io.spring.docresources spring-doc-resources @@ -229,6 +228,13 @@ zip true + + org.springframework.data.build + spring-data-build-resources + 2.2.0.BUILD-SNAPSHOT + zip + true + @@ -243,13 +249,6 @@ org.apache.maven.plugins maven-dependency-plugin - - unpack-shared-resources - - unpack-dependencies - - generate-resources - unpack-doc-resources @@ -261,23 +260,49 @@ spring-doc-resources zip true - ${project.build.directory}/refdocs/ + ${generated-asciidoc-sources.directory} + + + + unpack-shared-resources + + unpack-dependencies + + generate-resources + + ${project.groupId} + spring-data-build-resources + zip + true + ${shared.resources} - - org.springframework.data - spring-data-build-resources - zip - true - ${shared.resources} - + + + + 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 @@ -285,104 +310,18 @@ aggregate-javadoc - javadoc + aggregate package + + ${project.root}/target/site/apidocs + org.apache.maven.plugins - maven-resources-plugin - - - copy-asciidoc-resources - generate-resources - - 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.16 - - - - - - html - generate-resources - - process-asciidoc - - - html5 - highlight.js - ${project.build.directory}/site/reference/html - false - - shared - true - font - true - css/ - spring.css - js/highlight - atom-one-dark-reasonable - - - - - - pdf - generate-resources - - process-asciidoc - - - pdf - coderay - - - - - - - ${project.build.directory}/refdocs/ - book - - ${project.version} - ${project.name} - ${project.version} - true - 4 - true - ${project.basedir} - - - - - - maven-antrun-plugin 1.8 @@ -392,13 +331,39 @@ generate-resources - + - - - + + + + + + + + + + run + + + + + create-generated-docs-resources + process-resources + + + + + + + + + + + + + - @@ -409,10 +374,43 @@ rename-reference-docs - process-resources + prepare-package - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -420,69 +418,184 @@ - - package-and-attach-docs-zip - package - - run - - - - - - - - - - + + - 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 + + + - attach-zip + html + compile - attach-artifact + process-asciidoc - - - ${project.build.directory}/${project.artifactId}-${project.version}.zip - zip - - + ${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 - 3.1.0 - static + docs single - package - ${shared.resources}/assemblies/static-resources.xml + src/docs/resources/assemblies/docs.xml - static-resources - false + spring-hateoas-${project.version} + 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/main/resources/assemblies/docs.xml b/src/main/resources/assemblies/docs.xml new file mode 100644 index 00000000..cd32fb1b --- /dev/null +++ b/src/main/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 + + +