diff --git a/README.adoc b/README.adoc
index 3b22304f..03c4d3ad 100644
--- a/README.adoc
+++ b/README.adoc
@@ -4,6 +4,7 @@ Manual changes to this file will be lost when it is generated again.
Edit the files in the src/main/asciidoc/ directory instead.
////
+
image:https://circleci.com/gh/spring-cloud/spring-cloud-build.svg?style=svg[link="https://travis-ci.org/spring-cloud/spring-cloud-build"]
Spring Cloud Build is a common utility project for Spring Cloud
@@ -254,38 +255,38 @@ approach of generating documentation just add these plugins to your `docs` modul
[source,xml]
----
-
- docs
-
-
-
- pl.project13.maven
- git-commit-id-plugin <1>
-
-
- org.apache.maven.plugins
- maven-dependency-plugin <2>
-
-
- org.apache.maven.plugins
- maven-resources-plugin <3>
-
-
- org.codehaus.mojo
- exec-maven-plugin <4>
-
-
- org.asciidoctor
- asciidoctor-maven-plugin <5>
-
-
- org.apache.maven.plugins
- maven-antrun-plugin <6>
-
-
-
-
-
+
+ docs
+
+
+
+ pl.project13.maven
+ git-commit-id-plugin <1>
+
+
+ org.apache.maven.plugins
+ maven-dependency-plugin <2>
+
+
+ org.apache.maven.plugins
+ maven-resources-plugin <3>
+
+
+ org.codehaus.mojo
+ exec-maven-plugin <4>
+
+
+ org.asciidoctor
+ asciidoctor-maven-plugin <5>
+
+
+ org.apache.maven.plugins
+ maven-antrun-plugin <6>
+
+
+
+
+
----
<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
@@ -305,42 +306,42 @@ Spring Cloud Build Docs comes with a set of attributes for asciidoctor that you
[source,xml]
----
- shared
- true
-
- left
- 4
- true
- ${project.basedir}/src@
- ${project.basedir}/src/main/asciidoc@
- ${project.basedir}/target/generated-resources@
-
-
-
- ${maven.multiModuleProjectDirectory}@
-
- ${docs.main}@
-
- https://raw.githubusercontent.com/spring-cloud/${docs.main}/${github-tag}@
-
- https://github.com/spring-cloud/${docs.main}/tree/${github-tag}@
-
- https://github.com/spring-cloud/${docs.main}/issues/@
- https://github.com/spring-cloud/${docs.main}/wiki@
- https://github.com/spring-cloud/${docs.main}/tree/master@
-
- ${index-link}@
+ shared
+ true
+
+ left
+ 4
+ true
+ ${project.basedir}/src@
+ ${project.basedir}/src/main/asciidoc@
+ ${project.basedir}/target/generated-resources@
+
+
+
+ ${maven.multiModuleProjectDirectory}@
+
+ ${docs.main}@
+
+ https://raw.githubusercontent.com/spring-cloud/${docs.main}/${github-tag}@
+
+ https://github.com/spring-cloud/${docs.main}/tree/${github-tag}@
+
+ https://github.com/spring-cloud/${docs.main}/issues/@
+ https://github.com/spring-cloud/${docs.main}/wiki@
+ https://github.com/spring-cloud/${docs.main}/tree/master@
+
+ ${index-link}@
-
-
- ${project.version}@
- ${project.version}@
- ${github-tag}@
- ${version-type}@
- https://docs.spring.io/${docs.main}/docs/${project.version}@
- ${github-raw}@
- ${project.version}@
- ${docs.main}@
+
+
+ ${project.version}@
+ ${project.version}@
+ ${github-tag}@
+ ${version-type}@
+ https://docs.spring.io/${docs.main}/docs/${project.version}@
+ ${github-raw}@
+ ${project.version}@
+ ${docs.main}@
----
@@ -373,4 +374,4 @@ what will happen is that for GA project versions, we will clone `gs-guide1`, `gs
You can skip this by either not adding the `guides` profile, or passing the `-DskipGuides` system property when the profile is turned on.
-You can configure the project version passed to guides via the `guides-project.version` (defaults to `${project.version}`). The phase at which guides get updated can be configured by `guides-update.phase` (defaults to `deploy`).
\ No newline at end of file
+You can configure the project version passed to guides via the `guides-project.version` (defaults to `${project.version}`). The phase at which guides get updated can be configured by `guides-update.phase` (defaults to `deploy`).
diff --git a/docs/pom.xml b/docs/pom.xml
index 1f46b9b0..76ba278b 100644
--- a/docs/pom.xml
+++ b/docs/pom.xml
@@ -14,16 +14,14 @@
spring-cloud-build
-
- 2.1.x,2.2.x
${basedir}/..
- 1.8.1
- 2.5.10
-
- ${groovy.version}
none
+ none
${project.basedir}/src/main/
+ deploy
+
+ maven.compile.classpath
@@ -39,63 +37,15 @@
compile
- org.codehaus.groovy
- groovy-all
- ${groovy.version}
- pom
-
-
- org.codehaus.groovy
- groovy
- ${groovy.version}
+ com.fasterxml.jackson.core
+ jackson-databind
compile
+
- org.codehaus.groovy
- groovy-xml
- ${groovy.version}
- compile
-
-
- org.codehaus.groovy
- groovy-datetime
- ${groovy.version}
- compile
-
-
- org.codehaus.groovy
- groovy-nio
- ${groovy.version}
- compile
-
-
- org.codehaus.groovy
- groovy-json
- ${groovy.version}
- compile
-
-
- org.codehaus.groovy
- groovy-jsr223
- ${groovy.version}
- compile
-
-
- org.codehaus.groovy
- groovy-macro
- ${groovy.version}
- compile
-
-
- org.codehaus.groovy
- groovy-sql
- ${groovy.version}
- compile
-
-
- org.codehaus.groovy
- groovy-swing
- ${groovy.version}
+ org.asciidoctor
+ asciidoctorj
+ ${asciidoctorj.version}
compile
@@ -109,42 +59,26 @@
src/main
- groovy/**/*.*
+ java/**/*.*
- org.codehaus.mojo
- build-helper-maven-plugin
- ${build-helper-maven-plugin.version}
+ org.apache.maven.plugins
+ maven-assembly-plugin
+ 3.3.0
+
+
+ jar-with-dependencies
+
+
- add-source
- generate-sources
+ make-assembly
+ package
- add-source
-
-
-
- src/main/groovy
-
-
-
-
-
-
- org.codehaus.gmavenplus
- gmavenplus-plugin
- ${gmavenplus-plugin.version}
-
-
-
- compile
- addSources
- generateStubs
- generateTestStubs
- groovydoc-jar
+ single
@@ -184,35 +118,12 @@
org.apache.maven.plugins
maven-antrun-plugin
-
-
-
-
- unix
-
-
- unix
- Linux
-
-
-
-
- exec-maven-plugin
- org.codehaus.mojo
-
-
- Run tests
- test
-
- exec
-
-
- ${skipTests}
- ${basedir}/src/test/bash/run-bats.sh
-
-
-
+ maven-deploy-plugin
+
+ deploy
+ deploy-file
+
diff --git a/docs/src/main/groovy/org/springframework/cloud/internal/Main.groovy b/docs/src/main/groovy/org/springframework/cloud/internal/Main.groovy
deleted file mode 100644
index 7b07ffb4..00000000
--- a/docs/src/main/groovy/org/springframework/cloud/internal/Main.groovy
+++ /dev/null
@@ -1,112 +0,0 @@
-package org.springframework.cloud.internal
-
-import java.util.regex.Pattern
-
-import groovy.json.JsonSlurper
-import groovy.transform.CompileStatic
-
-import org.springframework.core.io.Resource
-import org.springframework.core.io.support.PathMatchingResourcePatternResolver
-
-/**
- * @author Marcin Grzejszczak
- */
-class Main {
-
- @CompileStatic
- static void main(String... args) {
- String outputFile = args[0]
- String inclusionPattern = args.length > 1 ? args[1] : ".*"
- File parent = new File(outputFile).parentFile
- if (!parent.exists()) {
- println "No parent directory [${parent.toString()}] found. Won't generate the configuration properties file"
- return
- }
- new Generator().generate(outputFile, inclusionPattern)
- }
-
- static class Generator {
- void generate(String outputFile, String inclusionPattern) {
- println "Parsing all configuration metadata"
- Resource[] resources = getResources()
- println "Found [${resources.length}] configuration metadata jsons"
- TreeSet names = new TreeSet()
- def descriptions = [:]
- int count = 0
- int matchingPropertyCount = 0
- int propertyCount = 0
- Pattern pattern = Pattern.compile(inclusionPattern)
- resources.each { Resource resource ->
- if (resourceNameContainsPattern(resource)) {
- count++
- def slurper = new JsonSlurper()
- slurper.parseText(resource.inputStream.text).properties.each { val ->
- propertyCount++
- if (!pattern.matcher(val.name).matches()) {
- return
- }
- matchingPropertyCount++
- names.add val.name
- descriptions[val.name] = new ConfigValue(val.name, val.description, val.defaultValue)
- }
- }
- }
- println "Found [${count}] Cloud projects configuration metadata jsons. [${matchingPropertyCount}/${propertyCount}] were matching the pattern [${inclusionPattern}]"
- println "Successfully built the description table"
- if (names.empty) {
- println("Will not update the table, since no configuration properties were found!")
- return
- }
- new File(outputFile).text = """\
-|===
-|Name | Default | Description
-
-${names.collect { it -> return descriptions[it] }.join("\n")}
-
-|===
-"""
- println "Successfully stored the output file"
- }
-
- protected boolean resourceNameContainsPattern(Resource resource) {
- try {
- return resource.getURL().toString().contains("cloud")
- }
- catch (Exception e) {
- println("Exception [${e}] for resource [${resource}] occurred while trying to retrieve its URL")
- return false
- }
- }
-
- protected Resource[] getResources() {
- return new PathMatchingResourcePatternResolver()
- .getResources("classpath*:/META-INF/spring-configuration-metadata.json")
- }
-
- }
-
-
- @CompileStatic
- static class ConfigValue {
- String name
- String description
- Object defaultValue
-
- ConfigValue() {}
-
- ConfigValue(String name, String description, Object defaultValue) {
- this.name = name
- this.description = escapedValue(description)
- this.defaultValue = escapedValue(defaultValue)
- }
-
- private String escapedValue(Object value) {
- return value != null ?
- value.toString().replaceAll('\\|', '\\\\|') : ''
- }
-
- String toString() {
- "|${name} | ${defaultValue} | ${description}"
- }
- }
-}
diff --git a/docs/src/main/java/org/springframework/cloud/internal/Main.java b/docs/src/main/java/org/springframework/cloud/internal/Main.java
new file mode 100644
index 00000000..39389391
--- /dev/null
+++ b/docs/src/main/java/org/springframework/cloud/internal/Main.java
@@ -0,0 +1,151 @@
+/*
+ * Copyright 2012-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.nio.file.Files;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeSet;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+import org.springframework.core.io.Resource;
+import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
+import org.springframework.util.StreamUtils;
+
+/**
+ * @author Marcin Grzejszczak
+ */
+public class Main {
+
+ public static void main(String... args) {
+ String outputFile = args[0];
+ String inclusionPattern = args.length > 1 ? args[1] : ".*";
+ File parent = new File(outputFile).getParentFile();
+ if (!parent.exists()) {
+ System.out.println("No parent directory [" + parent.toString()
+ + "] found. Will not generate the configuration properties file");
+ return;
+ }
+ new Generator().generate(outputFile, inclusionPattern);
+ }
+
+ static class Generator {
+
+ void generate(String outputFile, String inclusionPattern) {
+ try {
+ System.out.println("Parsing all configuration metadata");
+ Resource[] resources = getResources();
+ System.out.println("Found [" + resources.length + "] configuration metadata jsons");
+ TreeSet names = new TreeSet<>();
+ Map descriptions = new HashMap<>();
+ final AtomicInteger count = new AtomicInteger();
+ final AtomicInteger matchingPropertyCount = new AtomicInteger();
+ final AtomicInteger propertyCount = new AtomicInteger();
+ Pattern pattern = Pattern.compile(inclusionPattern);
+ for (Resource resource : resources) {
+ if (resourceNameContainsPattern(resource)) {
+ count.incrementAndGet();
+ byte[] bytes = StreamUtils.copyToByteArray(resource.getInputStream());
+ Map response = new ObjectMapper().readValue(bytes, HashMap.class);
+ List
bintray
@@ -785,6 +796,9 @@
+
+ https://repo.spring.io/libs-release-local
+
guides
@@ -962,6 +976,30 @@
+
+ unpack-classes
+ ${maven-dependency-plugin-for-docs-classes.phase}
+
+ unpack
+
+
+
+
+ org.springframework.cloud
+
+ spring-cloud-build-docs
+
+ ${spring-cloud-build.version}
+
+ jar-with-dependencies
+ jar
+ true
+ ${docs.classes.dir}
+
+
+
+
+
unpack-docs-resources
generate-resources
@@ -1107,8 +1145,8 @@
${project.version}@
${github-tag}@
${version-type}@
- ${docs-url}@
- ${raw-docs-url}@
+ https://docs.spring.io/${docs.main}/docs/${project.version}@
+ ${github-raw}@
${project.version}@
${docs.main}@
@@ -1135,13 +1173,14 @@
highlight.js
book
- js/highlight
- atom-one-dark-reasonable
- true
- ./images
- font
+ shared
css/
spring.css
+ true
+ font
+ js/highlight
+ github
+ ./images
warn
@@ -1169,13 +1208,14 @@
highlight.js
book
- js/highlight
- atom-one-dark-reasonable
- true
- ./images
- font
+ shared
css/
spring.css
+ true
+ font
+ js/highlight
+ github
+ ./images
@@ -1244,16 +1284,20 @@
readme
- process-resources
+ prepare-package
run
-
-
-
+
+
+
+
+
+
+
@@ -1329,68 +1373,11 @@
input="${git.branch}" regexp="origin/(.*)"
replace="\1"/>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- org.codehaus.mojo
- build-helper-maven-plugin
- ${build-helper-maven-plugin.version}
- false
-
-
- attach-zip
-
- attach-artifact
-
-
-
-
-
- ${project.build.directory}/${project.artifactId}-${project.version}.zip
-
- zip
-
-
-
-
-
-
org.jfrog.buildinfo
artifactory-maven-plugin
@@ -1417,6 +1404,29 @@
+
+ maven-deploy-plugin
+ ${maven-deploy-plugin.version}
+
+
+ upload-docs-zip
+ ${upload-docs-zip.phase}
+
+ deploy-file
+
+
+ false
+ ${project.groupId}
+ ${project.artifactId}
+ ${project.version}
+ ${maven-deploy-plugin.deployZipRepositoryId}
+ ${maven-deploy-plugin.deployZipUrl}
+ ${project.build.directory}/${project.artifactId}-${project.version}.zip
+ zip;zip.type=docs;zip.deployed=false;
+
+
+
+