Multi pages (#139)
* WIP * single / multi and pdf added * Added git info to docs * docs urls, links set from props * Fixed extensions * Added readme * index.html is a normal page * Fixed invalid reference to spring-cloud raw github links * Added project root attribute * Changes following review
This commit is contained in:
23
README.adoc
23
README.adoc
@@ -241,30 +241,35 @@ approach of generating documentation just add these plugins to your `docs` modul
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId> <1>
|
||||
<groupId>pl.project13.maven</groupId>
|
||||
<artifactId>git-commit-id-plugin</artifactId> <1>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId> <2>
|
||||
<artifactId>maven-dependency-plugin</artifactId> <2>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId> <3>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.asciidoctor</groupId>
|
||||
<artifactId>asciidoctor-maven-plugin</artifactId> <3>
|
||||
<artifactId>asciidoctor-maven-plugin</artifactId> <4>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-antrun-plugin</artifactId> <4>
|
||||
<artifactId>maven-antrun-plugin</artifactId> <5>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
----
|
||||
<1> This plugin downloads the resources of the `spring-cloud-build-docs` module
|
||||
<2> This plugin unpacks the resources of the `spring-cloud-build-docs` module
|
||||
<3> This plugin is required to parse the Asciidoctor documentation
|
||||
<4> This plugin is required to copy resources into proper final destinations and to generate main README.adoc and to assert that no files use unresolved links
|
||||
<2> This plugin downloads sets up all the git information of the project
|
||||
<2> This plugin downloads the resources of the `spring-cloud-build-docs` module
|
||||
<3> This plugin unpacks the resources of the `spring-cloud-build-docs` module
|
||||
<4> This plugin is required to parse the Asciidoctor documentation
|
||||
<5> This plugin is required to copy resources into proper final destinations and to generate main README.adoc and to assert that no files use unresolved links
|
||||
|
||||
IMPORTANT: The order of plugin declaration is important!
|
||||
|
||||
|
||||
@@ -36,6 +36,10 @@
|
||||
<id>docs</id>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>pl.project13.maven</groupId>
|
||||
<artifactId>git-commit-id-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
|
||||
@@ -57,30 +57,35 @@ approach of generating documentation just add these plugins to your `docs` modul
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId> <1>
|
||||
<groupId>pl.project13.maven</groupId>
|
||||
<artifactId>git-commit-id-plugin</artifactId> <1>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId> <2>
|
||||
<artifactId>maven-dependency-plugin</artifactId> <2>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId> <3>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.asciidoctor</groupId>
|
||||
<artifactId>asciidoctor-maven-plugin</artifactId> <3>
|
||||
<artifactId>asciidoctor-maven-plugin</artifactId> <4>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-antrun-plugin</artifactId> <4>
|
||||
<artifactId>maven-antrun-plugin</artifactId> <5>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
----
|
||||
<1> This plugin downloads the resources of the `spring-cloud-build-docs` module
|
||||
<2> This plugin unpacks the resources of the `spring-cloud-build-docs` module
|
||||
<3> This plugin is required to parse the Asciidoctor documentation
|
||||
<4> This plugin is required to copy resources into proper final destinations and to generate main README.adoc and to assert that no files use unresolved links
|
||||
<2> This plugin downloads sets up all the git information of the project
|
||||
<2> This plugin downloads the resources of the `spring-cloud-build-docs` module
|
||||
<3> This plugin unpacks the resources of the `spring-cloud-build-docs` module
|
||||
<4> This plugin is required to parse the Asciidoctor documentation
|
||||
<5> This plugin is required to copy resources into proper final destinations and to generate main README.adoc and to assert that no files use unresolved links
|
||||
|
||||
IMPORTANT: The order of plugin declaration is important!
|
||||
|
||||
|
||||
@@ -121,14 +121,6 @@ function retrieve_doc_properties() {
|
||||
echo "Will not extract any properties for release train"
|
||||
return
|
||||
fi
|
||||
echo "Extracting doc properties"
|
||||
MAIN_ADOC_VALUE=$("${MAVEN_EXEC}" -q \
|
||||
-Dexec.executable="echo" \
|
||||
-Dexec.args='${docs.main}' \
|
||||
org.codehaus.mojo:exec-maven-plugin:1.3.1:exec \
|
||||
-P docs \
|
||||
-pl docs | tail -1 )
|
||||
echo "Extracted 'main.adoc' from Maven build [${MAIN_ADOC_VALUE}]"
|
||||
|
||||
|
||||
WHITELIST_PROPERTY=${WHITELIST_PROPERTY:-"docs.whitelisted.branches"}
|
||||
@@ -226,15 +218,8 @@ function copy_docs_for_current_version() {
|
||||
echo "The file [${file}] shouldn't be ignored"
|
||||
# Not ignored...
|
||||
# We want users to access 1.0.0.RELEASE/ instead of 1.0.0.RELEASE/spring-cloud.sleuth.html
|
||||
if [[ "${file}" == "${MAIN_ADOC_VALUE}.html" ]] ; then
|
||||
# We don't want to copy the spring-cloud-sleuth.html
|
||||
# we want it to be converted to index.html
|
||||
cp -rf "${f}" "${ROOT_FOLDER}/${CURRENT_BRANCH}/index.html"
|
||||
"${GIT_BIN}" add -A "${ROOT_FOLDER}/${CURRENT_BRANCH}/index.html"
|
||||
else
|
||||
cp -rf "${f}" "${ROOT_FOLDER}/${CURRENT_BRANCH}"
|
||||
cp -rf "${f}" "${ROOT_FOLDER}/${CURRENT_BRANCH}"
|
||||
"${GIT_BIN}" add -A "${ROOT_FOLDER}/${CURRENT_BRANCH}/${file}" || echo "Failed to add the file [${file}]"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
COMMIT_CHANGES="yes"
|
||||
@@ -268,14 +253,7 @@ function copy_docs_for_branch() {
|
||||
echo "Copying file [${file}] to destination [${destination}]"
|
||||
if ! "${GIT_BIN}" ls-files -i -o --exclude-standard --directory | grep -q ^"${file}"$; then
|
||||
# Not ignored...
|
||||
# We want users to access 1.0.0.RELEASE/ instead of 1.0.0.RELEASE/spring-cloud.sleuth.html
|
||||
if [[ ("${file}" == "${MAIN_ADOC_VALUE}.html") || ("${file}" == "${REPO_NAME}.html") ]] ; then
|
||||
# We don't want to copy the spring-cloud-sleuth.html
|
||||
# we want it to be converted to index.html
|
||||
cp -rf "${f}" "${destination}"/index.html
|
||||
else
|
||||
cp -rf "${f}" "${destination}"
|
||||
fi
|
||||
cp -rf "${f}" "${destination}"
|
||||
"${GIT_BIN}" add -A "${destination}"
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ function git_with_remotes {
|
||||
if [[ "$*" == *"set-url"* ]]; then
|
||||
echo "git $*"
|
||||
elif [[ "$*" == *"config remote.origin.url"* ]]; then
|
||||
echo "git://foo.bar/baz.git"
|
||||
echo "git://example1.example2/example3.git"
|
||||
else
|
||||
git $*
|
||||
fi
|
||||
@@ -56,7 +56,7 @@ function printing_git_failing_with_diff_index {
|
||||
|
||||
function printing_git_with_remotes {
|
||||
if [[ "$*" == *"config remote.origin.url"* ]]; then
|
||||
echo "git://foo.bar/baz.git"
|
||||
echo "git://example1.example2/example3.git"
|
||||
else
|
||||
printing_git $*
|
||||
fi
|
||||
@@ -64,7 +64,7 @@ function printing_git_with_remotes {
|
||||
|
||||
function stubbed_git {
|
||||
if [[ "$*" == *"config remote.origin.url"* ]]; then
|
||||
echo "git://foo.bar/baz.git"
|
||||
echo "git://example1.example2/example3.git"
|
||||
elif [[ "$*" == *"diff-index"* ]]; then
|
||||
return 1
|
||||
elif [[ "$*" == *"symbolic-ref"* ]]; then
|
||||
@@ -88,13 +88,12 @@ export -f stubbed_git
|
||||
export RELEASER_GIT_OAUTH_TOKEN="mytoken"
|
||||
cd "${TEMP_DIR}/spring-cloud-stream/"
|
||||
mkdir -p docs/target/generated-docs/
|
||||
touch docs/target/generated-docs/${MAIN_ADOC_VALUE}.html
|
||||
touch docs/target/generated-docs/foo.html
|
||||
touch docs/target/generated-docs/example1.html
|
||||
|
||||
run "${SOURCE_DIR}"/ghpages.sh
|
||||
|
||||
assert_success
|
||||
assert_output --partial "git remote set-url --push origin https://mytoken@foo.bar/baz.git"
|
||||
assert_output --partial "git remote set-url --push origin https://mytoken@example1.example2/example3.git"
|
||||
assert_output --partial "git fetch -q"
|
||||
assert_output --partial "git checkout master"
|
||||
assert_output --partial "git stash"
|
||||
@@ -103,7 +102,7 @@ export -f stubbed_git
|
||||
# Current branch is master - will copy the current docs only to the root folder
|
||||
assert_output --partial "git add -A ${TEMP_DIR}/spring-cloud-stream"
|
||||
assert_output --partial "git commit -a -m Sync docs from master to gh-pages"
|
||||
assert_output --partial "git remote set-url --push origin https://mytoken@foo.bar/baz.git"
|
||||
assert_output --partial "git remote set-url --push origin https://mytoken@example1.example2/example3.git"
|
||||
assert_output --partial "git push origin gh-pages"
|
||||
assert_output --partial "git checkout master"
|
||||
assert_output --partial "git stash pop"
|
||||
@@ -118,13 +117,12 @@ export -f stubbed_git
|
||||
|
||||
cd "${TEMP_DIR}/spring-cloud-stream/"
|
||||
mkdir -p docs/target/generated-docs/
|
||||
touch docs/target/generated-docs/${MAIN_ADOC_VALUE}.html
|
||||
touch docs/target/generated-docs/foo.html
|
||||
touch docs/target/generated-docs/example1.html
|
||||
|
||||
run "${SOURCE_DIR}"/ghpages.sh
|
||||
|
||||
assert_success
|
||||
assert_output --partial "git remote set-url --push origin https://mytoken@foo.bar/baz.git"
|
||||
assert_output --partial "git remote set-url --push origin https://mytoken@example1.example2/example3.git"
|
||||
assert_output --partial "git remote set-branches --add origin gh-pages"
|
||||
assert_output --partial "git fetch -q"
|
||||
# Previous branch was [master]
|
||||
@@ -134,10 +132,10 @@ export -f stubbed_git
|
||||
assert_output --partial "git checkout gh-pages"
|
||||
assert_output --partial "git pull origin gh-pages"
|
||||
# Current branch is master - will copy the current docs only to the root folder
|
||||
assert [ -f "${TEMP_DIR}/spring-cloud-static/spring-cloud-stream/${VERSION}/foo.html" ]
|
||||
assert [ -f "${TEMP_DIR}/spring-cloud-static/spring-cloud-stream/${VERSION}/example1.html" ]
|
||||
assert_output --partial "git add -A ${TEMP_DIR}/spring-cloud-static/spring-cloud-stream/${VERSION}"
|
||||
assert_output --partial "git commit -a -m Sync docs from v1.0.0.RELEASE to gh-pages"
|
||||
assert_output --partial "git remote set-url --push origin https://mytoken@foo.bar/baz.git"
|
||||
assert_output --partial "git remote set-url --push origin https://mytoken@example1.example2/example3.git"
|
||||
assert_output --partial "git push origin gh-pages"
|
||||
assert_output --partial "git checkout master"
|
||||
assert_output --partial "git stash pop"
|
||||
@@ -153,23 +151,22 @@ export -f stubbed_git
|
||||
|
||||
cd "${TEMP_DIR}/spring-cloud-stream/"
|
||||
mkdir -p docs/target/generated-docs/
|
||||
touch docs/target/generated-docs/${MAIN_ADOC_VALUE}.html
|
||||
touch docs/target/generated-docs/foo.html
|
||||
touch docs/target/generated-docs/example1.html
|
||||
|
||||
run "${SOURCE_DIR}"/ghpages.sh
|
||||
|
||||
assert_success
|
||||
assert_output --partial "git remote set-url --push origin https://mytoken@foo.bar/baz.git"
|
||||
assert_output --partial "git remote set-url --push origin https://mytoken@example1.example2/example3.git"
|
||||
# Previous branch was [master]
|
||||
assert_output --partial "git checkout master"
|
||||
assert_output --partial "git stash"
|
||||
assert_output --partial "git checkout gh-pages"
|
||||
assert_output --partial "git pull origin gh-pages"
|
||||
# Current branch is master - will copy the current docs only to the root folder
|
||||
assert [ -f "${TEMP_DIR}/spring-cloud-static/${VERSION}/foo.html" ]
|
||||
assert [ -f "${TEMP_DIR}/spring-cloud-static/${VERSION}/example1.html" ]
|
||||
assert_output --partial "git add -A ${TEMP_DIR}/spring-cloud-static/${VERSION}"
|
||||
assert_output --partial "git commit -a -m Sync docs from vGreenwich.SR2 to gh-pages"
|
||||
assert_output --partial "git remote set-url --push origin https://mytoken@foo.bar/baz.git"
|
||||
assert_output --partial "git remote set-url --push origin https://mytoken@example1.example2/example3.git"
|
||||
assert_output --partial "git push origin gh-pages"
|
||||
assert_output --partial "git checkout master"
|
||||
assert_output --partial "git stash pop"
|
||||
@@ -200,7 +197,7 @@ export -f stubbed_git
|
||||
run add_oauth_token_to_remote_url
|
||||
|
||||
assert_success
|
||||
assert_output --partial "git remote set-url --push origin https://foo.bar/baz.git"
|
||||
assert_output --partial "git remote set-url --push origin https://example1.example2/example3.git"
|
||||
}
|
||||
|
||||
@test "should add auth token to URL if token is present" {
|
||||
@@ -213,7 +210,7 @@ export -f stubbed_git
|
||||
run add_oauth_token_to_remote_url
|
||||
|
||||
assert_success
|
||||
assert_output --partial "git remote set-url --push origin https://mytoken@foo.bar/baz.git"
|
||||
assert_output --partial "git remote set-url --push origin https://mytoken@example1.example2/example3.git"
|
||||
}
|
||||
|
||||
@test "should retrieve the name of the current branch" {
|
||||
@@ -325,8 +322,7 @@ export -f stubbed_git
|
||||
export CURRENT_BRANCH="master"
|
||||
cd "${TEMP_DIR}/spring-cloud-stream/"
|
||||
mkdir -p docs/target/generated-docs/
|
||||
touch docs/target/generated-docs/${MAIN_ADOC_VALUE}.html
|
||||
touch docs/target/generated-docs/foo.html
|
||||
touch docs/target/generated-docs/example1.html
|
||||
|
||||
source "${SOURCE_DIR}"/ghpages.sh
|
||||
|
||||
@@ -340,11 +336,10 @@ export -f stubbed_git
|
||||
export GIT_BIN="printing_git"
|
||||
export CURRENT_BRANCH="present"
|
||||
export WHITELISTED_BRANCHES_VALUE="present"
|
||||
export MAIN_ADOC_VALUE="my_doc"
|
||||
cd "${TEMP_DIR}/spring-cloud-stream/"
|
||||
mkdir -p docs/target/generated-docs/
|
||||
touch docs/target/generated-docs/${MAIN_ADOC_VALUE}.html
|
||||
touch docs/target/generated-docs/foo.html
|
||||
touch docs/target/generated-docs/my_doc.html
|
||||
touch docs/target/generated-docs/example1.html
|
||||
|
||||
source "${SOURCE_DIR}"/ghpages.sh
|
||||
|
||||
@@ -356,8 +351,8 @@ export -f stubbed_git
|
||||
run copy_docs_for_current_version
|
||||
|
||||
assert_success
|
||||
assert_output --partial "add -A ${ROOT_FOLDER}/present/index.html"
|
||||
assert_output --partial "add -A ${ROOT_FOLDER}/present/foo.html"
|
||||
assert_output --partial "add -A ${ROOT_FOLDER}/present/my_doc.html"
|
||||
assert_output --partial "add -A ${ROOT_FOLDER}/present/example1.html"
|
||||
}
|
||||
|
||||
@test "should do nothing if current branch is not whitelisted" {
|
||||
@@ -373,58 +368,6 @@ export -f stubbed_git
|
||||
assert [ "${COMMIT_CHANGES}" != "yes" ]
|
||||
}
|
||||
|
||||
@test "should reuse main adoc value as new index.html" {
|
||||
export GIT_BIN="printing_git"
|
||||
export DESTINATION_REPO_FOLDER="${TEMP_DIR}/spring-cloud-static"
|
||||
export VERSION="1.0.0.RELEASE"
|
||||
export MAIN_ADOC_VALUE="my_doc"
|
||||
cd "${TEMP_DIR}/spring-cloud-stream/"
|
||||
mkdir -p docs/target/generated-docs/
|
||||
touch docs/target/generated-docs/${MAIN_ADOC_VALUE}.html
|
||||
touch docs/target/generated-docs/foo.html
|
||||
|
||||
source "${SOURCE_DIR}"/ghpages.sh
|
||||
|
||||
copy_docs_for_provided_version
|
||||
|
||||
assert_success
|
||||
assert [ "${COMMIT_CHANGES}" == "yes" ]
|
||||
assert [ "${CURRENT_BRANCH}" == "v${VERSION}" ]
|
||||
|
||||
run copy_docs_for_provided_version
|
||||
|
||||
assert_success
|
||||
assert_output --partial "add -A ${DESTINATION_REPO_FOLDER}/${VERSION}"
|
||||
assert [ -f "${DESTINATION_REPO_FOLDER}/${VERSION}/index.html" ]
|
||||
assert [ -f "${DESTINATION_REPO_FOLDER}/${VERSION}/foo.html" ]
|
||||
}
|
||||
|
||||
@test "should reuse repo name as new index.html" {
|
||||
export GIT_BIN="printing_git"
|
||||
export DESTINATION_REPO_FOLDER="${TEMP_DIR}/spring-cloud-static"
|
||||
export VERSION="1.0.0.RELEASE"
|
||||
export REPO_NAME="spring-cloud-stream"
|
||||
cd "${TEMP_DIR}/spring-cloud-stream/"
|
||||
mkdir -p docs/target/generated-docs/
|
||||
touch docs/target/generated-docs/${REPO_NAME}.html
|
||||
touch docs/target/generated-docs/foo.html
|
||||
|
||||
source "${SOURCE_DIR}"/ghpages.sh
|
||||
|
||||
copy_docs_for_provided_version
|
||||
|
||||
assert_success
|
||||
assert [ "${COMMIT_CHANGES}" == "yes" ]
|
||||
assert [ "${CURRENT_BRANCH}" == "v${VERSION}" ]
|
||||
|
||||
run copy_docs_for_provided_version
|
||||
|
||||
assert_success
|
||||
assert_output --partial "add -A ${DESTINATION_REPO_FOLDER}/${VERSION}"
|
||||
assert [ -f "${DESTINATION_REPO_FOLDER}/${VERSION}/index.html" ]
|
||||
assert [ -f "${DESTINATION_REPO_FOLDER}/${VERSION}/foo.html" ]
|
||||
}
|
||||
|
||||
@test "should not do anything if commit flag not set" {
|
||||
export GIT_BIN="printing_git_with_remotes"
|
||||
export COMMIT_CHANGES="no"
|
||||
@@ -448,7 +391,7 @@ export -f stubbed_git
|
||||
|
||||
assert_success
|
||||
assert_output --partial "git commit -a -m Sync docs from to gh-pages"
|
||||
assert_output --partial "git remote set-url --push origin https://mytoken@foo.bar/baz.git"
|
||||
assert_output --partial "git remote set-url --push origin https://mytoken@example1.example2/example3.git"
|
||||
assert_output --partial "git push origin gh-pages"
|
||||
}
|
||||
|
||||
@@ -464,7 +407,7 @@ export -f stubbed_git
|
||||
|
||||
assert_success
|
||||
assert_output --partial "git commit -a -m Sync docs from to gh-pages"
|
||||
assert_output --partial "git remote set-url --push origin https://username:password@foo.bar/baz.git"
|
||||
assert_output --partial "git remote set-url --push origin https://username:password@example1.example2/example3.git"
|
||||
assert_output --partial "git push origin gh-pages"
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ function git_with_remotes {
|
||||
if [[ "$*" == *"set-url"* ]]; then
|
||||
echo "git $*"
|
||||
elif [[ "$*" == *"config remote.origin.url"* ]]; then
|
||||
echo "git://foo.bar/baz.git"
|
||||
echo "git://example1.example2/example3.git"
|
||||
else
|
||||
git $*
|
||||
fi
|
||||
@@ -45,7 +45,7 @@ function printing_git {
|
||||
|
||||
function printing_git_with_remotes {
|
||||
if [[ "$*" == *"config remote.origin.url"* ]]; then
|
||||
echo "git://foo.bar/baz.git"
|
||||
echo "git://example1.example2/example3.git"
|
||||
else
|
||||
printing_git $*
|
||||
fi
|
||||
@@ -53,7 +53,7 @@ function printing_git_with_remotes {
|
||||
|
||||
function stubbed_git {
|
||||
if [[ "$*" == *"config remote.origin.url"* ]]; then
|
||||
echo "git://foo.bar/baz.git"
|
||||
echo "git://example1.example2/example3.git"
|
||||
elif [[ "$*" == *"commit"* ]]; then
|
||||
printing_git $*
|
||||
elif [[ "$*" == *"push"* ]]; then
|
||||
@@ -111,7 +111,7 @@ export -f stubbed_git
|
||||
|
||||
assert_success
|
||||
# change remote
|
||||
assert_output --partial "git remote set-url --push origin https://mytoken@foo.bar/baz.git"
|
||||
assert_output --partial "git remote set-url --push origin https://mytoken@example1.example2/example3.git"
|
||||
# commit and push
|
||||
assert_output --partial "git commit -m Updating guides"
|
||||
assert_output --partial "git push origin master"
|
||||
|
||||
271
pom.xml
271
pom.xml
@@ -31,12 +31,17 @@
|
||||
<spring-boot.version>2.2.0.BUILD-SNAPSHOT</spring-boot.version>
|
||||
<spring-cloud-build.version>2.2.0.BUILD-SNAPSHOT</spring-cloud-build.version>
|
||||
<docs.resources.dir>${project.build.directory}/build-docs</docs.resources.dir>
|
||||
<refdocs.build.directory>${project.build.directory}/refdocs/</refdocs.build.directory>
|
||||
<spring-doc-resources.version>0.1.0.RELEASE</spring-doc-resources.version>
|
||||
<spring-asciidoctor-extensions.version>0.1.3.RELEASE
|
||||
</spring-asciidoctor-extensions.version>
|
||||
<asciidoctorj-pdf.version>1.5.0-alpha.18</asciidoctorj-pdf.version>
|
||||
<asciidoctorj-diagram.version>1.5.18</asciidoctorj-diagram.version>
|
||||
<guides-project.version>${project.version}</guides-project.version>
|
||||
<guides-update.phase>deploy</guides-update.phase>
|
||||
<revision>${project.version}</revision>
|
||||
<asciidoctorj.version>1.5.8</asciidoctorj.version>
|
||||
<jruby-complete.version>9.2.7.0</jruby-complete.version>
|
||||
|
||||
<!-- Sonar -->
|
||||
<sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
|
||||
@@ -61,7 +66,7 @@
|
||||
<maven-war-plugin.version>3.2.2</maven-war-plugin.version>
|
||||
<exec-maven-plugin.version>1.6.0</exec-maven-plugin.version>
|
||||
<maven-resources-plugin.version>3.1.0</maven-resources-plugin.version>
|
||||
<git-commit-id-plugin.version>2.2.4</git-commit-id-plugin.version>
|
||||
<git-commit-id-plugin.version>3.0.0</git-commit-id-plugin.version>
|
||||
<maven-shade-plugin.version>3.1.1</maven-shade-plugin.version>
|
||||
<maven-enforcer-plugin.version>3.0.0-M2</maven-enforcer-plugin.version>
|
||||
<maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
|
||||
@@ -91,6 +96,8 @@
|
||||
</checkstyle.additional.suppressions.file>
|
||||
<nohttp-checkstyle.version>0.0.2.RELEASE</nohttp-checkstyle.version>
|
||||
<disable.nohttp.checks>true</disable.nohttp.checks>
|
||||
<antelopetasks.version>3.2.10</antelopetasks.version>
|
||||
<ant-nodeps.version>1.8.1</ant-nodeps.version>
|
||||
</properties>
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
@@ -481,6 +488,7 @@
|
||||
<generateGitPropertiesFilename>
|
||||
${project.build.outputDirectory}/git.properties
|
||||
</generateGitPropertiesFilename>
|
||||
<skipPoms>false</skipPoms>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<!-- Support our own plugin -->
|
||||
@@ -953,7 +961,7 @@
|
||||
<version>${spring-doc-resources.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${project.build.directory}/refdocs/</outputDirectory>
|
||||
<outputDirectory>${refdocs.build.directory}</outputDirectory>
|
||||
</artifactItem>
|
||||
</artifactItems>
|
||||
</configuration>
|
||||
@@ -999,10 +1007,54 @@
|
||||
<artifactId>asciidoctorj-pdf</artifactId>
|
||||
<version>${asciidoctorj-pdf.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.asciidoctor</groupId>
|
||||
<artifactId>asciidoctorj-diagram</artifactId>
|
||||
<version>${asciidoctorj-diagram.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<configuration>
|
||||
<sourceDirectory>${project.build.directory}/refdocs/</sourceDirectory>
|
||||
<sourceDocumentName>${docs.main}.adoc</sourceDocumentName>
|
||||
<sourceDirectory>${refdocs.build.directory}</sourceDirectory>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>${refdocs.build.directory}</directory>
|
||||
<excludes>
|
||||
<exclude>**/*.*adoc</exclude>
|
||||
</excludes>
|
||||
</resource>
|
||||
</resources>
|
||||
<attributes>
|
||||
<docinfo>shared</docinfo>
|
||||
<allow-uri-read>true</allow-uri-read>
|
||||
<nofooter/>
|
||||
<toc>left</toc>
|
||||
<toc-levels>4</toc-levels>
|
||||
<sectlinks>true</sectlinks>
|
||||
<sources-root>${project.basedir}/src</sources-root>
|
||||
<asciidoc-sources-root>${project.basedir}/src/main/asciidoc</asciidoc-sources-root>
|
||||
<generated-resources-root>${project.basedir}/target/generated-resources
|
||||
</generated-resources-root>
|
||||
<project-root>${maven.multiModuleProjectDirectory}</project-root>
|
||||
<github-repo>${docs.main}</github-repo>
|
||||
<github-raw>https://raw.github.com/spring-cloud/${docs.main}/${github-tag}</github-raw>
|
||||
<github-code>https://github.com/spring-cloud/${docs.main}/tree/${github-tag}</github-code>
|
||||
<github-issues>https://github.com/spring-cloud/${docs.main}/issues/</github-issues>
|
||||
<github-wiki>https://github.com/spring-cloud/${docs.main}/wiki</github-wiki>
|
||||
<github-master-code>https://github.com/spring-cloud/${docs.main}/tree/master</github-master-code>
|
||||
<index-link>${index-link}</index-link>
|
||||
|
||||
<!-- Spring Cloud specific -->
|
||||
<project-version>${project.version}</project-version>
|
||||
<github-tag>${github-tag}</github-tag>
|
||||
<version-type>${version-type}</version-type>
|
||||
<docs-url>${docs-url}</docs-url>
|
||||
<raw-docs-url>${raw-docs-url}</raw-docs-url>
|
||||
<project-version>${project.version}</project-version>
|
||||
<project-name>${docs.main}</project-name>
|
||||
</attributes>
|
||||
<requires>
|
||||
<require>asciidoctor-diagram</require>
|
||||
</requires>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
@@ -1013,35 +1065,84 @@
|
||||
</goals>
|
||||
<configuration>
|
||||
<backend>html5</backend>
|
||||
<sourceDocumentExtensions>
|
||||
<sourceDocumentExtension>.adoc</sourceDocumentExtension>
|
||||
<sourceDocumentExtension>.htmladoc</sourceDocumentExtension>
|
||||
</sourceDocumentExtensions>
|
||||
<outputDirectory>${project.build.directory}/generated-docs/reference/html
|
||||
</outputDirectory>
|
||||
<sourceHighlighter>highlight.js</sourceHighlighter>
|
||||
<doctype>book</doctype>
|
||||
<attributes>
|
||||
// these attributes are required to use the doc resources
|
||||
<docinfo>shared</docinfo>
|
||||
<stylesdir>css/</stylesdir>
|
||||
<stylesheet>spring.css</stylesheet>
|
||||
<linkcss>true</linkcss>
|
||||
<icons>font</icons>
|
||||
<highlightjsdir>js/highlight</highlightjsdir>
|
||||
<highlightjs-theme>atom-one-dark-reasonable</highlightjs-theme>
|
||||
<allow-uri-read>true</allow-uri-read>
|
||||
<nofooter/>
|
||||
<toc>left</toc>
|
||||
<toc-levels>4</toc-levels>
|
||||
<spring-cloud-version>${project.version}</spring-cloud-version>
|
||||
<sectlinks>true</sectlinks>
|
||||
<linkcss>true</linkcss>
|
||||
<imagesdir>./images</imagesdir>
|
||||
<icons>font</icons>
|
||||
<stylesdir>css/</stylesdir>
|
||||
<stylesheet>spring.css</stylesheet>
|
||||
<attribute-missing>warn</attribute-missing>
|
||||
</attributes>
|
||||
<outputFile>${docs.main}.html</outputFile>
|
||||
<logHandler>
|
||||
<outputToConsole>true</outputToConsole>
|
||||
<failIf>
|
||||
<!-- <severity>DEBUG</severity>-->
|
||||
</failIf>
|
||||
</logHandler>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>generate-htmlsingle-documentation</id>
|
||||
<phase>prepare-package</phase>
|
||||
<goals>
|
||||
<goal>process-asciidoc</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<backend>html5</backend>
|
||||
<sourceDocumentExtensions>
|
||||
<sourceDocumentExtension>.htmlsingleadoc</sourceDocumentExtension>
|
||||
</sourceDocumentExtensions>
|
||||
<outputDirectory>
|
||||
${project.build.directory}/generated-docs/reference/htmlsingle
|
||||
</outputDirectory>
|
||||
<sourceHighlighter>highlight.js</sourceHighlighter>
|
||||
<doctype>book</doctype>
|
||||
<attributes>
|
||||
<highlightjsdir>js/highlight</highlightjsdir>
|
||||
<highlightjs-theme>atom-one-dark-reasonable</highlightjs-theme>
|
||||
<linkcss>true</linkcss>
|
||||
<imagesdir>./images</imagesdir>
|
||||
<icons>font</icons>
|
||||
<stylesdir>css/</stylesdir>
|
||||
<stylesheet>spring.css</stylesheet>
|
||||
</attributes>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>generate-pdf-documentation</id>
|
||||
<phase>prepare-package</phase>
|
||||
<goals>
|
||||
<goal>process-asciidoc</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<backend>pdf</backend>
|
||||
<sourceDocumentExtensions>
|
||||
<sourceDocumentExtension>.pdfadoc</sourceDocumentExtension>
|
||||
</sourceDocumentExtensions>
|
||||
<outputDirectory>${project.build.directory}/generated-docs/reference/pdf
|
||||
</outputDirectory>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>${refdocs.build.directory}</directory>
|
||||
<excludes>
|
||||
<exclude>**/*</exclude>
|
||||
</excludes>
|
||||
</resource>
|
||||
</resources>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>build-helper-maven-plugin</artifactId>
|
||||
<version>${build-helper-maven-plugin.version}</version>
|
||||
<inherited>false</inherited>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-antrun-plugin</artifactId>
|
||||
@@ -1061,22 +1162,22 @@
|
||||
<dependency>
|
||||
<groupId>org.apache.ant</groupId>
|
||||
<artifactId>ant-nodeps</artifactId>
|
||||
<version>1.8.1</version>
|
||||
<version>${ant-nodeps.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.tigris.antelope</groupId>
|
||||
<artifactId>antelopetasks</artifactId>
|
||||
<version>3.2.10</version>
|
||||
<version>${antelopetasks.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jruby</groupId>
|
||||
<artifactId>jruby-complete</artifactId>
|
||||
<version>9.2.7.0</version>
|
||||
<version>${jruby-complete.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.asciidoctor</groupId>
|
||||
<artifactId>asciidoctorj</artifactId>
|
||||
<version>1.6.2</version>
|
||||
<version>${asciidoctorj.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<executions>
|
||||
@@ -1119,6 +1220,25 @@
|
||||
</target>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>package-and-attach-docs-zip</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<target>
|
||||
<zip
|
||||
destfile="${project.build.directory}/${project.artifactId}-${revision}.zip">
|
||||
<!--<zipfileset
|
||||
src="${project.build.directory}/${project.artifactId}-${revision}-javadoc.jar"
|
||||
prefix="api" />-->
|
||||
<!-- <fileset dir="${project.build.directory}/contents"/>-->
|
||||
<fileset dir="${project.build.directory}/generated-docs"/>
|
||||
</zip>
|
||||
</target>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>setup-maven-properties</id>
|
||||
<phase>validate</phase>
|
||||
@@ -1128,48 +1248,79 @@
|
||||
<configuration>
|
||||
<exportAntProperties>true</exportAntProperties>
|
||||
<target>
|
||||
<taskdef
|
||||
resource="net/sf/antcontrib/antcontrib.properties"/>
|
||||
<taskdef name="stringutil"
|
||||
classname="ise.antelope.tasks.StringUtilTask"/>
|
||||
<var name="version-type"
|
||||
value="${project.version}"/>
|
||||
<propertyregex property="version-type"
|
||||
override="true"
|
||||
input="${version-type}"
|
||||
regexp=".*\.(.*)"
|
||||
replace="\1"/>
|
||||
<propertyregex property="version-type"
|
||||
override="true"
|
||||
input="${version-type}"
|
||||
regexp="(M)\d+"
|
||||
<taskdef resource="net/sf/antcontrib/antcontrib.properties"/>
|
||||
<taskdef name="stringutil" classname="ise.antelope.tasks.StringUtilTask"/>
|
||||
<var name="version-type" value="${revision}"/>
|
||||
<propertyregex property="version-type" override="true"
|
||||
input="${version-type}" regexp=".*\.(.*)" replace="\1"/>
|
||||
<propertyregex property="version-type" override="true"
|
||||
input="${version-type}" regexp="(M)\d+" replace="MILESTONE"/>
|
||||
<propertyregex property="version-type" override="true"
|
||||
input="${version-type}" regexp="(RC)\d+"
|
||||
replace="MILESTONE"/>
|
||||
<propertyregex property="version-type"
|
||||
override="true"
|
||||
input="${version-type}"
|
||||
regexp="(RC)\d+"
|
||||
replace="MILESTONE"/>
|
||||
<propertyregex property="version-type"
|
||||
override="true"
|
||||
input="${version-type}"
|
||||
regexp="BUILD-(.*)"
|
||||
<propertyregex property="version-type" override="true"
|
||||
input="${version-type}" regexp="BUILD-(.*)"
|
||||
replace="SNAPSHOT"/>
|
||||
<stringutil string="${version-type}"
|
||||
property="spring-cloud-repo">
|
||||
<stringutil string="${version-type}" property="spring-boot-repo">
|
||||
<lowercase/>
|
||||
</stringutil>
|
||||
<var name="github-tag"
|
||||
value="v${project.version}"/>
|
||||
<propertyregex property="github-tag"
|
||||
override="true"
|
||||
input="${github-tag}"
|
||||
regexp=".*SNAPSHOT"
|
||||
replace="master"/>
|
||||
<var name="github-tag" value="${git.branch}"/>
|
||||
<condition property="docs-url"
|
||||
value="https://cloud.spring.io/${docs.main}/">
|
||||
<and>
|
||||
<equals arg1="${version-type}" arg2="SNAPSHOT"/>
|
||||
<equals arg1="${git.branch}" arg2="master"/>
|
||||
</and>
|
||||
</condition>
|
||||
<condition property="docs-url"
|
||||
value="https://cloud.spring.io/${docs.main}/${git.branch}/">
|
||||
<and>
|
||||
<equals arg1="${version-type}" arg2="SNAPSHOT"/>
|
||||
<not>
|
||||
<equals arg1="${git.branch}" arg2="master"/>
|
||||
</not>
|
||||
</and>
|
||||
</condition>
|
||||
<condition property="docs-url"
|
||||
value="https://cloud.spring.io/spring-cloud-static/${docs.main}/${project.version}">
|
||||
<and>
|
||||
<not>
|
||||
<equals arg1="${version-type}" arg2="SNAPSHOT"/>
|
||||
</not>
|
||||
</and>
|
||||
</condition>
|
||||
<propertyregex property="raw-docs-url" override="true"
|
||||
input="${docs-url}" regexp="https://cloud.spring.io/(.*)"
|
||||
replace="https://raw.githubusercontent.com/\1"/>
|
||||
</target>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>build-helper-maven-plugin</artifactId>
|
||||
<version>${build-helper-maven-plugin.version}</version>
|
||||
<inherited>false</inherited>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-zip</id>
|
||||
<goals>
|
||||
<goal>attach-artifact</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<artifacts>
|
||||
<artifact>
|
||||
<file>
|
||||
${project.build.directory}/${project.artifactId}-${project.version}.zip
|
||||
</file>
|
||||
<type>zip</type>
|
||||
</artifact>
|
||||
</artifacts>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.jfrog.buildinfo</groupId>
|
||||
<artifactId>artifactory-maven-plugin</artifactId>
|
||||
|
||||
Reference in New Issue
Block a user