diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml
new file mode 100644
index 0000000..be4b92d
--- /dev/null
+++ b/.github/workflows/deploy-docs.yml
@@ -0,0 +1,32 @@
+name: Deploy Docs
+on:
+ push:
+ branches-ignore: [ gh-pages ]
+ tags: '**'
+ repository_dispatch:
+ types: request-build-reference # legacy
+ #schedule:
+ #- cron: '0 10 * * *' # Once per day at 10am UTC
+ workflow_dispatch:
+permissions:
+ actions: write
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ # if: github.repository_owner == 'spring-cloud'
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+ with:
+ ref: docs-build
+ fetch-depth: 1
+ - name: Dispatch (partial build)
+ if: github.ref_type == 'branch'
+ env:
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ run: gh workflow run deploy-docs.yml -r $(git rev-parse --abbrev-ref HEAD) -f build-refname=${{ github.ref_name }}
+ - name: Dispatch (full build)
+ if: github.ref_type == 'tag'
+ env:
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ run: gh workflow run deploy-docs.yml -r $(git rev-parse --abbrev-ref HEAD)
diff --git a/.gitignore b/.gitignore
index 4bb61be..906e75f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -16,3 +16,10 @@ target/
*.iws
.factorypath
.flattened-pom.xml
+*.log
+
+node
+node_modules
+build
+package.json
+package-lock.json
diff --git a/.mvn/wrapper/maven-wrapper.jar b/.mvn/wrapper/maven-wrapper.jar
index 2cc7d4a..c1dd12f 100644
Binary files a/.mvn/wrapper/maven-wrapper.jar and b/.mvn/wrapper/maven-wrapper.jar differ
diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties
index 642d572..8c79a83 100644
--- a/.mvn/wrapper/maven-wrapper.properties
+++ b/.mvn/wrapper/maven-wrapper.properties
@@ -1,2 +1,18 @@
-distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
-wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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
+#
+# http://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.
+distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.4/apache-maven-3.8.4-bin.zip
+wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar
diff --git a/README.adoc b/README.adoc
index 63a6090..0ab3a0c 100644
--- a/README.adoc
+++ b/README.adoc
@@ -31,236 +31,7 @@ IMPORTANT: If you're releasing milestones don't forget to add `-Pmilestone` and
== Contributing
-:spring-cloud-build-branch: master
-
-Spring Cloud is released under the non-restrictive Apache 2.0 license,
-and follows a very standard Github development process, using Github
-tracker for issues and merging pull requests into master. If you want
-to contribute even something trivial please do not hesitate, but
-follow the guidelines below.
-
-=== Sign the Contributor License Agreement
-Before we accept a non-trivial patch or pull request we will need you to sign the
-https://cla.pivotal.io/sign/spring[Contributor License Agreement].
-Signing the contributor's agreement does not grant anyone commit rights to the main
-repository, but it does mean that we can accept your contributions, and you will get an
-author credit if we do. Active contributors might be asked to join the core team, and
-given the ability to merge pull requests.
-
-=== Code of Conduct
-This project adheres to the Contributor Covenant https://github.com/spring-cloud/spring-cloud-build/blob/master/docs/src/main/asciidoc/code-of-conduct.adoc[code of
-conduct]. By participating, you are expected to uphold this code. Please report
-unacceptable behavior to spring-code-of-conduct@pivotal.io.
-
-=== Code Conventions and Housekeeping
-None of these is essential for a pull request, but they will all help. They can also be
-added after the original pull request but before a merge.
-
-* Use the Spring Framework code format conventions. If you use Eclipse
- you can import formatter settings using the
- `eclipse-code-formatter.xml` file from the
- https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-dependencies-parent/eclipse-code-formatter.xml[Spring
- Cloud Build] project. If using IntelliJ, you can use the
- https://plugins.jetbrains.com/plugin/6546[Eclipse Code Formatter
- Plugin] to import the same file.
-* Make sure all new `.java` files to have a simple Javadoc class comment with at least an
- `@author` tag identifying you, and preferably at least a paragraph on what the class is
- for.
-* Add the ASF license header comment to all new `.java` files (copy from existing files
- in the project)
-* Add yourself as an `@author` to the .java files that you modify substantially (more
- than cosmetic changes).
-* Add some Javadocs and, if you change the namespace, some XSD doc elements.
-* A few unit tests would help a lot as well -- someone has to do it.
-* If no-one else is using your branch, please rebase it against the current master (or
- other target branch in the main project).
-* When writing a commit message please follow https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html[these conventions],
- if you are fixing an existing issue please add `Fixes gh-XXXX` at the end of the commit
- message (where XXXX is the issue number).
-
-=== Checkstyle
-
-Spring Cloud Build comes with a set of checkstyle rules. You can find them in the `spring-cloud-build-tools` module. The most notable files under the module are:
-
-.spring-cloud-build-tools/
-----
-└── src
- ├── checkstyle
- │ └── checkstyle-suppressions.xml <3>
- └── main
- └── resources
- ├── checkstyle-header.txt <2>
- └── checkstyle.xml <1>
-----
-<1> Default Checkstyle rules
-<2> File header setup
-<3> Default suppression rules
-
-==== Checkstyle configuration
-
-Checkstyle rules are *disabled by default*. To add checkstyle to your project just define the following properties and plugins.
-
-.pom.xml
-----
-
-true <1>
- true
- <2>
- true
- <3>
-
-
-
-
- <4>
- io.spring.javaformat
- spring-javaformat-maven-plugin
-
- <5>
- org.apache.maven.plugins
- maven-checkstyle-plugin
-
-
-
-
-
- <5>
- org.apache.maven.plugins
- maven-checkstyle-plugin
-
-
-
-
-----
-<1> Fails the build upon Checkstyle errors
-<2> Fails the build upon Checkstyle violations
-<3> Checkstyle analyzes also the test sources
-<4> Add the Spring Java Format plugin that will reformat your code to pass most of the Checkstyle formatting rules
-<5> Add checkstyle plugin to your build and reporting phases
-
-If you need to suppress some rules (e.g. line length needs to be longer), then it's enough for you to define a file under `${project.root}/src/checkstyle/checkstyle-suppressions.xml` with your suppressions. Example:
-
-.projectRoot/src/checkstyle/checkstyle-suppresions.xml
-----
-
-
-
-
-
-
-----
-
-It's advisable to copy the `${spring-cloud-build.rootFolder}/.editorconfig` and `${spring-cloud-build.rootFolder}/.springformat` to your project. That way, some default formatting rules will be applied. You can do so by running this script:
-
-```bash
-$ curl https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/.editorconfig -o .editorconfig
-$ touch .springformat
-```
-
-=== IDE setup
-
-==== Intellij IDEA
-
-In order to setup Intellij you should import our coding conventions, inspection profiles and set up the checkstyle plugin.
-The following files can be found in the https://github.com/spring-cloud/spring-cloud-build/tree/master/spring-cloud-build-tools[Spring Cloud Build] project.
-
-.spring-cloud-build-tools/
-----
-└── src
- ├── checkstyle
- │ └── checkstyle-suppressions.xml <3>
- └── main
- └── resources
- ├── checkstyle-header.txt <2>
- ├── checkstyle.xml <1>
- └── intellij
- ├── Intellij_Project_Defaults.xml <4>
- └── Intellij_Spring_Boot_Java_Conventions.xml <5>
-----
-<1> Default Checkstyle rules
-<2> File header setup
-<3> Default suppression rules
-<4> Project defaults for Intellij that apply most of Checkstyle rules
-<5> Project style conventions for Intellij that apply most of Checkstyle rules
-
-.Code style
-
-image::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/{spring-cloud-build-branch}/docs/src/main/asciidoc/images/intellij-code-style.png[Code style]
-
-Go to `File` -> `Settings` -> `Editor` -> `Code style`. There click on the icon next to the `Scheme` section. There, click on the `Import Scheme` value and pick the `Intellij IDEA code style XML` option. Import the `spring-cloud-build-tools/src/main/resources/intellij/Intellij_Spring_Boot_Java_Conventions.xml` file.
-
-.Inspection profiles
-
-image::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/{spring-cloud-build-branch}/docs/src/main/asciidoc/images/intellij-inspections.png[Code style]
-
-Go to `File` -> `Settings` -> `Editor` -> `Inspections`. There click on the icon next to the `Profile` section. There, click on the `Import Profile` and import the `spring-cloud-build-tools/src/main/resources/intellij/Intellij_Project_Defaults.xml` file.
-
-.Checkstyle
-
-To have Intellij work with Checkstyle, you have to install the `Checkstyle` plugin. It's advisable to also install the `Assertions2Assertj` to automatically convert the JUnit assertions
-
-image::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/{spring-cloud-build-branch}/docs/src/main/asciidoc/images/intellij-checkstyle.png[Checkstyle]
-
-Go to `File` -> `Settings` -> `Other settings` -> `Checkstyle`. There click on the `+` icon in the `Configuration file` section. There, you'll have to define where the checkstyle rules should be picked from. In the image above, we've picked the rules from the cloned Spring Cloud Build repository. However, you can point to the Spring Cloud Build's GitHub repository (e.g. for the `checkstyle.xml` : `https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/main/resources/checkstyle.xml`). We need to provide the following variables:
-
-- `checkstyle.header.file` - please point it to the Spring Cloud Build's, `spring-cloud-build-tools/src/main/resources/checkstyle-header.txt` file either in your cloned repo or via the `https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/main/resources/checkstyle-header.txt` URL.
-- `checkstyle.suppressions.file` - default suppressions. Please point it to the Spring Cloud Build's, `spring-cloud-build-tools/src/checkstyle/checkstyle-suppressions.xml` file either in your cloned repo or via the `https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/checkstyle/checkstyle-suppressions.xml` URL.
-- `checkstyle.additional.suppressions.file` - this variable corresponds to suppressions in your local project. E.g. you're working on `spring-cloud-contract`. Then point to the `project-root/src/checkstyle/checkstyle-suppressions.xml` folder. Example for `spring-cloud-contract` would be: `/home/username/spring-cloud-contract/src/checkstyle/checkstyle-suppressions.xml`.
-
-IMPORTANT: Remember to set the `Scan Scope` to `All sources` since we apply checkstyle rules for production and test sources.
-
-=== Duplicate Finder
-
-Spring Cloud Build brings along the `basepom:duplicate-finder-maven-plugin`, that enables flagging duplicate and conflicting classes and resources on the java classpath.
-
-==== Duplicate Finder configuration
-
-Duplicate finder is *enabled by default* and will run in the `verify` phase of your Maven build, but it will only take effect in your project if you add the `duplicate-finder-maven-plugin` to the `build` section of the projecst's `pom.xml`.
-
-.pom.xml
-[source,xml]
-----
-
-
-
- org.basepom.maven
- duplicate-finder-maven-plugin
-
-
-
-----
-
-For other properties, we have set defaults as listed in the https://github.com/basepom/duplicate-finder-maven-plugin/wiki[plugin documentation].
-
-You can easily override them but setting the value of the selected property prefixed with `duplicate-finder-maven-plugin`. For example, set `duplicate-finder-maven-plugin.skip` to `true` in order to skip duplicates check in your build.
-
-If you need to add `ignoredClassPatterns` or `ignoredResourcePatterns` to your setup, make sure to add them in the plugin configuration section of your project:
-
-[source,xml]
-----
-
-
-
- org.basepom.maven
- duplicate-finder-maven-plugin
-
-
- org.joda.time.base.BaseDateTime
- .*module-info
-
-
- changelog.txt
-
-
-
-
-
-
-
-----
-
+Unresolved directive in - include::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/main/docs/src/main/asciidoc/contributing.adoc[]
== Building and Deploying
diff --git a/docs/antora-playbook.yml b/docs/antora-playbook.yml
new file mode 100644
index 0000000..d9ee86f
--- /dev/null
+++ b/docs/antora-playbook.yml
@@ -0,0 +1,38 @@
+antora:
+ extensions:
+ - '@springio/antora-extensions/partial-build-extension'
+ - require: '@springio/antora-extensions/latest-version-extension'
+ - require: '@springio/antora-extensions/inject-collector-cache-config-extension'
+ - '@antora/collector-extension'
+ - '@antora/atlas-extension'
+ - require: '@springio/antora-extensions/root-component-extension'
+ root_component_name: 'cloud-release'
+site:
+ title: Spring Cloud Release
+ url: https://docs.spring.io/spring-cloud-release/reference/
+content:
+ sources:
+ - url: ./..
+ branches: HEAD
+ start_path: docs
+ worktrees: true
+asciidoc:
+ attributes:
+ page-stackoverflow-url: https://stackoverflow.com/tags/spring-cloud
+ page-pagination: ''
+ hide-uri-scheme: '@'
+ tabs-sync-option: '@'
+ chomp: 'all'
+ extensions:
+ - '@asciidoctor/tabs'
+ - '@springio/asciidoctor-extensions'
+ sourcemap: true
+urls:
+ latest_version_segment: ''
+runtime:
+ log:
+ failure_level: warn
+ format: pretty
+ui:
+ bundle:
+ url: https://github.com/spring-io/antora-ui-spring/releases/download/v0.3.5/ui-bundle.zip
diff --git a/docs/antora.yml b/docs/antora.yml
new file mode 100644
index 0000000..1031e5a
--- /dev/null
+++ b/docs/antora.yml
@@ -0,0 +1,12 @@
+name: cloud-release
+version: true
+title: Spring Cloud Release
+nav:
+ - modules/ROOT/nav.adoc
+ext:
+ collector:
+ run:
+ command: ./mvnw --no-transfer-progress -B process-resources -Pdocs -pl docs -Dantora-maven-plugin.phase=none -Dgenerate-docs.phase=none -Dgenerate-readme.phase=none -Dgenerate-cloud-resources.phase=none -Dmaven-dependency-plugin-for-docs.phase=none -Dmaven-dependency-plugin-for-docs-classes.phase=none -DskipTests
+ local: true
+ scan:
+ dir: ./target/classes/antora-resources/
diff --git a/docs/modules/ROOT/nav.adoc b/docs/modules/ROOT/nav.adoc
new file mode 100644
index 0000000..f365a6f
--- /dev/null
+++ b/docs/modules/ROOT/nav.adoc
@@ -0,0 +1,2 @@
+* xref:index.adoc[]
+* xref:legal.adoc[]
\ No newline at end of file
diff --git a/docs/modules/ROOT/pages/_spring-cloud-links.adoc b/docs/modules/ROOT/pages/_spring-cloud-links.adoc
new file mode 100644
index 0000000..8d15b9c
--- /dev/null
+++ b/docs/modules/ROOT/pages/_spring-cloud-links.adoc
@@ -0,0 +1,17 @@
+ https://docs.spring.io/spring-cloud-build/reference/4.1-SNAPSHOT/[spring-cloud-build] :: Reference Documentation, version 4.1.0-SNAPSHOT
+ https://docs.spring.io/spring-cloud-bus/reference/4.1-SNAPSHOT/[spring-cloud-bus] :: Reference Documentation, version 4.1.0-SNAPSHOT
+ https://docs.spring.io/spring-cloud-circuitbreaker/reference/3.1-SNAPSHOT/[spring-cloud-circuitbreaker] :: Reference Documentation, version 3.1.0-SNAPSHOT
+ https://docs.spring.io/spring-cloud-commons/reference/4.1-SNAPSHOT/[spring-cloud-commons] :: Reference Documentation, version 4.1.0-SNAPSHOT
+ https://docs.spring.io/spring-cloud-config/reference/4.1-SNAPSHOT/[spring-cloud-config] :: Reference Documentation, version 4.1.0-SNAPSHOT
+ https://docs.spring.io/spring-cloud-consul/reference/4.1-SNAPSHOT/[spring-cloud-consul] :: Reference Documentation, version 4.1.0-SNAPSHOT
+ https://docs.spring.io/spring-cloud-contract/reference/4.1-SNAPSHOT/[spring-cloud-contract] :: Reference Documentation, version 4.1.0-SNAPSHOT
+ https://docs.spring.io/spring-cloud-function/reference/4.1-SNAPSHOT/[spring-cloud-function] :: Reference Documentation, version 4.1.0-SNAPSHOT
+ https://docs.spring.io/spring-cloud-gateway/reference/4.1-SNAPSHOT/[spring-cloud-gateway] :: Reference Documentation, version 4.1.0-SNAPSHOT
+ https://docs.spring.io/spring-cloud-kubernetes/reference/3.1-SNAPSHOT/[spring-cloud-kubernetes] :: Reference Documentation, version 3.1.0-SNAPSHOT
+ https://docs.spring.io/spring-cloud-netflix/reference/4.1-SNAPSHOT/[spring-cloud-netflix] :: Reference Documentation, version 4.1.0-SNAPSHOT
+ https://docs.spring.io/spring-cloud-openfeign/reference/4.1-SNAPSHOT/[spring-cloud-openfeign] :: Reference Documentation, version 4.1.0-SNAPSHOT
+ https://docs.spring.io/spring-cloud-stream/reference/4.1-SNAPSHOT/[spring-cloud-stream] :: Reference Documentation, version 4.1.0-SNAPSHOT
+ https://docs.spring.io/spring-cloud-task/reference/3.1-SNAPSHOT/[spring-cloud-task] :: Reference Documentation, version 3.1.0-SNAPSHOT
+ https://docs.spring.io/spring-cloud-vault/reference/4.1-SNAPSHOT/[spring-cloud-vault] :: Reference Documentation, version 4.1.0-SNAPSHOT
+ https://docs.spring.io/spring-cloud-zookeeper/reference/4.1-SNAPSHOT/[spring-cloud-zookeeper] :: Reference Documentation, version 4.1.0-SNAPSHOT
+
diff --git a/train-docs/src/main/resources/templates/spring-cloud/spring-cloud.hbs b/docs/modules/ROOT/pages/index.adoc
similarity index 68%
rename from train-docs/src/main/resources/templates/spring-cloud/spring-cloud.hbs
rename to docs/modules/ROOT/pages/index.adoc
index 531a3ed..7572d1d 100644
--- a/train-docs/src/main/resources/templates/spring-cloud/spring-cloud.hbs
+++ b/docs/modules/ROOT/pages/index.adoc
@@ -1,9 +1,6 @@
-= Spring Cloud
+= Spring Cloud Train Reference Documentation
-include::_attributes.adoc[]
-include::_spring-cloud-attributes.adoc[]
-
-:basedir: {project-root}
+:spring-boot-version: 3.2.0-SNAPSHOT
Spring Cloud provides tools for developers to quickly build some of
the common patterns in distributed systems (e.g. configuration
@@ -32,13 +29,9 @@ and extensibility mechanism to cover others.
* Circuit Breakers
* Distributed messaging
-The reference documentation consists of the following sections:
+== Release Train Projects
+
+Below we present links to the reference documentation of all the projects that contribute to this reference train.
[horizontal]
-<> :: Legal information.
-<> :: About the Documentation, Getting Help, First Steps, and more.
include::_spring-cloud-links.adoc[]
-
-= Appendix: Compendium of Configuration Properties
-
-link:configprops.html[Spring Cloud configuration properties]
diff --git a/docs/modules/ROOT/pages/legal.adoc b/docs/modules/ROOT/pages/legal.adoc
new file mode 100644
index 0000000..ab7bdf4
--- /dev/null
+++ b/docs/modules/ROOT/pages/legal.adoc
@@ -0,0 +1,11 @@
+[legal]
+= Legal
+
+{spring-cloud-version}
+
+Copyright © 2012-2023
+
+Copies of this document may be made for your own use and for distribution to
+others, provided that you do not charge any fee for such copies and further
+provided that each copy contains this Copyright Notice, whether distributed in
+print or electronically.
\ No newline at end of file
diff --git a/docs/pom.xml b/docs/pom.xml
index 5dc0535..8940476 100644
--- a/docs/pom.xml
+++ b/docs/pom.xml
@@ -8,38 +8,147 @@
spring-cloud-starter-build
2023.0.0-SNAPSHOT
- pom
+ jar
Spring Cloud Starter Docs
- Spring Cloud Docs
+ Spring Cloud Starter Docs
- spring-cloud-starters
${basedir}/..
- deploy
+
+ 3.8.5
+ 4.3.0
+ 2.5.3
+ 2.11.0
+
+
+ org.springframework
+ spring-core
+
+
+ org.apache.maven
+ maven-model
+ ${maven.version}
+
+
+ com.github.jknack
+ handlebars
+ ${handlebars.version}
+
+
+ commons-io
+ commons-io
+ ${commons-io.version}
+
+
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
+
+
+
+
+ org.codehaus.mojo
+ build-helper-maven-plugin
+ 3.4.0
+
+
+ generate-sources
+ generate-sources
+
+ add-source
+ add-resource
+
+
+
+ src/main/asciidoc
+ src/main/java
+
+
+
+ src/main/resources
+
+
+
+
+
+ generate-test-sources
+ generate-test-sources
+
+ add-test-source
+ add-test-resource
+
+
+
+ src/test/java
+
+
+
+ src/test/resources
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+
+
+
docs
+
+
+ src/main/antora/resources/antora-resources
+ true
+
+
pl.project13.maven
git-commit-id-plugin
+ org.apache.maven.plugins
maven-dependency-plugin
-
- maven-resources-plugin
-
org.codehaus.mojo
exec-maven-plugin
+
+
+ run-template-generation
+ ${generate-docs.phase}
+
+ java
+
+
+ true
+ org.springframework.cloud.internal.GenerateReleaseTrainDocs
+
+ ${maven.multiModuleProjectDirectory}/spring-cloud-dependencies/pom.xml
+ ${maven.multiModuleProjectDirectory}/spring-cloud-starter-parent/pom.xml
+ ${project.basedir}/modules/ROOT/pages/
+
+
+
+
- org.asciidoctor
- asciidoctor-maven-plugin
+ io.spring.maven.antora
+ antora-component-version-maven-plugin
+ io.spring.maven.antora
+ antora-maven-plugin
+
+
+ org.apache.maven.plugins
maven-antrun-plugin
diff --git a/docs/src/main/antora/resources/antora-resources/antora.yml b/docs/src/main/antora/resources/antora-resources/antora.yml
new file mode 100644
index 0000000..9148923
--- /dev/null
+++ b/docs/src/main/antora/resources/antora-resources/antora.yml
@@ -0,0 +1,20 @@
+version: @antora-component.version@
+prerelease: @antora-component.prerelease@
+
+asciidoc:
+ attributes:
+ attribute-missing: 'warn'
+ chomp: 'all'
+ project-root: @maven.multiModuleProjectDirectory@
+ github-repo: @docs.main@
+ github-raw: https://raw.githubusercontent.com/spring-cloud/@docs.main@/@github-tag@
+ github-code: https://github.com/spring-cloud/@docs.main@/tree/@github-tag@
+ github-issues: https://github.com/spring-cloud/@docs.main@/issues/
+ github-wiki: https://github.com/spring-cloud/@docs.main@/wiki
+ spring-cloud-version: @project.version@
+ github-tag: @github-tag@
+ version-type: @version-type@
+ docs-url: https://docs.spring.io/@docs.main@/docs/@project.version@
+ raw-docs-url: https://raw.githubusercontent.com/spring-cloud/@docs.main@/@github-tag@
+ project-version: @project.version@
+ project-name: @docs.main@
diff --git a/docs/src/main/asciidoc/README.adoc b/docs/src/main/asciidoc/README.adoc
index bdda366..d273d6e 100644
--- a/docs/src/main/asciidoc/README.adoc
+++ b/docs/src/main/asciidoc/README.adoc
@@ -2,7 +2,7 @@ include::intro.adoc[]
== Contributing
-include::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/docs/src/main/asciidoc/contributing.adoc[]
+include::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/main/docs/src/main/asciidoc/contributing.adoc[]
== Building and Deploying
diff --git a/docs/src/main/asciidoc/ghpages.sh b/docs/src/main/asciidoc/ghpages.sh
deleted file mode 100755
index f051e69..0000000
--- a/docs/src/main/asciidoc/ghpages.sh
+++ /dev/null
@@ -1,330 +0,0 @@
-#!/bin/bash -x
-
-set -e
-
-# Set default props like MAVEN_PATH, ROOT_FOLDER etc.
-function set_default_props() {
- # The script should be executed from the root folder
- ROOT_FOLDER=`pwd`
- echo "Current folder is ${ROOT_FOLDER}"
-
- if [[ ! -e "${ROOT_FOLDER}/.git" ]]; then
- echo "You're not in the root folder of the project!"
- exit 1
- fi
-
- # Prop that will let commit the changes
- COMMIT_CHANGES="no"
- MAVEN_PATH=${MAVEN_PATH:-}
- echo "Path to Maven is [${MAVEN_PATH}]"
- REPO_NAME=${PWD##*/}
- echo "Repo name is [${REPO_NAME}]"
- SPRING_CLOUD_STATIC_REPO=${SPRING_CLOUD_STATIC_REPO:-git@github.com:spring-cloud/spring-cloud-static.git}
- echo "Spring Cloud Static repo is [${SPRING_CLOUD_STATIC_REPO}"
-}
-
-# Check if gh-pages exists and docs have been built
-function check_if_anything_to_sync() {
- git remote set-url --push origin `git config remote.origin.url | sed -e 's/^git:/https:/'`
-
- if ! (git remote set-branches --add origin gh-pages && git fetch -q); then
- echo "No gh-pages, so not syncing"
- exit 0
- fi
-
- if ! [ -d docs/target/generated-docs ] && ! [ "${BUILD}" == "yes" ]; then
- echo "No gh-pages sources in docs/target/generated-docs, so not syncing"
- exit 0
- fi
-}
-
-function retrieve_current_branch() {
- # Code getting the name of the current branch. For master we want to publish as we did until now
- # https://stackoverflow.com/questions/1593051/how-to-programmatically-determine-the-current-checked-out-git-branch
- # If there is a branch already passed will reuse it - otherwise will try to find it
- CURRENT_BRANCH=${BRANCH}
- if [[ -z "${CURRENT_BRANCH}" ]] ; then
- CURRENT_BRANCH=$(git symbolic-ref -q HEAD)
- CURRENT_BRANCH=${CURRENT_BRANCH##refs/heads/}
- CURRENT_BRANCH=${CURRENT_BRANCH:-HEAD}
- fi
- echo "Current branch is [${CURRENT_BRANCH}]"
- git checkout ${CURRENT_BRANCH} || echo "Failed to check the branch... continuing with the script"
-}
-
-# Switches to the provided value of the release version. We always prefix it with `v`
-function switch_to_tag() {
- git checkout v${VERSION}
-}
-
-# Build the docs if switch is on
-function build_docs_if_applicable() {
- if [[ "${BUILD}" == "yes" ]] ; then
- ./mvnw clean install -P docs -pl docs -DskipTests
- fi
-}
-
-# Get the name of the `docs.main` property
-# Get whitelisted branches - assumes that a `docs` module is available under `docs` profile
-function retrieve_doc_properties() {
- MAIN_ADOC_VALUE=$("${MAVEN_PATH}"mvn -q \
- -Dexec.executable="echo" \
- -Dexec.args='${docs.main}' \
- --non-recursive \
- org.codehaus.mojo:exec-maven-plugin:1.3.1:exec)
- echo "Extracted 'main.adoc' from Maven build [${MAIN_ADOC_VALUE}]"
-
-
- WHITELIST_PROPERTY=${WHITELIST_PROPERTY:-"docs.whitelisted.branches"}
- WHITELISTED_BRANCHES_VALUE=$("${MAVEN_PATH}"mvn -q \
- -Dexec.executable="echo" \
- -Dexec.args="\${${WHITELIST_PROPERTY}}" \
- org.codehaus.mojo:exec-maven-plugin:1.3.1:exec \
- -P docs \
- -pl docs)
- echo "Extracted '${WHITELIST_PROPERTY}' from Maven build [${WHITELISTED_BRANCHES_VALUE}]"
-}
-
-# Stash any outstanding changes
-function stash_changes() {
- git diff-index --quiet HEAD && dirty=$? || (echo "Failed to check if the current repo is dirty. Assuming that it is." && dirty="1")
- if [ "$dirty" != "0" ]; then git stash; fi
-}
-
-# Switch to gh-pages branch to sync it with current branch
-function add_docs_from_target() {
- local DESTINATION_REPO_FOLDER
- if [[ -z "${DESTINATION}" && -z "${CLONE}" ]] ; then
- DESTINATION_REPO_FOLDER=${ROOT_FOLDER}
- elif [[ "${CLONE}" == "yes" ]]; then
- mkdir -p ${ROOT_FOLDER}/target
- local clonedStatic=${ROOT_FOLDER}/target/spring-cloud-static
- if [[ ! -e "${clonedStatic}/.git" ]]; then
- echo "Cloning Spring Cloud Static to target"
- git clone ${SPRING_CLOUD_STATIC_REPO} ${clonedStatic} && git checkout gh-pages
- else
- echo "Spring Cloud Static already cloned - will pull changes"
- cd ${clonedStatic} && git checkout gh-pages && git pull origin gh-pages
- fi
- DESTINATION_REPO_FOLDER=${clonedStatic}/${REPO_NAME}
- mkdir -p ${DESTINATION_REPO_FOLDER}
- else
- if [[ ! -e "${DESTINATION}/.git" ]]; then
- echo "[${DESTINATION}] is not a git repository"
- exit 1
- fi
- DESTINATION_REPO_FOLDER=${DESTINATION}/${REPO_NAME}
- mkdir -p ${DESTINATION_REPO_FOLDER}
- echo "Destination was provided [${DESTINATION}]"
- fi
- cd ${DESTINATION_REPO_FOLDER}
- git checkout gh-pages
- git pull origin gh-pages
-
- # Add git branches
- ###################################################################
- if [[ -z "${VERSION}" ]] ; then
- copy_docs_for_current_version
- else
- copy_docs_for_provided_version
- fi
- commit_changes_if_applicable
-}
-
-
-# Copies the docs by using the retrieved properties from Maven build
-function copy_docs_for_current_version() {
- if [[ "${CURRENT_BRANCH}" == "master" ]] ; then
- echo -e "Current branch is master - will copy the current docs only to the root folder"
- for f in docs/target/generated-docs/*; do
- file=${f#docs/target/generated-docs/*}
- if ! git ls-files -i -o --exclude-standard --directory | grep -q ^$file$; then
- # Not ignored...
- cp -rf $f ${ROOT_FOLDER}/
- git add -A ${ROOT_FOLDER}/$file
- fi
- done
- COMMIT_CHANGES="yes"
- else
- echo -e "Current branch is [${CURRENT_BRANCH}]"
- # https://stackoverflow.com/questions/29300806/a-bash-script-to-check-if-a-string-is-present-in-a-comma-separated-list-of-strin
- if [[ ",${WHITELISTED_BRANCHES_VALUE}," = *",${CURRENT_BRANCH},"* ]] ; then
- mkdir -p ${ROOT_FOLDER}/${CURRENT_BRANCH}
- echo -e "Branch [${CURRENT_BRANCH}] is whitelisted! Will copy the current docs to the [${CURRENT_BRANCH}] folder"
- for f in docs/target/generated-docs/*; do
- file=${f#docs/target/generated-docs/*}
- if ! git ls-files -i -o --exclude-standard --directory | grep -q ^$file$; then
- # Not ignored...
- # We want users to access 1.0.0.BUILD-SNAPSHOT/ 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 add -A ${ROOT_FOLDER}/${CURRENT_BRANCH}/index.html
- else
- cp -rf $f ${ROOT_FOLDER}/${CURRENT_BRANCH}
- git add -A ${ROOT_FOLDER}/${CURRENT_BRANCH}/$file
- fi
- fi
- done
- COMMIT_CHANGES="yes"
- else
- echo -e "Branch [${CURRENT_BRANCH}] is not on the white list! Check out the Maven [${WHITELIST_PROPERTY}] property in
- [docs] module available under [docs] profile. Won't commit any changes to gh-pages for this branch."
- fi
- fi
-}
-
-# Copies the docs by using the explicitly provided version
-function copy_docs_for_provided_version() {
- local FOLDER=${DESTINATION_REPO_FOLDER}/${VERSION}
- mkdir -p ${FOLDER}
- echo -e "Current tag is [v${VERSION}] Will copy the current docs to the [${FOLDER}] folder"
- for f in ${ROOT_FOLDER}/docs/target/generated-docs/*; do
- file=${f#${ROOT_FOLDER}/docs/target/generated-docs/*}
- copy_docs_for_branch ${file} ${FOLDER}
- done
- COMMIT_CHANGES="yes"
- CURRENT_BRANCH="v${VERSION}"
-}
-
-# Copies the docs from target to the provided destination
-# Params:
-# $1 - file from target
-# $2 - destination to which copy the files
-function copy_docs_for_branch() {
- local file=$1
- local destination=$2
- if ! git ls-files -i -o --exclude-standard --directory | grep -q ^${file}$; then
- # Not ignored...
- # We want users to access 1.0.0.BUILD-SNAPSHOT/ 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
- git add -A ${destination}/index.html
- else
- cp -rf $f ${destination}
- git add -A ${destination}/$file
- fi
- fi
-}
-
-function commit_changes_if_applicable() {
- if [[ "${COMMIT_CHANGES}" == "yes" ]] ; then
- COMMIT_SUCCESSFUL="no"
- git commit -a -m "Sync docs from ${CURRENT_BRANCH} to gh-pages" && COMMIT_SUCCESSFUL="yes" || echo "Failed to commit changes"
-
- # Uncomment the following push if you want to auto push to
- # the gh-pages branch whenever you commit to master locally.
- # This is a little extreme. Use with care!
- ###################################################################
- if [[ "${COMMIT_SUCCESSFUL}" == "yes" ]] ; then
- git push origin gh-pages
- fi
- fi
-}
-
-# Switch back to the previous branch and exit block
-function checkout_previous_branch() {
- # If -version was provided we need to come back to root project
- cd ${ROOT_FOLDER}
- git checkout ${CURRENT_BRANCH} || echo "Failed to check the branch... continuing with the script"
- if [ "$dirty" != "0" ]; then git stash pop; fi
- exit 0
-}
-
-# Assert if properties have been properly passed
-function assert_properties() {
-echo "VERSION [${VERSION}], DESTINATION [${DESTINATION}], CLONE [${CLONE}]"
-if [[ "${VERSION}" != "" && (-z "${DESTINATION}" && -z "${CLONE}") ]] ; then echo "Version was set but destination / clone was not!"; exit 1;fi
-if [[ ("${DESTINATION}" != "" && "${CLONE}" != "") && -z "${VERSION}" ]] ; then echo "Destination / clone was set but version was not!"; exit 1;fi
-if [[ "${DESTINATION}" != "" && "${CLONE}" == "yes" ]] ; then echo "Destination and clone was set. Pick one!"; exit 1;fi
-}
-
-# Prints the usage
-function print_usage() {
-cat </`
-- if the destination switch is passed (-d) then the script will check if the provided dir is a git repo and then will
- switch to gh-pages of that repo and copy the generated docs to `docs//`
-
-USAGE:
-
-You can use the following options:
-
--v|--version - the script will apply the whole procedure for a particular library version
--d|--destination - the root of destination folder where the docs should be copied. You have to use the full path.
- E.g. point to spring-cloud-static folder. Can't be used with (-c)
--b|--build - will run the standard build process after checking out the branch
--c|--clone - will automatically clone the spring-cloud-static repo instead of providing the destination.
- Obviously can't be used with (-d)
-
-EOF
-}
-
-
-# ==========================================
-# ____ ____ _____ _____ _____ _______
-# / ____|/ ____| __ \|_ _| __ \__ __|
-# | (___ | | | |__) | | | | |__) | | |
-# \___ \| | | _ / | | | ___/ | |
-# ____) | |____| | \ \ _| |_| | | |
-# |_____/ \_____|_| \_\_____|_| |_|
-#
-# ==========================================
-
-while [[ $# > 0 ]]
-do
-key="$1"
-case ${key} in
- -v|--version)
- VERSION="$2"
- shift # past argument
- ;;
- -d|--destination)
- DESTINATION="$2"
- shift # past argument
- ;;
- -b|--build)
- BUILD="yes"
- ;;
- -c|--clone)
- CLONE="yes"
- ;;
- -h|--help)
- print_usage
- exit 0
- ;;
- *)
- echo "Invalid option: [$1]"
- print_usage
- exit 1
- ;;
-esac
-shift # past argument or value
-done
-
-assert_properties
-set_default_props
-check_if_anything_to_sync
-if [[ -z "${VERSION}" ]] ; then
- retrieve_current_branch
-else
- switch_to_tag
-fi
-build_docs_if_applicable
-retrieve_doc_properties
-stash_changes
-add_docs_from_target
-checkout_previous_branch
\ No newline at end of file
diff --git a/docs/src/main/asciidoc/spring-cloud-starters.adoc b/docs/src/main/asciidoc/spring-cloud-starters.adoc
deleted file mode 100644
index c9f670b..0000000
--- a/docs/src/main/asciidoc/spring-cloud-starters.adoc
+++ /dev/null
@@ -1,5 +0,0 @@
-= Spring Cloud Release Train
-
-include::intro.adoc[]
-
-include::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/docs/src/main/asciidoc/contributing-docs.adoc[]
diff --git a/train-docs/src/main/java/org/springframework/cloud/internal/ArtifactFetcher.java b/docs/src/main/java/org/springframework/cloud/internal/ArtifactFetcher.java
similarity index 100%
rename from train-docs/src/main/java/org/springframework/cloud/internal/ArtifactFetcher.java
rename to docs/src/main/java/org/springframework/cloud/internal/ArtifactFetcher.java
diff --git a/train-docs/src/main/java/org/springframework/cloud/internal/ConfigurationPropertiesAggregator.java b/docs/src/main/java/org/springframework/cloud/internal/ConfigurationPropertiesAggregator.java
similarity index 100%
rename from train-docs/src/main/java/org/springframework/cloud/internal/ConfigurationPropertiesAggregator.java
rename to docs/src/main/java/org/springframework/cloud/internal/ConfigurationPropertiesAggregator.java
diff --git a/train-docs/src/main/java/org/springframework/cloud/internal/ConfigurationProperty.java b/docs/src/main/java/org/springframework/cloud/internal/ConfigurationProperty.java
similarity index 100%
rename from train-docs/src/main/java/org/springframework/cloud/internal/ConfigurationProperty.java
rename to docs/src/main/java/org/springframework/cloud/internal/ConfigurationProperty.java
diff --git a/train-docs/src/main/java/org/springframework/cloud/internal/GenerateReleaseTrainDocs.java b/docs/src/main/java/org/springframework/cloud/internal/GenerateReleaseTrainDocs.java
similarity index 53%
rename from train-docs/src/main/java/org/springframework/cloud/internal/GenerateReleaseTrainDocs.java
rename to docs/src/main/java/org/springframework/cloud/internal/GenerateReleaseTrainDocs.java
index cf8642a..bfb7d47 100644
--- a/train-docs/src/main/java/org/springframework/cloud/internal/GenerateReleaseTrainDocs.java
+++ b/docs/src/main/java/org/springframework/cloud/internal/GenerateReleaseTrainDocs.java
@@ -20,12 +20,7 @@ import java.io.File;
import java.util.Comparator;
import java.util.LinkedList;
import java.util.List;
-import java.util.Objects;
import java.util.Properties;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.Future;
-import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import org.apache.maven.model.Model;
@@ -34,31 +29,20 @@ import static org.springframework.cloud.internal.Logger.info;
public class GenerateReleaseTrainDocs {
- final ExecutorService service;
-
public static void main(String... args) {
File bomPath = new File(args[0]);
File starterParentPath = new File(args[1]);
- String repoUrl = args[2];
- File unzippedDocs = new File(args[3]);
- File generatedTrainDocs = new File(args[4]);
- new GenerateReleaseTrainDocs().generate(bomPath, starterParentPath, repoUrl, unzippedDocs, generatedTrainDocs);
+ File generatedTrainDocs = new File(args[2]);
+ new GenerateReleaseTrainDocs().generate(bomPath, starterParentPath, generatedTrainDocs);
}
- GenerateReleaseTrainDocs() {
- this.service = Executors.newFixedThreadPool(4);
- }
-
- void generate(File bomPath, File starterParentPath, String repoUrl, File unzippedDocs, File generatedTrainDocs) {
+ void generate(File bomPath, File starterParentPath, File generatedTrainDocs) {
List projects = mavenPropertiesToDocsProjects(bomPath);
info("Found the following projects [" + projects + "]");
- List outputFolders = downloadSources(unzippedDocs, projects, repoUrl);
projects.add(springBootVersion(starterParentPath));
projects.sort(Comparator.comparing(o -> o.name));
- List configurationProperties = mergeConfigurationProperties(unzippedDocs);
- File file = renderAsciidocTemplates(generatedTrainDocs, projects, configurationProperties);
+ File file = renderAsciidocTemplates(generatedTrainDocs, projects);
info("Rendered docs templates to [" + file + "]");
- new ResourcesCopier().copy(outputFolders, file);
}
List mavenPropertiesToDocsProjects(File file) {
@@ -74,38 +58,9 @@ public class GenerateReleaseTrainDocs {
return new Project("spring-boot", model.getParent().getVersion());
}
- List downloadSources(File outputFolder, List projects, String repoUrl) {
- ArtifactFetcher fetcher = new ArtifactFetcher(outputFolder, repoUrl);
- try {
- List> futures = new LinkedList<>();
- for (Project project : projects) {
- futures.add(service.submit(() -> fetcher.unpackedDocs(project)));
- }
- List files = futures.stream().map(future -> {
- try {
- return future.get(5, TimeUnit.MINUTES);
- }
- catch (Exception e) {
- throw new IllegalStateException(e);
- }
- }).filter(Objects::nonNull).collect(Collectors.toList());
- info("Unpacked docs modules to the following directories [" + files + "]");
- return files;
- }
- finally {
- service.shutdown();
- }
- }
-
- List mergeConfigurationProperties(File outputFolderWithDocs) {
- ConfigurationPropertiesAggregator aggregator = new ConfigurationPropertiesAggregator();
- return aggregator.mergedConfigurationProperties(outputFolderWithDocs.toPath());
- }
-
- File renderAsciidocTemplates(File generatedTrainDocs, List projects,
- List configurationProperties) {
+ File renderAsciidocTemplates(File generatedTrainDocs, List projects) {
TemplateGenerator templateGenerator = new TemplateGenerator(generatedTrainDocs);
- return templateGenerator.generate(projects, configurationProperties);
+ return templateGenerator.generate(projects);
}
}
diff --git a/train-docs/src/main/java/org/springframework/cloud/internal/HandlebarsHelper.java b/docs/src/main/java/org/springframework/cloud/internal/HandlebarsHelper.java
similarity index 100%
rename from train-docs/src/main/java/org/springframework/cloud/internal/HandlebarsHelper.java
rename to docs/src/main/java/org/springframework/cloud/internal/HandlebarsHelper.java
diff --git a/train-docs/src/main/java/org/springframework/cloud/internal/Logger.java b/docs/src/main/java/org/springframework/cloud/internal/Logger.java
similarity index 100%
rename from train-docs/src/main/java/org/springframework/cloud/internal/Logger.java
rename to docs/src/main/java/org/springframework/cloud/internal/Logger.java
diff --git a/train-docs/src/main/java/org/springframework/cloud/internal/PomReader.java b/docs/src/main/java/org/springframework/cloud/internal/PomReader.java
similarity index 100%
rename from train-docs/src/main/java/org/springframework/cloud/internal/PomReader.java
rename to docs/src/main/java/org/springframework/cloud/internal/PomReader.java
diff --git a/train-docs/src/main/java/org/springframework/cloud/internal/Project.java b/docs/src/main/java/org/springframework/cloud/internal/Project.java
similarity index 100%
rename from train-docs/src/main/java/org/springframework/cloud/internal/Project.java
rename to docs/src/main/java/org/springframework/cloud/internal/Project.java
diff --git a/train-docs/src/main/java/org/springframework/cloud/internal/TemplateGenerator.java b/docs/src/main/java/org/springframework/cloud/internal/TemplateGenerator.java
similarity index 88%
rename from train-docs/src/main/java/org/springframework/cloud/internal/TemplateGenerator.java
rename to docs/src/main/java/org/springframework/cloud/internal/TemplateGenerator.java
index f59f028..0513568 100644
--- a/train-docs/src/main/java/org/springframework/cloud/internal/TemplateGenerator.java
+++ b/docs/src/main/java/org/springframework/cloud/internal/TemplateGenerator.java
@@ -44,7 +44,7 @@ class TemplateGenerator {
this.outputFolder.mkdirs();
}
- File generate(List projects, List configurationProperties) {
+ File generate(List projects) {
PathMatchingResourcePatternResolver resourceLoader = new PathMatchingResourcePatternResolver();
try {
Resource[] resources = resourceLoader.getResources("templates/spring-cloud/*.hbs");
@@ -55,8 +55,9 @@ class TemplateGenerator {
Template template = template(templateFile.getName().replace(".hbs", ""));
Map map = new HashMap<>();
map.put("projects", projects);
+ map.put("springBootVersion", projects.stream().filter(project -> project.name.equals("spring-boot"))
+ .findFirst().orElse(new Project("spring-boot", "")).getVersion());
map.put("springCloudProjects", templateProjects);
- map.put("properties", configurationProperties);
String applied = template.apply(map);
Files.write(outputFile.toPath(), applied.getBytes());
info("Successfully rendered [" + outputFile.getAbsolutePath() + "]");
@@ -77,12 +78,6 @@ class TemplateGenerator {
private String renameTemplate(File templateFile) {
String templateName = templateFile.getName();
- if (templateName.endsWith("-pdf.hbs")) {
- return templateName.replace("-pdf.hbs", ".pdfadoc");
- }
- else if (templateName.endsWith("-single.hbs")) {
- return templateName.replace("-single.hbs", ".htmlsingleadoc");
- }
return templateName.replace(".hbs", ".adoc");
}
diff --git a/train-docs/src/main/java/org/springframework/cloud/internal/TemplateProject.java b/docs/src/main/java/org/springframework/cloud/internal/TemplateProject.java
similarity index 69%
rename from train-docs/src/main/java/org/springframework/cloud/internal/TemplateProject.java
rename to docs/src/main/java/org/springframework/cloud/internal/TemplateProject.java
index 26112d5..03c3cac 100644
--- a/train-docs/src/main/java/org/springframework/cloud/internal/TemplateProject.java
+++ b/docs/src/main/java/org/springframework/cloud/internal/TemplateProject.java
@@ -24,12 +24,28 @@ class TemplateProject {
final String version;
+ final String antoraVersion;
+
final String include;
TemplateProject(String name, String version, String include) {
this.name = name;
this.version = version;
this.include = include;
+ this.antoraVersion = toAntora(version);
+ }
+
+ private String toAntora(String version) {
+ // 4.1.0-M1
+ // 4.1.0
+ // 4.1.0-SNAPSHOT
+ String[] split = version.split("\\.");
+ boolean snapshot = version.contains("SNAPSHOT");
+ String majorMinor = split[0] + "." + split[1]; // 4.1
+ if (snapshot) {
+ return majorMinor + "-SNAPSHOT";
+ }
+ return majorMinor;
}
@Override
@@ -42,12 +58,12 @@ class TemplateProject {
}
TemplateProject that = (TemplateProject) o;
return Objects.equals(name, that.name) && Objects.equals(version, that.version)
- && Objects.equals(include, that.include);
+ && Objects.equals(antoraVersion, that.antoraVersion) && Objects.equals(include, that.include);
}
@Override
public int hashCode() {
- return Objects.hash(name, version, include);
+ return Objects.hash(name, version, antoraVersion, include);
}
public String getName() {
@@ -62,4 +78,8 @@ class TemplateProject {
return include;
}
+ public String getAntoraVersion() {
+ return antoraVersion;
+ }
+
}
diff --git a/train-docs/src/main/java/org/springframework/cloud/internal/ZipCategory.java b/docs/src/main/java/org/springframework/cloud/internal/ZipCategory.java
similarity index 100%
rename from train-docs/src/main/java/org/springframework/cloud/internal/ZipCategory.java
rename to docs/src/main/java/org/springframework/cloud/internal/ZipCategory.java
diff --git a/docs/src/main/resources/templates/spring-cloud/_spring-cloud-links.hbs b/docs/src/main/resources/templates/spring-cloud/_spring-cloud-links.hbs
new file mode 100644
index 0000000..2756137
--- /dev/null
+++ b/docs/src/main/resources/templates/spring-cloud/_spring-cloud-links.hbs
@@ -0,0 +1,2 @@
+{{#each springCloudProjects}} https://docs.spring.io/{{name}}/reference/{{antoraVersion}}/[{{name}}] :: Reference Documentation, version {{version}}
+{{/each}}
diff --git a/train-docs/src/main/resources/templates/spring-cloud/spring-cloud-single.hbs b/docs/src/main/resources/templates/spring-cloud/index.hbs
similarity index 62%
rename from train-docs/src/main/resources/templates/spring-cloud/spring-cloud-single.hbs
rename to docs/src/main/resources/templates/spring-cloud/index.hbs
index 1844935..f351dbd 100644
--- a/train-docs/src/main/resources/templates/spring-cloud/spring-cloud-single.hbs
+++ b/docs/src/main/resources/templates/spring-cloud/index.hbs
@@ -1,11 +1,6 @@
-= Spring Cloud
+= Spring Cloud Train Reference Documentation
-include::_attributes.adoc[]
-include::_spring-cloud-attributes.adoc[]
-
-:basedir: {project-root}
-:project-full-name: Spring Cloud
-:project-name: spring-cloud
+:spring-boot-version: {{springBootVersion}}
Spring Cloud provides tools for developers to quickly build some of
the common patterns in distributed systems (e.g. configuration
@@ -34,24 +29,9 @@ and extensibility mechanism to cover others.
* Circuit Breakers
* Distributed messaging
-[[cloud-documentation-versions]]
-== Release Train Versions
+== Release Train Projects
-.Release Train Project Versions
-|===
-|Project Name| Project Version
+Below we present links to the reference documentation of all the projects that contribute to this reference train.
-include::_spring-cloud-versions.adoc[]
-|===
-
-{{=<% %>=}}
-<%#each springCloudProjects%>
-:project-root: {basedir}/<%name%>
-:project-version: {<%name%>-version}
-include::<%include%>
-<%/each%>
-<%={{ }}=%>
-
-= Appendix: Compendium of Configuration Properties
-
-include::configprops.adoc[leveloffset=+1]
+[horizontal]
+include::_spring-cloud-links.adoc[]
diff --git a/train-docs/src/main/resources/templates/spring-cloud/legal.hbs b/docs/src/main/resources/templates/spring-cloud/legal.hbs
similarity index 91%
rename from train-docs/src/main/resources/templates/spring-cloud/legal.hbs
rename to docs/src/main/resources/templates/spring-cloud/legal.hbs
index 048c5ad..ab7bdf4 100644
--- a/train-docs/src/main/resources/templates/spring-cloud/legal.hbs
+++ b/docs/src/main/resources/templates/spring-cloud/legal.hbs
@@ -3,7 +3,7 @@
{spring-cloud-version}
-Copyright © 2012-2020
+Copyright © 2012-2023
Copies of this document may be made for your own use and for distribution to
others, provided that you do not charge any fee for such copies and further
diff --git a/train-docs/src/test/java/org/springframework/cloud/internal/GenerateReleaseTrainDocsTests.java b/docs/src/test/java/org/springframework/cloud/internal/GenerateReleaseTrainDocsTests.java
similarity index 54%
rename from train-docs/src/test/java/org/springframework/cloud/internal/GenerateReleaseTrainDocsTests.java
rename to docs/src/test/java/org/springframework/cloud/internal/GenerateReleaseTrainDocsTests.java
index 82bce01..555e5d0 100644
--- a/train-docs/src/test/java/org/springframework/cloud/internal/GenerateReleaseTrainDocsTests.java
+++ b/docs/src/test/java/org/springframework/cloud/internal/GenerateReleaseTrainDocsTests.java
@@ -17,9 +17,7 @@
package org.springframework.cloud.internal;
import java.io.File;
-import java.io.IOException;
import java.net.URISyntaxException;
-import java.nio.file.Files;
import java.util.Arrays;
import java.util.List;
@@ -45,17 +43,6 @@ public class GenerateReleaseTrainDocsTests {
BDDAssertions.then(projects).contains(new Project("spring-cloud-foo-bus", "2.2.3.RELEASE"));
}
- @Test
- void should_unpack_starters_docs() throws URISyntaxException {
- File testPom = new File(GenerateReleaseTrainDocsTests.class.getResource("/test/commons-only.xml").toURI());
- File unzippedDocs = new File("target/test-unpacked-docs/");
- List projects = new GenerateReleaseTrainDocs().mavenPropertiesToDocsProjects(testPom);
-
- new GenerateReleaseTrainDocs().downloadSources(unzippedDocs, projects, "https://github.com/spring-cloud/");
-
- BDDAssertions.then(unzippedDocs).isNotEmptyDirectory();
- }
-
@Test
void should_generate_adocs_from_templates() {
File file = new File("target/test-train-docs");
@@ -63,33 +50,10 @@ public class GenerateReleaseTrainDocsTests {
List projects = Arrays.asList(new Project("spring-cloud-foo-foo", "1.0.0"),
new Project("spring-cloud-foo-bar", "2.0.0"), new Project("spring-boot", "3.0.0"),
new Project("spring-cloud", "4.0.0"));
- List configurationProperties = Arrays.asList(
- new ConfigurationProperty("first", "firstDefault", "firstDescription"),
- new ConfigurationProperty("second", "secondDefault", "secondDescription"));
- File outputFolder = new TemplateGenerator(file).generate(projects, configurationProperties);
+ File outputFolder = new TemplateGenerator(file).generate(projects);
BDDAssertions.then(outputFolder).isNotEmptyDirectory();
}
- @Test
- void should_generate_adocs_from_spring_cloud_commons_docs() throws URISyntaxException, IOException {
- File generatedAdocs = new File("target/test-train-commons-docs");
- FileSystemUtils.deleteRecursively(generatedAdocs);
- File testPom = new File(GenerateReleaseTrainDocsTests.class.getResource("/test/commons-only.xml").toURI());
- File starterPom = new File(GenerateReleaseTrainDocsTests.class.getResource("/test/starter-pom.xml").toURI());
- File unzippedDocs = new File("target/test-unpacked-commons-docs/");
-
- GenerateReleaseTrainDocs.main(testPom.getAbsolutePath(), starterPom.getAbsolutePath(),
- "https://github.com/spring-cloud/", unzippedDocs.getAbsolutePath(), generatedAdocs.getAbsolutePath());
-
- BDDAssertions.then(generatedAdocs).isNotEmptyDirectory();
- BDDAssertions.then(configProps(generatedAdocs)).contains(
- "|spring.cloud.compatibility-verifier.enabled | `false` | Enables creation of Spring Cloud compatibility verification.");
- }
-
- private String configProps(File file) throws IOException {
- return new String(Files.readAllBytes(new File(file, "configprops.adoc").toPath()));
- }
-
}
diff --git a/train-docs/src/test/java/org/springframework/cloud/internal/ZipCategoryTests.java b/docs/src/test/java/org/springframework/cloud/internal/ZipCategoryTests.java
similarity index 100%
rename from train-docs/src/test/java/org/springframework/cloud/internal/ZipCategoryTests.java
rename to docs/src/test/java/org/springframework/cloud/internal/ZipCategoryTests.java
diff --git a/train-docs/src/test/resources/file.zip b/docs/src/test/resources/file.zip
similarity index 100%
rename from train-docs/src/test/resources/file.zip
rename to docs/src/test/resources/file.zip
diff --git a/train-docs/src/test/resources/logback.xml b/docs/src/test/resources/logback.xml
similarity index 100%
rename from train-docs/src/test/resources/logback.xml
rename to docs/src/test/resources/logback.xml
diff --git a/train-docs/src/test/resources/test/commons-only.xml b/docs/src/test/resources/test/commons-only.xml
similarity index 100%
rename from train-docs/src/test/resources/test/commons-only.xml
rename to docs/src/test/resources/test/commons-only.xml
diff --git a/train-docs/src/test/resources/test/pom.xml b/docs/src/test/resources/test/pom.xml
similarity index 100%
rename from train-docs/src/test/resources/test/pom.xml
rename to docs/src/test/resources/test/pom.xml
diff --git a/train-docs/src/test/resources/test/starter-pom.xml b/docs/src/test/resources/test/starter-pom.xml
similarity index 100%
rename from train-docs/src/test/resources/test/starter-pom.xml
rename to docs/src/test/resources/test/starter-pom.xml
diff --git a/train-docs/src/test/resources/zip/zip-malicious-traversal.zip b/docs/src/test/resources/zip/zip-malicious-traversal.zip
similarity index 100%
rename from train-docs/src/test/resources/zip/zip-malicious-traversal.zip
rename to docs/src/test/resources/zip/zip-malicious-traversal.zip
diff --git a/mvnw b/mvnw
index 41c0f0c..5643201 100755
--- a/mvnw
+++ b/mvnw
@@ -36,6 +36,10 @@
if [ -z "$MAVEN_SKIP_RC" ] ; then
+ if [ -f /usr/local/etc/mavenrc ] ; then
+ . /usr/local/etc/mavenrc
+ fi
+
if [ -f /etc/mavenrc ] ; then
. /etc/mavenrc
fi
@@ -145,7 +149,7 @@ if [ -z "$JAVACMD" ] ; then
JAVACMD="$JAVA_HOME/bin/java"
fi
else
- JAVACMD="`which java`"
+ JAVACMD="`\\unset -f command; \\command -v java`"
fi
fi
@@ -212,9 +216,9 @@ else
echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
fi
if [ -n "$MVNW_REPOURL" ]; then
- jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
+ jarUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
else
- jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
+ jarUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
fi
while IFS="=" read key value; do
case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
@@ -233,9 +237,9 @@ else
echo "Found wget ... using wget"
fi
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
- wget "$jarUrl" -O "$wrapperJarPath"
+ wget "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath"
else
- wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath"
+ wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath"
fi
elif command -v curl > /dev/null; then
if [ "$MVNW_VERBOSE" = true ]; then
@@ -305,6 +309,8 @@ WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
exec "$JAVACMD" \
$MAVEN_OPTS \
+ $MAVEN_DEBUG_OPTS \
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
- "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
+ "-Dmaven.home=${M2_HOME}" \
+ "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
diff --git a/mvnw.cmd b/mvnw.cmd
index 8611571..23b7079 100644
--- a/mvnw.cmd
+++ b/mvnw.cmd
@@ -1,182 +1,188 @@
-@REM ----------------------------------------------------------------------------
-@REM Licensed to the Apache Software Foundation (ASF) under one
-@REM or more contributor license agreements. See the NOTICE file
-@REM distributed with this work for additional information
-@REM regarding copyright ownership. The ASF licenses this file
-@REM to you under the Apache License, Version 2.0 (the
-@REM "License"); you may not use this file except in compliance
-@REM with the License. You may obtain a copy of the License at
-@REM
-@REM http://www.apache.org/licenses/LICENSE-2.0
-@REM
-@REM Unless required by applicable law or agreed to in writing,
-@REM software distributed under the License is distributed on an
-@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-@REM KIND, either express or implied. See the License for the
-@REM specific language governing permissions and limitations
-@REM under the License.
-@REM ----------------------------------------------------------------------------
-
-@REM ----------------------------------------------------------------------------
-@REM Maven Start Up Batch script
-@REM
-@REM Required ENV vars:
-@REM JAVA_HOME - location of a JDK home dir
-@REM
-@REM Optional ENV vars
-@REM M2_HOME - location of maven2's installed home dir
-@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
-@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
-@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
-@REM e.g. to debug Maven itself, use
-@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
-@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
-@REM ----------------------------------------------------------------------------
-
-@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
-@echo off
-@REM set title of command window
-title %0
-@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
-@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
-
-@REM set %HOME% to equivalent of $HOME
-if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
-
-@REM Execute a user defined script before this one
-if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
-@REM check for pre script, once with legacy .bat ending and once with .cmd ending
-if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
-if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
-:skipRcPre
-
-@setlocal
-
-set ERROR_CODE=0
-
-@REM To isolate internal variables from possible post scripts, we use another setlocal
-@setlocal
-
-@REM ==== START VALIDATION ====
-if not "%JAVA_HOME%" == "" goto OkJHome
-
-echo.
-echo Error: JAVA_HOME not found in your environment. >&2
-echo Please set the JAVA_HOME variable in your environment to match the >&2
-echo location of your Java installation. >&2
-echo.
-goto error
-
-:OkJHome
-if exist "%JAVA_HOME%\bin\java.exe" goto init
-
-echo.
-echo Error: JAVA_HOME is set to an invalid directory. >&2
-echo JAVA_HOME = "%JAVA_HOME%" >&2
-echo Please set the JAVA_HOME variable in your environment to match the >&2
-echo location of your Java installation. >&2
-echo.
-goto error
-
-@REM ==== END VALIDATION ====
-
-:init
-
-@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
-@REM Fallback to current working directory if not found.
-
-set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
-IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
-
-set EXEC_DIR=%CD%
-set WDIR=%EXEC_DIR%
-:findBaseDir
-IF EXIST "%WDIR%"\.mvn goto baseDirFound
-cd ..
-IF "%WDIR%"=="%CD%" goto baseDirNotFound
-set WDIR=%CD%
-goto findBaseDir
-
-:baseDirFound
-set MAVEN_PROJECTBASEDIR=%WDIR%
-cd "%EXEC_DIR%"
-goto endDetectBaseDir
-
-:baseDirNotFound
-set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
-cd "%EXEC_DIR%"
-
-:endDetectBaseDir
-
-IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
-
-@setlocal EnableExtensions EnableDelayedExpansion
-for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
-@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
-
-:endReadAdditionalConfig
-
-SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
-set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
-set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
-
-set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
-
-FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
- IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
-)
-
-@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
-@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
-if exist %WRAPPER_JAR% (
- if "%MVNW_VERBOSE%" == "true" (
- echo Found %WRAPPER_JAR%
- )
-) else (
- if not "%MVNW_REPOURL%" == "" (
- SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
- )
- if "%MVNW_VERBOSE%" == "true" (
- echo Couldn't find %WRAPPER_JAR%, downloading it ...
- echo Downloading from: %DOWNLOAD_URL%
- )
-
- powershell -Command "&{"^
- "$webclient = new-object System.Net.WebClient;"^
- "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
- "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
- "}"^
- "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
- "}"
- if "%MVNW_VERBOSE%" == "true" (
- echo Finished downloading %WRAPPER_JAR%
- )
-)
-@REM End of extension
-
-@REM Provide a "standardized" way to retrieve the CLI args that will
-@REM work with both Windows and non-Windows executions.
-set MAVEN_CMD_LINE_ARGS=%*
-
-%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
-if ERRORLEVEL 1 goto error
-goto end
-
-:error
-set ERROR_CODE=1
-
-:end
-@endlocal & set ERROR_CODE=%ERROR_CODE%
-
-if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
-@REM check for post script, once with legacy .bat ending and once with .cmd ending
-if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
-if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
-:skipRcPost
-
-@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
-if "%MAVEN_BATCH_PAUSE%" == "on" pause
-
-if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
-
-exit /B %ERROR_CODE%
+@REM ----------------------------------------------------------------------------
+@REM Licensed to the Apache Software Foundation (ASF) under one
+@REM or more contributor license agreements. See the NOTICE file
+@REM distributed with this work for additional information
+@REM regarding copyright ownership. The ASF licenses this file
+@REM to you under the Apache License, Version 2.0 (the
+@REM "License"); you may not use this file except in compliance
+@REM with the License. You may obtain a copy of the License at
+@REM
+@REM http://www.apache.org/licenses/LICENSE-2.0
+@REM
+@REM Unless required by applicable law or agreed to in writing,
+@REM software distributed under the License is distributed on an
+@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+@REM KIND, either express or implied. See the License for the
+@REM specific language governing permissions and limitations
+@REM under the License.
+@REM ----------------------------------------------------------------------------
+
+@REM ----------------------------------------------------------------------------
+@REM Maven Start Up Batch script
+@REM
+@REM Required ENV vars:
+@REM JAVA_HOME - location of a JDK home dir
+@REM
+@REM Optional ENV vars
+@REM M2_HOME - location of maven2's installed home dir
+@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
+@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
+@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
+@REM e.g. to debug Maven itself, use
+@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
+@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
+@REM ----------------------------------------------------------------------------
+
+@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
+@echo off
+@REM set title of command window
+title %0
+@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
+@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
+
+@REM set %HOME% to equivalent of $HOME
+if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
+
+@REM Execute a user defined script before this one
+if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
+@REM check for pre script, once with legacy .bat ending and once with .cmd ending
+if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %*
+if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %*
+:skipRcPre
+
+@setlocal
+
+set ERROR_CODE=0
+
+@REM To isolate internal variables from possible post scripts, we use another setlocal
+@setlocal
+
+@REM ==== START VALIDATION ====
+if not "%JAVA_HOME%" == "" goto OkJHome
+
+echo.
+echo Error: JAVA_HOME not found in your environment. >&2
+echo Please set the JAVA_HOME variable in your environment to match the >&2
+echo location of your Java installation. >&2
+echo.
+goto error
+
+:OkJHome
+if exist "%JAVA_HOME%\bin\java.exe" goto init
+
+echo.
+echo Error: JAVA_HOME is set to an invalid directory. >&2
+echo JAVA_HOME = "%JAVA_HOME%" >&2
+echo Please set the JAVA_HOME variable in your environment to match the >&2
+echo location of your Java installation. >&2
+echo.
+goto error
+
+@REM ==== END VALIDATION ====
+
+:init
+
+@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
+@REM Fallback to current working directory if not found.
+
+set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
+IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
+
+set EXEC_DIR=%CD%
+set WDIR=%EXEC_DIR%
+:findBaseDir
+IF EXIST "%WDIR%"\.mvn goto baseDirFound
+cd ..
+IF "%WDIR%"=="%CD%" goto baseDirNotFound
+set WDIR=%CD%
+goto findBaseDir
+
+:baseDirFound
+set MAVEN_PROJECTBASEDIR=%WDIR%
+cd "%EXEC_DIR%"
+goto endDetectBaseDir
+
+:baseDirNotFound
+set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
+cd "%EXEC_DIR%"
+
+:endDetectBaseDir
+
+IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
+
+@setlocal EnableExtensions EnableDelayedExpansion
+for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
+@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
+
+:endReadAdditionalConfig
+
+SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
+set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
+set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
+
+set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
+
+FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
+ IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
+)
+
+@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
+@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
+if exist %WRAPPER_JAR% (
+ if "%MVNW_VERBOSE%" == "true" (
+ echo Found %WRAPPER_JAR%
+ )
+) else (
+ if not "%MVNW_REPOURL%" == "" (
+ SET DOWNLOAD_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
+ )
+ if "%MVNW_VERBOSE%" == "true" (
+ echo Couldn't find %WRAPPER_JAR%, downloading it ...
+ echo Downloading from: %DOWNLOAD_URL%
+ )
+
+ powershell -Command "&{"^
+ "$webclient = new-object System.Net.WebClient;"^
+ "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
+ "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
+ "}"^
+ "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
+ "}"
+ if "%MVNW_VERBOSE%" == "true" (
+ echo Finished downloading %WRAPPER_JAR%
+ )
+)
+@REM End of extension
+
+@REM Provide a "standardized" way to retrieve the CLI args that will
+@REM work with both Windows and non-Windows executions.
+set MAVEN_CMD_LINE_ARGS=%*
+
+%MAVEN_JAVA_EXE% ^
+ %JVM_CONFIG_MAVEN_PROPS% ^
+ %MAVEN_OPTS% ^
+ %MAVEN_DEBUG_OPTS% ^
+ -classpath %WRAPPER_JAR% ^
+ "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^
+ %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
+if ERRORLEVEL 1 goto error
+goto end
+
+:error
+set ERROR_CODE=1
+
+:end
+@endlocal & set ERROR_CODE=%ERROR_CODE%
+
+if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost
+@REM check for post script, once with legacy .bat ending and once with .cmd ending
+if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat"
+if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd"
+:skipRcPost
+
+@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
+if "%MAVEN_BATCH_PAUSE%"=="on" pause
+
+if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE%
+
+cmd /C exit /B %ERROR_CODE%
diff --git a/pom.xml b/pom.xml
index 1f25f7c..93aca3b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -108,13 +108,6 @@
spring-cloud-dependencies
spring-cloud-starter-parent
docs
- train-docs
-
-
-
- train-docs
-
- train-docs
diff --git a/spring-cloud-dependencies/pom.xml b/spring-cloud-dependencies/pom.xml
index aee4047..f5ed02a 100644
--- a/spring-cloud-dependencies/pom.xml
+++ b/spring-cloud-dependencies/pom.xml
@@ -41,7 +41,7 @@
spring-docs
- https://docs.spring.io/spring-cloud/docs/${pom.version}/reference/html/
+ https://docs.spring.io/spring-cloud-release/reference/
https://github.com/spring-cloud/spring-cloud-release
diff --git a/train-docs/pom.xml b/train-docs/pom.xml
deleted file mode 100644
index 23a6aa2..0000000
--- a/train-docs/pom.xml
+++ /dev/null
@@ -1,130 +0,0 @@
-
-
- 4.0.0
- spring-cloud-docs
-
- org.springframework.cloud
- spring-cloud-starter-build
- 2023.0.0-SNAPSHOT
-
- jar
- Spring Cloud Release Train Docs
- Spring Cloud Release Train Docs
-
- spring-cloud
- ${basedir}/..
- deploy
-
- 3.8.5
- 4.3.0
- 2.5.3
- 2.11.0
-
- none
- none
-
-
-
- org.springframework
- spring-core
-
-
- org.apache.maven
- maven-model
- ${maven.version}
-
-
- com.github.jknack
- handlebars
- ${handlebars.version}
-
-
- commons-io
- commons-io
- ${commons-io.version}
-
-
-
- org.springframework.boot
- spring-boot-starter-test
- test
-
-
-
-
- docs
-
-
-
- org.apache.maven.plugins
- maven-surefire-plugin
-
-
- ${maven.multiModuleProjectDirectory}/spring-cloud-dependencies/pom.xml
- ${maven.multiModuleProjectDirectory}/spring-cloud-starter-parent/pom.xml
- ${maven-deploy-plugin.deployZipUrl}
- ${project.build.directory}/unpacked-docs/
- ${project.build.directory}/train-docs/
-
-
-
-
- pl.project13.maven
- git-commit-id-plugin
-
-
- maven-dependency-plugin
-
-
- maven-resources-plugin
-
-
- org.codehaus.mojo
- exec-maven-plugin
-
-
- run-template-generation
- prepare-package
-
- java
-
-
- true
- org.springframework.cloud.internal.GenerateReleaseTrainDocs
-
- ${maven.multiModuleProjectDirectory}/spring-cloud-dependencies/pom.xml
- ${maven.multiModuleProjectDirectory}/spring-cloud-starter-parent/pom.xml
- https://github.com/spring-cloud/
- ${project.build.directory}/unpacked-docs/
- ${project.build.directory}/train-docs/
-
-
-
-
-
-
- org.asciidoctor
- asciidoctor-maven-plugin
-
- ${project.build.directory}/train-docs/
-
- ${project.build.directory}/unpacked-docs
- true
-
-
-
-
- maven-antrun-plugin
-
-
- maven-deploy-plugin
-
- deploy-file
-
-
-
-
-
-
-
diff --git a/train-docs/src/main/java/org/springframework/cloud/internal/ResourcesCopier.java b/train-docs/src/main/java/org/springframework/cloud/internal/ResourcesCopier.java
deleted file mode 100644
index e45681b..0000000
--- a/train-docs/src/main/java/org/springframework/cloud/internal/ResourcesCopier.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright 2013-2020 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
- *
- * 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.
- */
-
-package org.springframework.cloud.internal;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.List;
-
-import org.springframework.util.FileSystemUtils;
-
-final class ResourcesCopier {
-
- void copy(List baseDirs, File output) {
- File images = new File(output, "images");
- baseDirs.forEach(input -> {
- try {
- File inputImages = new File(input, "images");
- if (!inputImages.exists()) {
- return;
- }
- Logger.info("Will copy [" + inputImages + "] files to [" + images + "]");
- FileSystemUtils.copyRecursively(inputImages, images);
- }
- catch (IOException e) {
- throw new IllegalStateException(e);
- }
- });
- }
-
-}
diff --git a/train-docs/src/main/resources/templates/spring-cloud/_attributes.hbs b/train-docs/src/main/resources/templates/spring-cloud/_attributes.hbs
deleted file mode 100644
index d12fc70..0000000
--- a/train-docs/src/main/resources/templates/spring-cloud/_attributes.hbs
+++ /dev/null
@@ -1,17 +0,0 @@
-:doctype: book
-:idprefix:
-:idseparator: -
-:toc: left
-:toclevels: 4
-:tabsize: 4
-:numbered:
-:sectanchors:
-:sectnums:
-:icons: font
-:hide-uri-scheme:
-:docinfo: shared,private
-:train-docs: true
-
-:project-full-name: Spring Cloud
-:project-name: spring-cloud
-:spring-cloud-code: https://github.com/{project-name}
diff --git a/train-docs/src/main/resources/templates/spring-cloud/_spring-cloud-attributes.hbs b/train-docs/src/main/resources/templates/spring-cloud/_spring-cloud-attributes.hbs
deleted file mode 100644
index 787cf15..0000000
--- a/train-docs/src/main/resources/templates/spring-cloud/_spring-cloud-attributes.hbs
+++ /dev/null
@@ -1,2 +0,0 @@
-{{#each projects}}:{{name}}-version: {{version}}
-{{/each}}
diff --git a/train-docs/src/main/resources/templates/spring-cloud/_spring-cloud-links.hbs b/train-docs/src/main/resources/templates/spring-cloud/_spring-cloud-links.hbs
deleted file mode 100644
index 4be4b68..0000000
--- a/train-docs/src/main/resources/templates/spring-cloud/_spring-cloud-links.hbs
+++ /dev/null
@@ -1,2 +0,0 @@
-{{#each springCloudProjects}} https://docs.spring.io/{{name}}/docs/{{version}}/reference/html/[{{name}}] :: {{name}} Reference Documentation, version {{version}}
-{{/each}}
diff --git a/train-docs/src/main/resources/templates/spring-cloud/_spring-cloud-versions.hbs b/train-docs/src/main/resources/templates/spring-cloud/_spring-cloud-versions.hbs
deleted file mode 100644
index 6ae15ac..0000000
--- a/train-docs/src/main/resources/templates/spring-cloud/_spring-cloud-versions.hbs
+++ /dev/null
@@ -1,2 +0,0 @@
-{{#each projects}} |{{name}}|{{version}}
-{{/each}}
\ No newline at end of file
diff --git a/train-docs/src/main/resources/templates/spring-cloud/configprops.hbs b/train-docs/src/main/resources/templates/spring-cloud/configprops.hbs
deleted file mode 100644
index c292132..0000000
--- a/train-docs/src/main/resources/templates/spring-cloud/configprops.hbs
+++ /dev/null
@@ -1,7 +0,0 @@
-|===
-|Name | Default | Description
-
-{{#each properties}} |{{name}} | `{{defaultValue}}` | {{description}}
-{{/each}}
-
-|===
\ No newline at end of file
diff --git a/train-docs/src/main/resources/templates/spring-cloud/documentation-overview.hbs b/train-docs/src/main/resources/templates/spring-cloud/documentation-overview.hbs
deleted file mode 100644
index 73b5433..0000000
--- a/train-docs/src/main/resources/templates/spring-cloud/documentation-overview.hbs
+++ /dev/null
@@ -1,38 +0,0 @@
-[[documentation]]
-= Spring Cloud Documentation
-include::_attributes.adoc[]
-
-:docs-url: https://docs.spring.io/spring-cloud/docs/{spring-cloud-version}
-
-This section provides a brief overview of Spring Cloud reference documentation. It serves
-as a map for the rest of the document.
-
-
-
-[[documentation-about]]
-== About the Documentation
-
-The {project-full-name} reference guide is available as
-
-* {docs-url}/reference/html[Multi-page HTML]
-* {docs-url}/reference/htmlsingle[Single-page HTML]
-* {docs-url}/reference/pdf/{project-name}.pdf[PDF]
-
-Copies of this document may be made for your own use and for distribution to others,
-provided that you do not charge any fee for such copies and further provided that each
-copy contains this Copyright Notice, whether distributed in print or electronically.
-
-
-
-[[documentation-getting-help]]
-== Getting Help
-If you have trouble with {project-full-name}, we would like to help.
-
-* Learn the {project-full-name} basics. If you are
-starting out with {project-full-name}, try one of the https://spring.io/guides[guides].
-* Ask a question. We monitor https://stackoverflow.com[stackoverflow.com] for questions
-tagged with https://stackoverflow.com/tags/spring-cloud[`spring-cloud`].
-* Chat with us at https://gitter.im/spring-cloud/spring-cloud[{project-full-name} Gitter]
-
-NOTE: All of {project-full-name} is open source, including the documentation. If you find
-problems with the docs or if you want to improve them, please {spring-cloud-code}[get involved].
diff --git a/train-docs/src/main/resources/templates/spring-cloud/index-single.hbs b/train-docs/src/main/resources/templates/spring-cloud/index-single.hbs
deleted file mode 100644
index 4057ff5..0000000
--- a/train-docs/src/main/resources/templates/spring-cloud/index-single.hbs
+++ /dev/null
@@ -1 +0,0 @@
-include::spring-cloud.htmlsingleadoc[]
diff --git a/train-docs/src/main/resources/templates/spring-cloud/index.hbs b/train-docs/src/main/resources/templates/spring-cloud/index.hbs
deleted file mode 100644
index f642e5a..0000000
--- a/train-docs/src/main/resources/templates/spring-cloud/index.hbs
+++ /dev/null
@@ -1 +0,0 @@
-include::spring-cloud.adoc[]
diff --git a/train-docs/src/main/resources/templates/spring-cloud/spring-cloud-pdf.hbs b/train-docs/src/main/resources/templates/spring-cloud/spring-cloud-pdf.hbs
deleted file mode 100644
index 1844935..0000000
--- a/train-docs/src/main/resources/templates/spring-cloud/spring-cloud-pdf.hbs
+++ /dev/null
@@ -1,57 +0,0 @@
-= Spring Cloud
-
-include::_attributes.adoc[]
-include::_spring-cloud-attributes.adoc[]
-
-:basedir: {project-root}
-:project-full-name: Spring Cloud
-:project-name: spring-cloud
-
-Spring Cloud provides tools for developers to quickly build some of
-the common patterns in distributed systems (e.g. configuration
-management, service discovery, circuit breakers, intelligent routing,
-micro-proxy, control bus). Coordination of
-distributed systems leads to boiler plate patterns, and using Spring
-Cloud developers can quickly stand up services and applications that
-implement those patterns. They will work well in any distributed
-environment, including the developer's own laptop, bare metal data
-centres, and managed platforms such as Cloud Foundry.
-
-Release Train Version: *{spring-cloud-version}*
-
-Supported Boot Version: *{spring-boot-version}*
-
-== Features
-
-Spring Cloud focuses on providing good out of box experience for typical use cases
-and extensibility mechanism to cover others.
-
-* Distributed/versioned configuration
-* Service registration and discovery
-* Routing
-* Service-to-service calls
-* Load balancing
-* Circuit Breakers
-* Distributed messaging
-
-[[cloud-documentation-versions]]
-== Release Train Versions
-
-.Release Train Project Versions
-|===
-|Project Name| Project Version
-
-include::_spring-cloud-versions.adoc[]
-|===
-
-{{=<% %>=}}
-<%#each springCloudProjects%>
-:project-root: {basedir}/<%name%>
-:project-version: {<%name%>-version}
-include::<%include%>
-<%/each%>
-<%={{ }}=%>
-
-= Appendix: Compendium of Configuration Properties
-
-include::configprops.adoc[leveloffset=+1]
diff --git a/train-docs/src/test/java/org/springframework/cloud/internal/TestThatGeneratesTheFinalReleaseTrainDocumentationTests.java b/train-docs/src/test/java/org/springframework/cloud/internal/TestThatGeneratesTheFinalReleaseTrainDocumentationTests.java
deleted file mode 100644
index 5e1c4e7..0000000
--- a/train-docs/src/test/java/org/springframework/cloud/internal/TestThatGeneratesTheFinalReleaseTrainDocumentationTests.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright 2013-2020 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
- *
- * 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.
- */
-
-package org.springframework.cloud.internal;
-
-import java.io.File;
-
-import org.assertj.core.api.BDDAssertions;
-import org.junit.jupiter.api.Assumptions;
-import org.junit.jupiter.api.Disabled;
-import org.junit.jupiter.api.Test;
-
-import org.springframework.util.StringUtils;
-
-public class TestThatGeneratesTheFinalReleaseTrainDocumentationTests {
-
- /**
- * FOR SOME REASON I CAN'T RUN MAIN CLASS FROM MAVEN AS A WORKAOUND WE WILL RUN THIS
- * TEST TO GENERATE THE DOCS
- */
- @Test
- @Disabled
- void should_generate_adocs_with_values_from_system_property() {
- // System property needs to be passed
- Assumptions.assumeTrue(StringUtils.hasText(System.getProperty("bomPath")));
-
- String bomPath = System.getProperty("bomPath");
- String starterParentPath = System.getProperty("starterParentPath");
- String repoUrl = System.getProperty("repoUrl");
- String unzippedDocs = System.getProperty("unzippedDocs");
- String generatedTrainDocs = System.getProperty("generatedTrainDocs");
-
- GenerateReleaseTrainDocs.main(bomPath, starterParentPath, repoUrl, unzippedDocs, generatedTrainDocs);
-
- BDDAssertions.then(new File(generatedTrainDocs)).isNotEmptyDirectory();
- }
-
-}