├── .editorconfig
├── .github
├── CONTRIBUTING.md
├── ISSUE_TEMPLATE.md
├── ISSUE_TEMPLATE
│ ├── bug_report.md
│ └── feature_request.md
├── dco.yml
├── dependabot.yml
└── workflows
│ ├── deploy-docs.yml
│ └── maven.yml
├── .gitignore
├── .gitmodules
├── .mvn
├── jvm.config
├── maven.config
└── wrapper
│ ├── MavenWrapperDownloader.java
│ ├── maven-wrapper.jar
│ └── maven-wrapper.properties
├── .sdkmanrc
├── .settings.xml
├── .springformat
├── LICENSE.txt
├── README.adoc
├── config
└── releaser.yml
├── docs
├── antora-playbook.yml
├── antora.yml
├── modules
│ └── ROOT
│ │ ├── assets
│ │ └── images
│ │ │ ├── intellij-checkstyle.png
│ │ │ ├── intellij-code-style.png
│ │ │ └── intellij-inspections.png
│ │ ├── nav.adoc
│ │ ├── pages
│ │ ├── building.adoc
│ │ ├── contributing.adoc
│ │ └── index.adoc
│ │ └── partials
│ │ ├── building.adoc
│ │ ├── code-of-conduct.adoc
│ │ ├── contributing-docs.adoc
│ │ └── contributing.adoc
├── package.json
├── pom.xml
└── src
│ ├── main
│ ├── .gitignore
│ ├── antora
│ │ └── resources
│ │ │ └── antora-resources
│ │ │ └── antora.yml
│ ├── asciidoc
│ │ └── README.adoc
│ └── java
│ │ └── org
│ │ └── springframework
│ │ └── cloud
│ │ └── internal
│ │ ├── Main.java
│ │ └── asciidoctor
│ │ ├── CoalescerPreprocessor.java
│ │ └── ReadmeMain.java
│ └── test
│ ├── java
│ └── org
│ │ └── springframework
│ │ └── cloud
│ │ └── internal
│ │ ├── GeneratorTests.java
│ │ ├── MainTests.java
│ │ └── asciidoctor
│ │ └── ReadmeMainTests.java
│ └── resources
│ ├── README.adoc
│ ├── included.adoc
│ ├── not-matching-name.json
│ ├── test.adoc
│ └── with-cloud-in-name.json
├── mvnw
├── mvnw.cmd
├── pom.xml
├── scripts
├── build.sh
└── sync_mvnw.sh
├── spring-cloud-build-dependencies
└── pom.xml
├── spring-cloud-build-tools
├── pom.xml
└── src
│ ├── checkstyle
│ ├── checkstyle-suppressions.xml
│ └── nohttp-checkstyle.xml
│ └── main
│ └── resources
│ ├── LICENSE.txt
│ ├── checkstyle-header.txt
│ ├── checkstyle.xml
│ └── intellij
│ ├── Intellij_Project_Defaults.xml
│ └── Intellij_Spring_Boot_Java_Conventions.xml
└── spring-cloud-dependencies-parent
├── Guardfile
├── README.adoc
├── eclipse-code-formatter.xml
└── pom.xml
/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*.java]
4 | indent_style = tab
5 | indent_size = 4
6 | continuation_indent_size = 8
7 |
8 | [*.groovy]
9 | indent_style = tab
10 | indent_size = 4
11 | continuation_indent_size = 8
12 |
13 | [*.xml]
14 | indent_style = tab
15 | indent_size = 4
16 | continuation_indent_size = 8
17 |
18 | [*.yml]
19 | indent_style = space
20 | indent_size = 2
21 |
22 | [*.yaml]
23 | indent_style = space
24 | indent_size = 2
25 |
26 | [*.sh]
27 | indent_style = space
28 | indent_size = 4
--------------------------------------------------------------------------------
/.github/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 |
2 | # Contributing
3 |
4 | Spring Cloud is released under the non-restrictive Apache 2.0 license,
5 | and follows a very standard Github development process, using Github
6 | tracker for issues and merging pull requests into master. If you want
7 | to contribute even something trivial please do not hesitate, but
8 | follow the guidelines below.
9 |
10 | ## Sign the Contributor License Agreement
11 | Before we accept a non-trivial patch or pull request we will need you to sign the
12 | [Contributor License Agreement](https://cla.pivotal.io/sign/spring).
13 | Signing the contributor's agreement does not grant anyone commit rights to the main
14 | repository, but it does mean that we can accept your contributions, and you will get an
15 | author credit if we do. Active contributors might be asked to join the core team, and
16 | given the ability to merge pull requests.
17 |
18 | ## Code of Conduct
19 | This project adheres to the Contributor Covenant [code of
20 | conduct](https://github.com/spring-cloud/spring-cloud-build/blob/main/docs/modules/ROOT/partials/code-of-conduct.adoc). By participating, you are expected to uphold this code. Please report
21 | unacceptable behavior to spring-code-of-conduct@pivotal.io.
22 |
23 | ## Code Conventions and Housekeeping
24 | None of these is essential for a pull request, but they will all help. They can also be
25 | added after the original pull request but before a merge.
26 |
27 | * Use the Spring Framework code format conventions. If you use Eclipse
28 | you can import formatter settings using the
29 | `eclipse-code-formatter.xml` file from the
30 | [Spring Cloud Build](https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-dependencies-parent/eclipse-code-formatter.xml) project. If using IntelliJ, you can use the
31 | [Eclipse Code Formatter Plugin](https://plugins.jetbrains.com/plugin/6546) to import the same file.
32 | * Make sure all new `.java` files to have a simple Javadoc class comment with at least an
33 | `@author` tag identifying you, and preferably at least a paragraph on what the class is
34 | for.
35 | * Add the ASF license header comment to all new `.java` files (copy from existing files
36 | in the project)
37 | * Add yourself as an `@author` to the .java files that you modify substantially (more
38 | than cosmetic changes).
39 | * Add some Javadocs and, if you change the namespace, some XSD doc elements.
40 | * A few unit tests would help a lot as well -- someone has to do it.
41 | * If no-one else is using your branch, please rebase it against the current master (or
42 | other target branch in the main project).
43 | * When writing a commit message please follow [these conventions](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html),
44 | if you are fixing an existing issue please add `Fixes gh-XXXX` at the end of the commit
45 | message (where XXXX is the issue number).
46 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE.md:
--------------------------------------------------------------------------------
1 |
21 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Describe the bug**
11 | Please provide details of the problem, including the version of Spring Cloud that you
12 | are using.
13 |
14 | **Sample**
15 | If possible, please provide a test case or sample application that reproduces
16 | the problem. This makes it much easier for us to diagnose the problem and to verify that
17 | we have fixed it.
18 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Is your feature request related to a problem? Please describe.**
11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12 |
13 | **Describe the solution you'd like**
14 | A clear and concise description of what you want to happen.
15 |
16 | **Describe alternatives you've considered**
17 | A clear and concise description of any alternative solutions or features you've considered.
18 |
19 | **Additional context**
20 | Add any other context or screenshots about the feature request here.
21 |
--------------------------------------------------------------------------------
/.github/dco.yml:
--------------------------------------------------------------------------------
1 | require:
2 | members: false
3 |
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | # To get started with Dependabot version updates, you'll need to specify which
2 | # package ecosystems to update and where the package manifests are located.
3 | # Please see the documentation for all configuration options:
4 | # https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5 |
6 | version: 2
7 |
8 | updates:
9 | - package-ecosystem: "github-actions"
10 | directory: "/"
11 | target-branch: "main"
12 | schedule:
13 | interval: "weekly"
14 | - package-ecosystem: "github-actions"
15 | directory: "/"
16 | target-branch: "4.2.x"
17 | schedule:
18 | interval: "weekly"
19 | - package-ecosystem: "github-actions"
20 | directory: "/"
21 | target-branch: "4.1.x"
22 | schedule:
23 | interval: "weekly"
24 | - package-ecosystem: maven
25 | directory: /
26 | schedule:
27 | interval: daily
28 | target-branch: main
29 | ignore:
30 | # IDE specific dependency
31 | - dependency-name: "org.eclipse.m2e:lifecycle-mapping"
32 | # JRuby updates are causing docs generation to fail
33 | - dependency-name: "org.jruby:jruby-complete"
34 | # only upgrade by minor or patch
35 | - dependency-name: "*"
36 | update-types:
37 | - version-update:semver-major
38 | - package-ecosystem: maven
39 | directory: /
40 | schedule:
41 | interval: daily
42 | target-branch: 4.1.x
43 | ignore:
44 | # IDE specific dependency
45 | - dependency-name: "org.eclipse.m2e:lifecycle-mapping"
46 | # JRuby updates are causing docs generation to fail
47 | - dependency-name: "org.jruby:jruby-complete"
48 | - dependency-name: "*"
49 | update-types:
50 | - version-update:semver-major
51 | - version-update:semver-minor
52 | - package-ecosystem: maven
53 | directory: /
54 | schedule:
55 | interval: daily
56 | target-branch: 4.2.x
57 | ignore:
58 | # IDE specific dependency
59 | - dependency-name: "org.eclipse.m2e:lifecycle-mapping"
60 | # JRuby updates are causing docs generation to fail
61 | - dependency-name: "org.jruby:jruby-complete"
62 | # only upgrade by minor or patch
63 | - dependency-name: "*"
64 | update-types:
65 | - version-update:semver-major
66 | - version-update:semver-minor
67 | - package-ecosystem: npm
68 | target-branch: docs-build
69 | directory: /
70 | schedule:
71 | interval: weekly
72 | - package-ecosystem: npm
73 | target-branch: main
74 | directory: /docs
75 | schedule:
76 | interval: weekly
77 | - package-ecosystem: npm
78 | target-branch: 4.2.x
79 | directory: /docs
80 | schedule:
81 | interval: weekly
82 | - package-ecosystem: npm
83 | target-branch: 4.1.x
84 | directory: /docs
85 | schedule:
86 | interval: weekly
87 |
--------------------------------------------------------------------------------
/.github/workflows/deploy-docs.yml:
--------------------------------------------------------------------------------
1 | name: Deploy Docs
2 | on:
3 | push:
4 | branches-ignore: [ gh-pages ]
5 | tags: '**'
6 | repository_dispatch:
7 | types: request-build-reference # legacy
8 | #schedule:
9 | #- cron: '0 10 * * *' # Once per day at 10am UTC
10 | workflow_dispatch:
11 | permissions:
12 | actions: write
13 | jobs:
14 | build:
15 | runs-on: ubuntu-latest
16 | # FIXME: enable when pushed to spring-projects
17 | # if: github.repository_owner == 'spring-projects'
18 | steps:
19 | - name: Checkout
20 | uses: actions/checkout@v4
21 | with:
22 | ref: docs-build
23 | fetch-depth: 1
24 | - name: Dispatch (partial build)
25 | if: github.ref_type == 'branch'
26 | env:
27 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28 | run: gh workflow run deploy-docs.yml -r $(git rev-parse --abbrev-ref HEAD) -f build-refname=${{ github.ref_name }}
29 | - name: Dispatch (full build)
30 | if: github.ref_type == 'tag'
31 | env:
32 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33 | run: gh workflow run deploy-docs.yml -r $(git rev-parse --abbrev-ref HEAD)
34 |
--------------------------------------------------------------------------------
/.github/workflows/maven.yml:
--------------------------------------------------------------------------------
1 | # This workflow will build a Java project with Maven
2 | # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
3 |
4 | name: Build
5 |
6 | on:
7 | push:
8 | branches: [ main, 4.2.x, 4.1.x, 3.1.x ]
9 | pull_request:
10 | branches: [ main, 4.2.x, 4.1.x, 3.1.x ]
11 |
12 | jobs:
13 | build:
14 |
15 | runs-on: ubuntu-latest
16 |
17 | steps:
18 | - uses: actions/checkout@v4
19 | - name: Set up JDK
20 | uses: actions/setup-java@v4
21 | with:
22 | java-version: 17
23 | distribution: 'temurin'
24 | - name: Cache local Maven repository
25 | uses: actions/cache@v4
26 | with:
27 | path: ~/.m2/repository
28 | key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
29 | restore-keys: |
30 | ${{ runner.os }}-maven-
31 | - name: Build with Maven
32 | run: ./mvnw clean install -Pdocs -B -U -Pspring
33 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *~
2 | #*
3 | *#
4 | .#*
5 | .classpath
6 | .project
7 | .settings
8 | .springBeans
9 | .gradle
10 | build
11 | bin
12 | target/
13 | asciidoctor.css
14 | _site/
15 | *.swp
16 | .idea
17 | *.iml
18 | .factorypath
19 | .vscode/
20 | .flattened-pom.xml
21 | .DS_Store
22 | node_modules
23 | node
24 | _configprops.adoc
25 | _spans.adoc
26 | _metrics.adoc
27 | _conventions.adoc
28 | /package.json
29 | package-lock.json
30 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "docs/src/test/bats/test_helper/bats-assert"]
2 | path = docs/src/test/bats/test_helper/bats-assert
3 | url = https://github.com/ztombol/bats-assert
4 | [submodule "docs/src/test/bats/test_helper/bats-support"]
5 | path = docs/src/test/bats/test_helper/bats-support
6 | url = https://github.com/ztombol/bats-support
7 |
--------------------------------------------------------------------------------
/.mvn/jvm.config:
--------------------------------------------------------------------------------
1 | -Xmx1024m -XX:CICompilerCount=1 -XX:TieredStopAtLevel=1 -Djava.security.egd=file:/dev/./urandom
--------------------------------------------------------------------------------
/.mvn/maven.config:
--------------------------------------------------------------------------------
1 | -P spring
2 |
--------------------------------------------------------------------------------
/.mvn/wrapper/MavenWrapperDownloader.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2007-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | import java.net.*;
17 | import java.io.*;
18 | import java.nio.channels.*;
19 | import java.util.Properties;
20 |
21 | public class MavenWrapperDownloader {
22 |
23 | private static final String WRAPPER_VERSION = "0.5.6";
24 | /**
25 | * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
26 | */
27 | private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
28 | + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
29 |
30 | /**
31 | * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
32 | * use instead of the default one.
33 | */
34 | private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
35 | ".mvn/wrapper/maven-wrapper.properties";
36 |
37 | /**
38 | * Path where the maven-wrapper.jar will be saved to.
39 | */
40 | private static final String MAVEN_WRAPPER_JAR_PATH =
41 | ".mvn/wrapper/maven-wrapper.jar";
42 |
43 | /**
44 | * Name of the property which should be used to override the default download url for the wrapper.
45 | */
46 | private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
47 |
48 | public static void main(String args[]) {
49 | System.out.println("- Downloader started");
50 | File baseDirectory = new File(args[0]);
51 | System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
52 |
53 | // If the maven-wrapper.properties exists, read it and check if it contains a custom
54 | // wrapperUrl parameter.
55 | File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
56 | String url = DEFAULT_DOWNLOAD_URL;
57 | if(mavenWrapperPropertyFile.exists()) {
58 | FileInputStream mavenWrapperPropertyFileInputStream = null;
59 | try {
60 | mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
61 | Properties mavenWrapperProperties = new Properties();
62 | mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
63 | url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
64 | } catch (IOException e) {
65 | System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
66 | } finally {
67 | try {
68 | if(mavenWrapperPropertyFileInputStream != null) {
69 | mavenWrapperPropertyFileInputStream.close();
70 | }
71 | } catch (IOException e) {
72 | // Ignore ...
73 | }
74 | }
75 | }
76 | System.out.println("- Downloading from: " + url);
77 |
78 | File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
79 | if(!outputFile.getParentFile().exists()) {
80 | if(!outputFile.getParentFile().mkdirs()) {
81 | System.out.println(
82 | "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
83 | }
84 | }
85 | System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
86 | try {
87 | downloadFileFromURL(url, outputFile);
88 | System.out.println("Done");
89 | System.exit(0);
90 | } catch (Throwable e) {
91 | System.out.println("- Error downloading");
92 | e.printStackTrace();
93 | System.exit(1);
94 | }
95 | }
96 |
97 | private static void downloadFileFromURL(String urlString, File destination) throws Exception {
98 | if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
99 | String username = System.getenv("MVNW_USERNAME");
100 | char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
101 | Authenticator.setDefault(new Authenticator() {
102 | @Override
103 | protected PasswordAuthentication getPasswordAuthentication() {
104 | return new PasswordAuthentication(username, password);
105 | }
106 | });
107 | }
108 | URL website = new URL(urlString);
109 | ReadableByteChannel rbc;
110 | rbc = Channels.newChannel(website.openStream());
111 | FileOutputStream fos = new FileOutputStream(destination);
112 | fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
113 | fos.close();
114 | rbc.close();
115 | }
116 |
117 | }
118 |
--------------------------------------------------------------------------------
/.mvn/wrapper/maven-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/55dafd26dca67bfe7505213e4077fcacf63dd584/.mvn/wrapper/maven-wrapper.jar
--------------------------------------------------------------------------------
/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.4/apache-maven-3.8.4-bin.zip
2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
3 |
--------------------------------------------------------------------------------
/.sdkmanrc:
--------------------------------------------------------------------------------
1 | # Enable auto-env through the sdkman_auto_env config
2 | # Add key=value pairs of SDKs to use below
3 | java=17.0.1-tem
4 |
--------------------------------------------------------------------------------
/.settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
20 |
21 | repo.spring.io
22 | ${env.CI_DEPLOY_USERNAME}
23 | ${env.CI_DEPLOY_PASSWORD}
24 |
25 |
26 |
27 |
28 |
34 | spring
35 |
36 | true
37 |
38 |
39 |
40 | spring-snapshots
41 | Spring Snapshots
42 | https://repo.spring.io/snapshot
43 |
44 | true
45 |
46 |
47 |
48 | spring-milestones
49 | Spring Milestones
50 | https://repo.spring.io/milestone
51 |
52 | false
53 |
54 |
55 |
56 |
57 |
58 | spring-snapshots
59 | Spring Snapshots
60 | https://repo.spring.io/snapshot
61 |
62 | true
63 |
64 |
65 |
66 | spring-milestones
67 | Spring Milestones
68 | https://repo.spring.io/milestone
69 |
70 | false
71 |
72 |
73 |
74 |
75 |
76 |
79 | ide
80 |
81 | true
82 |
83 |
84 |
85 |
86 |
--------------------------------------------------------------------------------
/.springformat:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/55dafd26dca67bfe7505213e4077fcacf63dd584/.springformat
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 |
2 | Apache License
3 | Version 2.0, January 2004
4 | https://www.apache.org/licenses/
5 |
6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7 |
8 | 1. Definitions.
9 |
10 | "License" shall mean the terms and conditions for use, reproduction,
11 | and distribution as defined by Sections 1 through 9 of this document.
12 |
13 | "Licensor" shall mean the copyright owner or entity authorized by
14 | the copyright owner that is granting the License.
15 |
16 | "Legal Entity" shall mean the union of the acting entity and all
17 | other entities that control, are controlled by, or are under common
18 | control with that entity. For the purposes of this definition,
19 | "control" means (i) the power, direct or indirect, to cause the
20 | direction or management of such entity, whether by contract or
21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
22 | outstanding shares, or (iii) beneficial ownership of such entity.
23 |
24 | "You" (or "Your") shall mean an individual or Legal Entity
25 | exercising permissions granted by this License.
26 |
27 | "Source" form shall mean the preferred form for making modifications,
28 | including but not limited to software source code, documentation
29 | source, and configuration files.
30 |
31 | "Object" form shall mean any form resulting from mechanical
32 | transformation or translation of a Source form, including but
33 | not limited to compiled object code, generated documentation,
34 | and conversions to other media types.
35 |
36 | "Work" shall mean the work of authorship, whether in Source or
37 | Object form, made available under the License, as indicated by a
38 | copyright notice that is included in or attached to the work
39 | (an example is provided in the Appendix below).
40 |
41 | "Derivative Works" shall mean any work, whether in Source or Object
42 | form, that is based on (or derived from) the Work and for which the
43 | editorial revisions, annotations, elaborations, or other modifications
44 | represent, as a whole, an original work of authorship. For the purposes
45 | of this License, Derivative Works shall not include works that remain
46 | separable from, or merely link (or bind by name) to the interfaces of,
47 | the Work and Derivative Works thereof.
48 |
49 | "Contribution" shall mean any work of authorship, including
50 | the original version of the Work and any modifications or additions
51 | to that Work or Derivative Works thereof, that is intentionally
52 | submitted to Licensor for inclusion in the Work by the copyright owner
53 | or by an individual or Legal Entity authorized to submit on behalf of
54 | the copyright owner. For the purposes of this definition, "submitted"
55 | means any form of electronic, verbal, or written communication sent
56 | to the Licensor or its representatives, including but not limited to
57 | communication on electronic mailing lists, source code control systems,
58 | and issue tracking systems that are managed by, or on behalf of, the
59 | Licensor for the purpose of discussing and improving the Work, but
60 | excluding communication that is conspicuously marked or otherwise
61 | designated in writing by the copyright owner as "Not a Contribution."
62 |
63 | "Contributor" shall mean Licensor and any individual or Legal Entity
64 | on behalf of whom a Contribution has been received by Licensor and
65 | subsequently incorporated within the Work.
66 |
67 | 2. Grant of Copyright License. Subject to the terms and conditions of
68 | this License, each Contributor hereby grants to You a perpetual,
69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70 | copyright license to reproduce, prepare Derivative Works of,
71 | publicly display, publicly perform, sublicense, and distribute the
72 | Work and such Derivative Works in Source or Object form.
73 |
74 | 3. Grant of Patent License. Subject to the terms and conditions of
75 | this License, each Contributor hereby grants to You a perpetual,
76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77 | (except as stated in this section) patent license to make, have made,
78 | use, offer to sell, sell, import, and otherwise transfer the Work,
79 | where such license applies only to those patent claims licensable
80 | by such Contributor that are necessarily infringed by their
81 | Contribution(s) alone or by combination of their Contribution(s)
82 | with the Work to which such Contribution(s) was submitted. If You
83 | institute patent litigation against any entity (including a
84 | cross-claim or counterclaim in a lawsuit) alleging that the Work
85 | or a Contribution incorporated within the Work constitutes direct
86 | or contributory patent infringement, then any patent licenses
87 | granted to You under this License for that Work shall terminate
88 | as of the date such litigation is filed.
89 |
90 | 4. Redistribution. You may reproduce and distribute copies of the
91 | Work or Derivative Works thereof in any medium, with or without
92 | modifications, and in Source or Object form, provided that You
93 | meet the following conditions:
94 |
95 | (a) You must give any other recipients of the Work or
96 | Derivative Works a copy of this License; and
97 |
98 | (b) You must cause any modified files to carry prominent notices
99 | stating that You changed the files; and
100 |
101 | (c) You must retain, in the Source form of any Derivative Works
102 | that You distribute, all copyright, patent, trademark, and
103 | attribution notices from the Source form of the Work,
104 | excluding those notices that do not pertain to any part of
105 | the Derivative Works; and
106 |
107 | (d) If the Work includes a "NOTICE" text file as part of its
108 | distribution, then any Derivative Works that You distribute must
109 | include a readable copy of the attribution notices contained
110 | within such NOTICE file, excluding those notices that do not
111 | pertain to any part of the Derivative Works, in at least one
112 | of the following places: within a NOTICE text file distributed
113 | as part of the Derivative Works; within the Source form or
114 | documentation, if provided along with the Derivative Works; or,
115 | within a display generated by the Derivative Works, if and
116 | wherever such third-party notices normally appear. The contents
117 | of the NOTICE file are for informational purposes only and
118 | do not modify the License. You may add Your own attribution
119 | notices within Derivative Works that You distribute, alongside
120 | or as an addendum to the NOTICE text from the Work, provided
121 | that such additional attribution notices cannot be construed
122 | as modifying the License.
123 |
124 | You may add Your own copyright statement to Your modifications and
125 | may provide additional or different license terms and conditions
126 | for use, reproduction, or distribution of Your modifications, or
127 | for any such Derivative Works as a whole, provided Your use,
128 | reproduction, and distribution of the Work otherwise complies with
129 | the conditions stated in this License.
130 |
131 | 5. Submission of Contributions. Unless You explicitly state otherwise,
132 | any Contribution intentionally submitted for inclusion in the Work
133 | by You to the Licensor shall be under the terms and conditions of
134 | this License, without any additional terms or conditions.
135 | Notwithstanding the above, nothing herein shall supersede or modify
136 | the terms of any separate license agreement you may have executed
137 | with Licensor regarding such Contributions.
138 |
139 | 6. Trademarks. This License does not grant permission to use the trade
140 | names, trademarks, service marks, or product names of the Licensor,
141 | except as required for reasonable and customary use in describing the
142 | origin of the Work and reproducing the content of the NOTICE file.
143 |
144 | 7. Disclaimer of Warranty. Unless required by applicable law or
145 | agreed to in writing, Licensor provides the Work (and each
146 | Contributor provides its Contributions) on an "AS IS" BASIS,
147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148 | implied, including, without limitation, any warranties or conditions
149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150 | PARTICULAR PURPOSE. You are solely responsible for determining the
151 | appropriateness of using or redistributing the Work and assume any
152 | risks associated with Your exercise of permissions under this License.
153 |
154 | 8. Limitation of Liability. In no event and under no legal theory,
155 | whether in tort (including negligence), contract, or otherwise,
156 | unless required by applicable law (such as deliberate and grossly
157 | negligent acts) or agreed to in writing, shall any Contributor be
158 | liable to You for damages, including any direct, indirect, special,
159 | incidental, or consequential damages of any character arising as a
160 | result of this License or out of the use or inability to use the
161 | Work (including but not limited to damages for loss of goodwill,
162 | work stoppage, computer failure or malfunction, or any and all
163 | other commercial damages or losses), even if such Contributor
164 | has been advised of the possibility of such damages.
165 |
166 | 9. Accepting Warranty or Additional Liability. While redistributing
167 | the Work or Derivative Works thereof, You may choose to offer,
168 | and charge a fee for, acceptance of support, warranty, indemnity,
169 | or other liability obligations and/or rights consistent with this
170 | License. However, in accepting such obligations, You may act only
171 | on Your own behalf and on Your sole responsibility, not on behalf
172 | of any other Contributor, and only if You agree to indemnify,
173 | defend, and hold each Contributor harmless for any liability
174 | incurred by, or claims asserted against, such Contributor by reason
175 | of your accepting any such warranty or additional liability.
176 |
177 | END OF TERMS AND CONDITIONS
178 |
179 | APPENDIX: How to apply the Apache License to your work.
180 |
181 | To apply the Apache License to your work, attach the following
182 | boilerplate notice, with the fields enclosed by brackets "[]"
183 | replaced with your own identifying information. (Don't include
184 | the brackets!) The text should be enclosed in the appropriate
185 | comment syntax for the file format. We also recommend that a
186 | file or class name and description of purpose be included on the
187 | same "printed page" as the copyright notice for easier
188 | identification within third-party archives.
189 |
190 | Copyright [yyyy] [name of copyright owner]
191 |
192 | Licensed under the Apache License, Version 2.0 (the "License");
193 | you may not use this file except in compliance with the License.
194 | You may obtain a copy of the License at
195 |
196 | https://www.apache.org/licenses/LICENSE-2.0
197 |
198 | Unless required by applicable law or agreed to in writing, software
199 | distributed under the License is distributed on an "AS IS" BASIS,
200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201 | See the License for the specific language governing permissions and
202 | limitations under the License.
203 |
--------------------------------------------------------------------------------
/README.adoc:
--------------------------------------------------------------------------------
1 | ////
2 | DO NOT EDIT THIS FILE. IT WAS GENERATED.
3 | Manual changes to this file will be lost when it is generated again.
4 | Edit the files in the src/main/asciidoc/ directory instead.
5 | ////
6 |
7 |
8 | image::https://github.com/spring-cloud/spring-cloud-build/workflows/Build/badge.svg?branch=main&style=svg["Build",link="https://github.com/spring-cloud/spring-cloud-build/actions"]
9 |
10 | Spring Cloud Build is a common utility project for Spring Cloud
11 | to use for plugin and dependency management.
12 |
13 | [[building-and-deploying]]
14 | = Building and Deploying
15 |
16 | To install locally:
17 |
18 | ----
19 |
20 | $ mvn install -s .settings.xml
21 | ----
22 |
23 | and to deploy snapshots to repo.spring.io:
24 |
25 | ----
26 | $ mvn deploy -DaltSnapshotDeploymentRepository=repo.spring.io::default::https://repo.spring.io/snapshot
27 | ----
28 |
29 | and for Maven Central use
30 |
31 | ----
32 | $ mvn deploy -P central -DaltReleaseDeploymentRepository=sonatype-nexus-staging::default::https://oss.sonatype.org/service/local/staging/deploy/maven2
33 | ----
34 |
35 | (the "central" profile is available for all projects in Spring Cloud and it sets up the gpg jar signing, and the repository has to be specified separately for this project because it is a parent of the starter parent which users in turn have as their own parent).
36 |
37 | [[contributing]]
38 | = Contributing
39 |
40 | :spring-cloud-build-branch: main
41 |
42 | Spring Cloud is released under the non-restrictive Apache 2.0 license,
43 | and follows a very standard Github development process, using Github
44 | tracker for issues and merging pull requests into main. If you want
45 | to contribute even something trivial please do not hesitate, but
46 | follow the guidelines below.
47 |
48 | [[developer-certificate-of-origin]]
49 | == Developer Certificate of Origin (DCO)
50 |
51 | All commits must include a __Signed-off-by__ trailer at the end of each commit message to indicate that the contributor agrees to the Developer Certificate of Origin.
52 | For additional details, please refer to the blog post https://spring.io/blog/2025/01/06/hello-dco-goodbye-cla-simplifying-contributions-to-spring[Hello DCO, Goodbye CLA: Simplifying Contributions to Spring].
53 |
54 | [[code-of-conduct]]
55 | == Code of Conduct
56 | This project adheres to the Contributor Covenant https://github.com/spring-cloud/spring-cloud-build/blob/main/docs/modules/ROOT/partials/code-of-conduct.adoc[code of
57 | conduct]. By participating, you are expected to uphold this code. Please report
58 | unacceptable behavior to code-of-conduct@spring.io.
59 |
60 | [[code-conventions-and-housekeeping]]
61 | == Code Conventions and Housekeeping
62 | None of these is essential for a pull request, but they will all help. They can also be
63 | added after the original pull request but before a merge.
64 |
65 | * Use the Spring Framework code format conventions. If you use Eclipse
66 | you can import formatter settings using the
67 | `eclipse-code-formatter.xml` file from the
68 | https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/main/spring-cloud-dependencies-parent/eclipse-code-formatter.xml[Spring
69 | Cloud Build] project. If using IntelliJ, you can use the
70 | https://plugins.jetbrains.com/plugin/6546[Eclipse Code Formatter
71 | Plugin] to import the same file.
72 | * Make sure all new `.java` files to have a simple Javadoc class comment with at least an
73 | `@author` tag identifying you, and preferably at least a paragraph on what the class is
74 | for.
75 | * Add the ASF license header comment to all new `.java` files (copy from existing files
76 | in the project)
77 | * Add yourself as an `@author` to the .java files that you modify substantially (more
78 | than cosmetic changes).
79 | * Add some Javadocs and, if you change the namespace, some XSD doc elements.
80 | * A few unit tests would help a lot as well -- someone has to do it.
81 | * If no-one else is using your branch, please rebase it against the current main (or
82 | other target branch in the main project).
83 | * When writing a commit message please follow https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html[these conventions],
84 | if you are fixing an existing issue please add `Fixes gh-XXXX` at the end of the commit
85 | message (where XXXX is the issue number).
86 |
87 | [[checkstyle]]
88 | == Checkstyle
89 |
90 | 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:
91 |
92 | .spring-cloud-build-tools/
93 | ----
94 | └── src
95 | ├── checkstyle
96 | │ └── checkstyle-suppressions.xml <3>
97 | └── main
98 | └── resources
99 | ├── checkstyle-header.txt <2>
100 | └── checkstyle.xml <1>
101 | ----
102 | <1> Default Checkstyle rules
103 | <2> File header setup
104 | <3> Default suppression rules
105 |
106 | [[checkstyle-configuration]]
107 | === Checkstyle configuration
108 |
109 | Checkstyle rules are *disabled by default*. To add checkstyle to your project just define the following properties and plugins.
110 |
111 | .pom.xml
112 | ----
113 |
114 | true <1>
115 | true
116 | <2>
117 | true
118 | <3>
119 |
120 |
121 |
122 |
123 | <4>
124 | io.spring.javaformat
125 | spring-javaformat-maven-plugin
126 |
127 | <5>
128 | org.apache.maven.plugins
129 | maven-checkstyle-plugin
130 |
131 |
132 |
133 |
134 |
135 | <5>
136 | org.apache.maven.plugins
137 | maven-checkstyle-plugin
138 |
139 |
140 |
141 |
142 | ----
143 | <1> Fails the build upon Checkstyle errors
144 | <2> Fails the build upon Checkstyle violations
145 | <3> Checkstyle analyzes also the test sources
146 | <4> Add the Spring Java Format plugin that will reformat your code to pass most of the Checkstyle formatting rules
147 | <5> Add checkstyle plugin to your build and reporting phases
148 |
149 | 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:
150 |
151 | .projectRoot/src/checkstyle/checkstyle-suppresions.xml
152 | ----
153 |
154 |
157 |
158 |
159 |
160 |
161 | ----
162 |
163 | 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:
164 |
165 | ```bash
166 | $ curl https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/main/.editorconfig -o .editorconfig
167 | $ touch .springformat
168 | ```
169 |
170 | [[ide-setup]]
171 | == IDE setup
172 |
173 | [[intellij-idea]]
174 | === Intellij IDEA
175 |
176 | In order to setup Intellij you should import our coding conventions, inspection profiles and set up the checkstyle plugin.
177 | The following files can be found in the https://github.com/spring-cloud/spring-cloud-build/tree/main/spring-cloud-build-tools[Spring Cloud Build] project.
178 |
179 | .spring-cloud-build-tools/
180 | ----
181 | └── src
182 | ├── checkstyle
183 | │ └── checkstyle-suppressions.xml <3>
184 | └── main
185 | └── resources
186 | ├── checkstyle-header.txt <2>
187 | ├── checkstyle.xml <1>
188 | └── intellij
189 | ├── Intellij_Project_Defaults.xml <4>
190 | └── Intellij_Spring_Boot_Java_Conventions.xml <5>
191 | ----
192 | <1> Default Checkstyle rules
193 | <2> File header setup
194 | <3> Default suppression rules
195 | <4> Project defaults for Intellij that apply most of Checkstyle rules
196 | <5> Project style conventions for Intellij that apply most of Checkstyle rules
197 |
198 | .Code style
199 |
200 | image::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/main/docs/modules/ROOT/assets/images/intellij-code-style.png[Code style]
201 |
202 | 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.
203 |
204 | .Inspection profiles
205 |
206 | image::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/main/docs/modules/ROOT/assets/images/intellij-inspections.png[Code style]
207 |
208 | 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.
209 |
210 | .Checkstyle
211 |
212 | 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
213 |
214 | image::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/main/docs/modules/ROOT/assets/images/intellij-checkstyle.png[Checkstyle]
215 |
216 | 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/main/spring-cloud-build-tools/src/main/resources/checkstyle.xml`). We need to provide the following variables:
217 |
218 | - `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/main/spring-cloud-build-tools/src/main/resources/checkstyle-header.txt` URL.
219 | - `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/main/spring-cloud-build-tools/src/checkstyle/checkstyle-suppressions.xml` URL.
220 | - `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`.
221 |
222 | IMPORTANT: Remember to set the `Scan Scope` to `All sources` since we apply checkstyle rules for production and test sources.
223 |
224 | [[duplicate-finder]]
225 | == Duplicate Finder
226 |
227 | Spring Cloud Build brings along the `basepom:duplicate-finder-maven-plugin`, that enables flagging duplicate and conflicting classes and resources on the java classpath.
228 |
229 | [[duplicate-finder-configuration]]
230 | === Duplicate Finder configuration
231 |
232 | 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 project's `pom.xml`.
233 |
234 | .pom.xml
235 | [source,xml]
236 | ----
237 |
238 |
239 |
240 | org.basepom.maven
241 | duplicate-finder-maven-plugin
242 |
243 |
244 |
245 | ----
246 |
247 | For other properties, we have set defaults as listed in the https://github.com/basepom/duplicate-finder-maven-plugin/wiki[plugin documentation].
248 |
249 | 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.
250 |
251 | If you need to add `ignoredClassPatterns` or `ignoredResourcePatterns` to your setup, make sure to add them in the plugin configuration section of your project:
252 |
253 | [source,xml]
254 | ----
255 |
256 |
257 |
258 | org.basepom.maven
259 | duplicate-finder-maven-plugin
260 |
261 |
262 | org.joda.time.base.BaseDateTime
263 | .*module-info
264 |
265 |
266 | changelog.txt
267 |
268 |
269 |
270 |
271 |
272 |
273 |
274 | ----
275 |
276 |
277 | [[flattening-the-poms]]
278 | = Flattening the POMs
279 |
280 | To avoid propagating build setup that is required to build a Spring Cloud project, we're using the maven flatten plugin. It has the advantage of letting you use whatever features you need while publishing "clean" pom to the repository.
281 |
282 | In order to add it, add the `org.codehaus.mojo:flatten-maven-plugin` to your `pom.xml`.
283 |
284 | [source,xml]
285 | ----
286 |
287 |
288 |
289 | org.codehaus.mojo
290 | flatten-maven-plugin
291 |
292 |
293 |
294 | ----
295 |
296 | [[reusing-the-documentation]]
297 | = Reusing the documentation
298 |
299 | Spring Cloud Build publishes its `spring-cloud-build-docs` module that contains
300 | helpful scripts (e.g. README generation ruby script) and css, xslt and images
301 | for the Spring Cloud documentation. If you want to follow the same convention
302 | approach of generating documentation just add these plugins to your `docs` module
303 |
304 | [source,xml]
305 | ----
306 |
307 |
308 | docs
309 |
310 |
311 |
312 | src/main/antora/resources/antora-resources
313 | true
314 |
315 |
316 |
317 |
318 | pl.project13.maven
319 | git-commit-id-plugin
320 |
321 |
322 | org.apache.maven.plugins
323 | maven-dependency-plugin
324 |
325 |
326 | org.codehaus.mojo
327 | exec-maven-plugin
328 |
329 |
330 | io.spring.maven.antora
331 | antora-component-version-maven-plugin
332 |
333 |
334 | org.antora
335 | antora-maven-plugin
336 |
337 |
338 | org.apache.maven.plugins
339 | maven-antrun-plugin
340 |
341 |
342 | maven-deploy-plugin
343 |
344 |
345 |
346 |
347 | ----
348 |
349 | IMPORTANT: The order of plugin declaration is important!
350 |
351 | In order for the build to generate the `adoc` file with all your configuration properties, your `docs` module should contain all the dependencies on the classpath, that you would want to scan for configuration properties.
352 |
353 | If you want to modify which of the configuration properties are put in the table, you can tweak the `configprops.inclusionPattern` pattern to include only a subset of the properties (e.g. `spring.sleuth.*`).
354 |
355 | Spring Cloud Build Docs comes with a set of attributes for asciidoctor that you can reuse.
356 |
357 | [source,yml]
358 | ----
359 | version: @antora-component.version@
360 | prerelease: @antora-component.prerelease@
361 |
362 | asciidoc:
363 | attributes:
364 | attribute-missing: 'warn'
365 | chomp: 'all'
366 | project-root: @maven.multiModuleProjectDirectory@
367 | github-repo: @docs.main@
368 | github-raw: https://raw.githubusercontent.com/spring-cloud/@docs.main@/@github-tag@
369 | github-code: https://github.com/spring-cloud/@docs.main@/tree/@github-tag@
370 | github-issues: https://github.com/spring-cloud/@docs.main@/issues/
371 | github-wiki: https://github.com/spring-cloud/@docs.main@/wiki
372 | spring-cloud-version: @project.version@
373 | github-tag: @github-tag@
374 | version-type: @version-type@
375 | docs-url: https://docs.spring.io/@docs.main@/docs/@project.version@
376 | raw-docs-url: https://raw.githubusercontent.com/spring-cloud/@docs.main@/@github-tag@
377 | project-version: @project.version@
378 | project-name: @docs.main@
379 | ----
380 |
381 | [[updating-the-guides]]
382 | = Updating the guides
383 |
384 | We assume that your project contains guides under the `guides` folder.
385 |
386 | ```
387 | .
388 | └── guides
389 | ├── gs-guide1
390 | ├── gs-guide2
391 | └── gs-guide3
392 | ```
393 |
394 | This means that the project contains 3 guides that would
395 | correspond to the following guides in Spring Guides org.
396 |
397 | - https://github.com/spring-guides/gs-guide1
398 | - https://github.com/spring-guides/gs-guide2
399 | - https://github.com/spring-guides/gs-guide3
400 |
401 | If you deploy your project with the `-Pguides` profile like this
402 |
403 | ```
404 | $ ./mvnw clean deploy -Pguides
405 | ```
406 |
407 | what will happen is that for GA project versions, we will clone `gs-guide1`, `gs-guide2` and `gs-guide3` and update their contents with the ones being under your `guides` project.
408 |
409 | You can skip this by either not adding the `guides` profile, or passing the `-DskipGuides` system property when the profile is turned on.
410 |
411 | 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`).
412 |
--------------------------------------------------------------------------------
/config/releaser.yml:
--------------------------------------------------------------------------------
1 | releaser:
2 | maven:
3 | buildCommand: ./scripts/build.sh {{systemProps}}
4 | # deployCommand: echo "skip deploy"
5 |
--------------------------------------------------------------------------------
/docs/antora-playbook.yml:
--------------------------------------------------------------------------------
1 | antora:
2 | extensions:
3 | - require: '@springio/antora-extensions'
4 | root_component_name: 'cloud-build'
5 | site:
6 | title: Spring Cloud Build
7 | url: https://docs.spring.io/spring-cloud-build/reference/
8 | content:
9 | sources:
10 | - url: ./..
11 | branches: HEAD
12 | start_path: docs
13 | worktrees: true
14 | asciidoc:
15 | attributes:
16 | page-stackoverflow-url: https://stackoverflow.com/tags/spring-cloud
17 | page-pagination: ''
18 | hide-uri-scheme: '@'
19 | tabs-sync-option: '@'
20 | chomp: 'all'
21 | extensions:
22 | - '@asciidoctor/tabs'
23 | - '@springio/asciidoctor-extensions'
24 | sourcemap: true
25 | urls:
26 | latest_version_segment: ''
27 | runtime:
28 | log:
29 | failure_level: warn
30 | format: pretty
31 | ui:
32 | bundle:
33 | url: https://github.com/spring-io/antora-ui-spring/releases/download/v0.4.15/ui-bundle.zip
34 |
--------------------------------------------------------------------------------
/docs/antora.yml:
--------------------------------------------------------------------------------
1 | name: cloud-build
2 | version: true
3 | title: Spring Cloud Build
4 | nav:
5 | - modules/ROOT/nav.adoc
6 | ext:
7 | collector:
8 | run:
9 | 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
10 | local: true
11 | scan:
12 | dir: ./target/classes/antora-resources/
13 |
--------------------------------------------------------------------------------
/docs/modules/ROOT/assets/images/intellij-checkstyle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/55dafd26dca67bfe7505213e4077fcacf63dd584/docs/modules/ROOT/assets/images/intellij-checkstyle.png
--------------------------------------------------------------------------------
/docs/modules/ROOT/assets/images/intellij-code-style.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/55dafd26dca67bfe7505213e4077fcacf63dd584/docs/modules/ROOT/assets/images/intellij-code-style.png
--------------------------------------------------------------------------------
/docs/modules/ROOT/assets/images/intellij-inspections.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/55dafd26dca67bfe7505213e4077fcacf63dd584/docs/modules/ROOT/assets/images/intellij-inspections.png
--------------------------------------------------------------------------------
/docs/modules/ROOT/nav.adoc:
--------------------------------------------------------------------------------
1 | * xref:index.adoc[]
2 | * xref:building.adoc[]
3 | * xref:contributing.adoc[]
4 |
--------------------------------------------------------------------------------
/docs/modules/ROOT/pages/building.adoc:
--------------------------------------------------------------------------------
1 | [[building]]
2 | = Building
3 |
4 | include::partial$building.adoc[]
--------------------------------------------------------------------------------
/docs/modules/ROOT/pages/contributing.adoc:
--------------------------------------------------------------------------------
1 | [[contributing]]
2 | = Contributing
3 |
4 | include::partial$contributing.adoc[]
--------------------------------------------------------------------------------
/docs/modules/ROOT/pages/index.adoc:
--------------------------------------------------------------------------------
1 | [[overview]]
2 | = Overview
3 |
4 | Spring Cloud Build is a common utility project for Spring Cloud to use for plugin and dependency management.
--------------------------------------------------------------------------------
/docs/modules/ROOT/partials/building.adoc:
--------------------------------------------------------------------------------
1 | :jdkversion: 17
2 |
3 | [[basic-compile-and-test]]
4 | == Basic Compile and Test
5 |
6 | To build the source you will need to install JDK {jdkversion}.
7 |
8 | Spring Cloud uses Maven for most build-related activities, and you
9 | should be able to get off the ground quite quickly by cloning the
10 | project you are interested in and typing
11 |
12 | ----
13 | $ ./mvnw install
14 | ----
15 |
16 | NOTE: You can also install Maven (>=3.3.3) yourself and run the `mvn` command
17 | in place of `./mvnw` in the examples below. If you do that you also
18 | might need to add `-P spring` if your local Maven settings do not
19 | contain repository declarations for spring pre-release artifacts.
20 |
21 | NOTE: Be aware that you might need to increase the amount of memory
22 | available to Maven by setting a `MAVEN_OPTS` environment variable with
23 | a value like `-Xmx512m -XX:MaxPermSize=128m`. We try to cover this in
24 | the `.mvn` configuration, so if you find you have to do it to make a
25 | build succeed, please raise a ticket to get the settings added to
26 | source control.
27 |
28 | The projects that require middleware (i.e. Redis) for testing generally
29 | require that a local instance of [Docker](https://www.docker.com/get-started) is installed and running.
30 |
31 | [[documentation]]
32 | == Documentation
33 |
34 | The spring-cloud-build module has a "docs" profile, and if you switch
35 | that on it will try to build asciidoc sources using https://docs.antora.org/antora/latest/[Antora] from
36 | `modules/ROOT/`.
37 |
38 | As part of that process it will look for a
39 | `docs/src/main/asciidoc/README.adoc` and process it by loading all the includes, but not
40 | parsing or rendering it, just copying it to `${main.basedir}`
41 | (defaults to `$\{basedir}`, i.e. the root of the project). If there are
42 | any changes in the README it will then show up after a Maven build as
43 | a modified file in the correct place. Just commit it and push the change.
44 |
45 | [[working-with-the-code]]
46 | == Working with the code
47 | If you don't have an IDE preference we would recommend that you use
48 | https://www.springsource.com/developer/sts[Spring Tools Suite] or
49 | https://eclipse.org[Eclipse] when working with the code. We use the
50 | https://eclipse.org/m2e/[m2eclipse] eclipse plugin for maven support. Other IDEs and tools
51 | should also work without issue as long as they use Maven 3.3.3 or better.
52 |
53 | [[activate-the-spring-maven-profile]]
54 | === Activate the Spring Maven profile
55 | Spring Cloud projects require the 'spring' Maven profile to be activated to resolve
56 | the spring milestone and snapshot repositories. Use your preferred IDE to set this
57 | profile to be active, or you may experience build errors.
58 |
59 | [[importing-into-eclipse-with-m2eclipse]]
60 | === Importing into eclipse with m2eclipse
61 | We recommend the https://eclipse.org/m2e/[m2eclipse] eclipse plugin when working with
62 | eclipse. If you don't already have m2eclipse installed it is available from the "eclipse
63 | marketplace".
64 |
65 | NOTE: Older versions of m2e do not support Maven 3.3, so once the
66 | projects are imported into Eclipse you will also need to tell
67 | m2eclipse to use the right profile for the projects. If you
68 | see many different errors related to the POMs in the projects, check
69 | that you have an up to date installation. If you can't upgrade m2e,
70 | add the "spring" profile to your `settings.xml`. Alternatively you can
71 | copy the repository settings from the "spring" profile of the parent
72 | pom into your `settings.xml`.
73 |
74 | [[importing-into-eclipse-without-m2eclipse]]
75 | === Importing into eclipse without m2eclipse
76 | If you prefer not to use m2eclipse you can generate eclipse project metadata using the
77 | following command:
78 |
79 | [indent=0]
80 | ----
81 | $ ./mvnw eclipse:eclipse
82 | ----
83 |
84 | The generated eclipse projects can be imported by selecting `import existing projects`
85 | from the `file` menu.
86 |
87 |
--------------------------------------------------------------------------------
/docs/modules/ROOT/partials/code-of-conduct.adoc:
--------------------------------------------------------------------------------
1 | [[contributor-code-of-conduct]]
2 | == Contributor Code of Conduct
3 |
4 | As contributors and maintainers of this project, and in the interest of fostering an open
5 | and welcoming community, we pledge to respect all people who contribute through reporting
6 | issues, posting feature requests, updating documentation, submitting pull requests or
7 | patches, and other activities.
8 |
9 | We are committed to making participation in this project a harassment-free experience for
10 | everyone, regardless of level of experience, gender, gender identity and expression,
11 | sexual orientation, disability, personal appearance, body size, race, ethnicity, age,
12 | religion, or nationality.
13 |
14 | Examples of unacceptable behavior by participants include:
15 |
16 | * The use of sexualized language or imagery
17 | * Personal attacks
18 | * Trolling or insulting/derogatory comments
19 | * Public or private harassment
20 | * Publishing other's private information, such as physical or electronic addresses,
21 | without explicit permission
22 | * Other unethical or unprofessional conduct
23 |
24 | Project maintainers have the right and responsibility to remove, edit, or reject comments,
25 | commits, code, wiki edits, issues, and other contributions that are not aligned to this
26 | Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors
27 | that they deem inappropriate, threatening, offensive, or harmful.
28 |
29 | By adopting this Code of Conduct, project maintainers commit themselves to fairly and
30 | consistently applying these principles to every aspect of managing this project. Project
31 | maintainers who do not follow or enforce the Code of Conduct may be permanently removed
32 | from the project team.
33 |
34 | This Code of Conduct applies both within project spaces and in public spaces when an
35 | individual is representing the project or its community.
36 |
37 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by
38 | contacting a project maintainer at spring-code-of-conduct@pivotal.io . All complaints will
39 | be reviewed and investigated and will result in a response that is deemed necessary and
40 | appropriate to the circumstances. Maintainers are obligated to maintain confidentiality
41 | with regard to the reporter of an incident.
42 |
43 | This Code of Conduct is adapted from the
44 | https://contributor-covenant.org[Contributor Covenant], version 1.3.0, available at
45 | https://contributor-covenant.org/version/1/3/0/[contributor-covenant.org/version/1/3/0/]
46 |
--------------------------------------------------------------------------------
/docs/modules/ROOT/partials/contributing-docs.adoc:
--------------------------------------------------------------------------------
1 | NOTE: Spring Cloud is released under the non-restrictive Apache 2.0 license. If you would like to contribute to this section of the documentation or if you find an error, please find the source code and issue trackers in the project at {github-project}[github].
2 |
--------------------------------------------------------------------------------
/docs/modules/ROOT/partials/contributing.adoc:
--------------------------------------------------------------------------------
1 | :spring-cloud-build-branch: main
2 |
3 | Spring Cloud is released under the non-restrictive Apache 2.0 license,
4 | and follows a very standard Github development process, using Github
5 | tracker for issues and merging pull requests into main. If you want
6 | to contribute even something trivial please do not hesitate, but
7 | follow the guidelines below.
8 |
9 | [[developer-certificate-of-origin]]
10 | == Developer Certificate of Origin (DCO)
11 |
12 | All commits must include a __Signed-off-by__ trailer at the end of each commit message to indicate that the contributor agrees to the Developer Certificate of Origin.
13 | For additional details, please refer to the blog post https://spring.io/blog/2025/01/06/hello-dco-goodbye-cla-simplifying-contributions-to-spring[Hello DCO, Goodbye CLA: Simplifying Contributions to Spring].
14 |
15 | [[code-of-conduct]]
16 | == Code of Conduct
17 | This project adheres to the Contributor Covenant https://github.com/spring-cloud/spring-cloud-build/blob/main/docs/modules/ROOT/partials/code-of-conduct.adoc[code of
18 | conduct]. By participating, you are expected to uphold this code. Please report
19 | unacceptable behavior to code-of-conduct@spring.io.
20 |
21 | [[code-conventions-and-housekeeping]]
22 | == Code Conventions and Housekeeping
23 | None of these is essential for a pull request, but they will all help. They can also be
24 | added after the original pull request but before a merge.
25 |
26 | * Use the Spring Framework code format conventions. If you use Eclipse
27 | you can import formatter settings using the
28 | `eclipse-code-formatter.xml` file from the
29 | https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/main/spring-cloud-dependencies-parent/eclipse-code-formatter.xml[Spring
30 | Cloud Build] project. If using IntelliJ, you can use the
31 | https://plugins.jetbrains.com/plugin/6546[Eclipse Code Formatter
32 | Plugin] to import the same file.
33 | * Make sure all new `.java` files to have a simple Javadoc class comment with at least an
34 | `@author` tag identifying you, and preferably at least a paragraph on what the class is
35 | for.
36 | * Add the ASF license header comment to all new `.java` files (copy from existing files
37 | in the project)
38 | * Add yourself as an `@author` to the .java files that you modify substantially (more
39 | than cosmetic changes).
40 | * Add some Javadocs and, if you change the namespace, some XSD doc elements.
41 | * A few unit tests would help a lot as well -- someone has to do it.
42 | * If no-one else is using your branch, please rebase it against the current main (or
43 | other target branch in the main project).
44 | * When writing a commit message please follow https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html[these conventions],
45 | if you are fixing an existing issue please add `Fixes gh-XXXX` at the end of the commit
46 | message (where XXXX is the issue number).
47 |
48 | [[checkstyle]]
49 | == Checkstyle
50 |
51 | 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:
52 |
53 | .spring-cloud-build-tools/
54 | ----
55 | └── src
56 | ├── checkstyle
57 | │ └── checkstyle-suppressions.xml <3>
58 | └── main
59 | └── resources
60 | ├── checkstyle-header.txt <2>
61 | └── checkstyle.xml <1>
62 | ----
63 | <1> Default Checkstyle rules
64 | <2> File header setup
65 | <3> Default suppression rules
66 |
67 | [[checkstyle-configuration]]
68 | === Checkstyle configuration
69 |
70 | Checkstyle rules are *disabled by default*. To add checkstyle to your project just define the following properties and plugins.
71 |
72 | .pom.xml
73 | ----
74 |
75 | true <1>
76 | true
77 | <2>
78 | true
79 | <3>
80 |
81 |
82 |
83 |
84 | <4>
85 | io.spring.javaformat
86 | spring-javaformat-maven-plugin
87 |
88 | <5>
89 | org.apache.maven.plugins
90 | maven-checkstyle-plugin
91 |
92 |
93 |
94 |
95 |
96 | <5>
97 | org.apache.maven.plugins
98 | maven-checkstyle-plugin
99 |
100 |
101 |
102 |
103 | ----
104 | <1> Fails the build upon Checkstyle errors
105 | <2> Fails the build upon Checkstyle violations
106 | <3> Checkstyle analyzes also the test sources
107 | <4> Add the Spring Java Format plugin that will reformat your code to pass most of the Checkstyle formatting rules
108 | <5> Add checkstyle plugin to your build and reporting phases
109 |
110 | 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:
111 |
112 | .projectRoot/src/checkstyle/checkstyle-suppresions.xml
113 | ----
114 |
115 |
118 |
119 |
120 |
121 |
122 | ----
123 |
124 | 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:
125 |
126 | ```bash
127 | $ curl https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/main/.editorconfig -o .editorconfig
128 | $ touch .springformat
129 | ```
130 |
131 | [[ide-setup]]
132 | == IDE setup
133 |
134 | [[intellij-idea]]
135 | === Intellij IDEA
136 |
137 | In order to setup Intellij you should import our coding conventions, inspection profiles and set up the checkstyle plugin.
138 | The following files can be found in the https://github.com/spring-cloud/spring-cloud-build/tree/main/spring-cloud-build-tools[Spring Cloud Build] project.
139 |
140 | .spring-cloud-build-tools/
141 | ----
142 | └── src
143 | ├── checkstyle
144 | │ └── checkstyle-suppressions.xml <3>
145 | └── main
146 | └── resources
147 | ├── checkstyle-header.txt <2>
148 | ├── checkstyle.xml <1>
149 | └── intellij
150 | ├── Intellij_Project_Defaults.xml <4>
151 | └── Intellij_Spring_Boot_Java_Conventions.xml <5>
152 | ----
153 | <1> Default Checkstyle rules
154 | <2> File header setup
155 | <3> Default suppression rules
156 | <4> Project defaults for Intellij that apply most of Checkstyle rules
157 | <5> Project style conventions for Intellij that apply most of Checkstyle rules
158 |
159 | .Code style
160 |
161 | image::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/main/docs/modules/ROOT/assets/images/intellij-code-style.png[Code style]
162 |
163 | 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.
164 |
165 | .Inspection profiles
166 |
167 | image::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/main/docs/modules/ROOT/assets/images/intellij-inspections.png[Code style]
168 |
169 | 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.
170 |
171 | .Checkstyle
172 |
173 | 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
174 |
175 | image::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/main/docs/modules/ROOT/assets/images/intellij-checkstyle.png[Checkstyle]
176 |
177 | 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/main/spring-cloud-build-tools/src/main/resources/checkstyle.xml`). We need to provide the following variables:
178 |
179 | - `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/main/spring-cloud-build-tools/src/main/resources/checkstyle-header.txt` URL.
180 | - `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/main/spring-cloud-build-tools/src/checkstyle/checkstyle-suppressions.xml` URL.
181 | - `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`.
182 |
183 | IMPORTANT: Remember to set the `Scan Scope` to `All sources` since we apply checkstyle rules for production and test sources.
184 |
185 | [[duplicate-finder]]
186 | == Duplicate Finder
187 |
188 | Spring Cloud Build brings along the `basepom:duplicate-finder-maven-plugin`, that enables flagging duplicate and conflicting classes and resources on the java classpath.
189 |
190 | [[duplicate-finder-configuration]]
191 | === Duplicate Finder configuration
192 |
193 | 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 project's `pom.xml`.
194 |
195 | .pom.xml
196 | [source,xml]
197 | ----
198 |
199 |
200 |
201 | org.basepom.maven
202 | duplicate-finder-maven-plugin
203 |
204 |
205 |
206 | ----
207 |
208 | For other properties, we have set defaults as listed in the https://github.com/basepom/duplicate-finder-maven-plugin/wiki[plugin documentation].
209 |
210 | 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.
211 |
212 | If you need to add `ignoredClassPatterns` or `ignoredResourcePatterns` to your setup, make sure to add them in the plugin configuration section of your project:
213 |
214 | [source,xml]
215 | ----
216 |
217 |
218 |
219 | org.basepom.maven
220 | duplicate-finder-maven-plugin
221 |
222 |
223 | org.joda.time.base.BaseDateTime
224 | .*module-info
225 |
226 |
227 | changelog.txt
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 | ----
236 |
237 |
--------------------------------------------------------------------------------
/docs/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "dependencies": {
3 | "antora": "3.2.0-alpha.8",
4 | "@antora/atlas-extension": "1.0.0-alpha.2",
5 | "@antora/collector-extension": "1.0.1",
6 | "@asciidoctor/tabs": "1.0.0-beta.6",
7 | "@springio/antora-extensions": "1.14.4",
8 | "@springio/asciidoctor-extensions": "1.0.0-alpha.17"
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/docs/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 | spring-cloud-build-docs
7 | spring-cloud-build-docs
8 | jar
9 | Spring Cloud Build Docs
10 |
11 | org.springframework.cloud
12 | spring-cloud-build
13 | 4.3.1-SNAPSHOT
14 |
15 |
16 | spring-cloud-build
17 | ${basedir}/..
18 |
19 | none
20 | none
21 | none
22 | ${project.basedir}/src/main/
23 |
24 |
25 | deploy
26 |
27 | maven.compile.classpath
28 |
29 |
30 |
31 |
32 |
33 | commons-logging
34 | commons-logging
35 | 1.3.5
36 | compile
37 |
38 |
39 | org.springframework
40 | spring-core
41 | compile
42 |
43 |
44 | com.fasterxml.jackson.core
45 | jackson-databind
46 | compile
47 |
48 |
49 |
50 | org.asciidoctor
51 | asciidoctorj
52 | ${asciidoctorj.version}
53 | compile
54 |
55 |
56 | org.springframework.boot
57 | spring-boot-starter-test
58 | test
59 |
60 |
61 |
62 |
63 |
64 | org.apache.maven.plugins
65 | maven-assembly-plugin
66 | 3.7.1
67 |
68 |
69 | jar-with-dependencies
70 |
71 |
72 |
73 |
74 | make-assembly
75 | package
76 |
77 | single
78 |
79 |
80 |
81 |
82 |
83 | maven-deploy-plugin
84 | ${maven-deploy-plugin.version}
85 |
86 |
87 |
88 |
89 |
90 |
91 | docs
92 |
93 |
94 |
95 | src/main/antora/resources/antora-resources
96 | true
97 |
98 |
99 |
100 |
101 | pl.project13.maven
102 | git-commit-id-plugin
103 |
104 |
105 | org.apache.maven.plugins
106 | maven-dependency-plugin
107 |
108 |
109 | org.codehaus.mojo
110 | exec-maven-plugin
111 |
112 |
113 | io.spring.maven.antora
114 | antora-component-version-maven-plugin
115 |
116 |
117 | org.antora
118 | antora-maven-plugin
119 |
120 |
121 | org.apache.maven.plugins
122 | maven-antrun-plugin
123 |
124 |
125 | maven-deploy-plugin
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
--------------------------------------------------------------------------------
/docs/src/main/.gitignore:
--------------------------------------------------------------------------------
1 | META-INF/
2 | org/
--------------------------------------------------------------------------------
/docs/src/main/antora/resources/antora-resources/antora.yml:
--------------------------------------------------------------------------------
1 | version: @antora-component.version@
2 | prerelease: @antora-component.prerelease@
3 |
4 | asciidoc:
5 | attributes:
6 | attribute-missing: 'warn'
7 | chomp: 'all'
8 | project-root: @maven.multiModuleProjectDirectory@
9 | github-repo: @docs.main@
10 | github-raw: https://raw.githubusercontent.com/spring-cloud/@docs.main@/@github-tag@
11 | github-code: https://github.com/spring-cloud/@docs.main@/tree/@github-tag@
12 | github-issues: https://github.com/spring-cloud/@docs.main@/issues/
13 | github-wiki: https://github.com/spring-cloud/@docs.main@/wiki
14 | spring-cloud-version: @project.version@
15 | github-tag: @github-tag@
16 | version-type: @version-type@
17 | docs-url: https://docs.spring.io/@docs.main@/docs/@project.version@
18 | raw-docs-url: https://raw.githubusercontent.com/spring-cloud/@docs.main@/@github-tag@
19 | project-version: @project.version@
20 | project-name: @docs.main@
21 |
--------------------------------------------------------------------------------
/docs/src/main/asciidoc/README.adoc:
--------------------------------------------------------------------------------
1 | image::https://github.com/spring-cloud/spring-cloud-build/workflows/Build/badge.svg?branch=main&style=svg["Build",link="https://github.com/spring-cloud/spring-cloud-build/actions"]
2 |
3 | Spring Cloud Build is a common utility project for Spring Cloud
4 | to use for plugin and dependency management.
5 |
6 | [[building-and-deploying]]
7 | = Building and Deploying
8 |
9 | To install locally:
10 |
11 | ----
12 |
13 | $ mvn install -s .settings.xml
14 | ----
15 |
16 | and to deploy snapshots to repo.spring.io:
17 |
18 | ----
19 | $ mvn deploy -DaltSnapshotDeploymentRepository=repo.spring.io::default::https://repo.spring.io/snapshot
20 | ----
21 |
22 | and for Maven Central use
23 |
24 | ----
25 | $ mvn deploy -P central -DaltReleaseDeploymentRepository=sonatype-nexus-staging::default::https://oss.sonatype.org/service/local/staging/deploy/maven2
26 | ----
27 |
28 | (the "central" profile is available for all projects in Spring Cloud and it sets up the gpg jar signing, and the repository has to be specified separately for this project because it is a parent of the starter parent which users in turn have as their own parent).
29 |
30 | [[contributing]]
31 | = Contributing
32 |
33 | include::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/main/docs/modules/ROOT/partials/contributing.adoc[]
34 |
35 | [[flattening-the-poms]]
36 | = Flattening the POMs
37 |
38 | To avoid propagating build setup that is required to build a Spring Cloud project, we're using the maven flatten plugin. It has the advantage of letting you use whatever features you need while publishing "clean" pom to the repository.
39 |
40 | In order to add it, add the `org.codehaus.mojo:flatten-maven-plugin` to your `pom.xml`.
41 |
42 | [source,xml]
43 | ----
44 |
45 |
46 |
47 | org.codehaus.mojo
48 | flatten-maven-plugin
49 |
50 |
51 |
52 | ----
53 |
54 | [[reusing-the-documentation]]
55 | = Reusing the documentation
56 |
57 | Spring Cloud Build publishes its `spring-cloud-build-docs` module that contains
58 | helpful scripts (e.g. README generation ruby script) and css, xslt and images
59 | for the Spring Cloud documentation. If you want to follow the same convention
60 | approach of generating documentation just add these plugins to your `docs` module
61 |
62 | [source,xml]
63 | ----
64 | include::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/main/docs/pom.xml[indent=0,tags=docs]
65 | ----
66 |
67 | IMPORTANT: The order of plugin declaration is important!
68 |
69 | In order for the build to generate the `adoc` file with all your configuration properties, your `docs` module should contain all the dependencies on the classpath, that you would want to scan for configuration properties.
70 |
71 | If you want to modify which of the configuration properties are put in the table, you can tweak the `configprops.inclusionPattern` pattern to include only a subset of the properties (e.g. `spring.sleuth.*`).
72 |
73 | Spring Cloud Build Docs comes with a set of attributes for asciidoctor that you can reuse.
74 |
75 | [source,yml]
76 | ----
77 | include::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/main/docs/src/main/antora/resources/antora-resources/antora.yml[indent=0]
78 | ----
79 |
80 | [[updating-the-guides]]
81 | = Updating the guides
82 |
83 | We assume that your project contains guides under the `guides` folder.
84 |
85 | ```
86 | .
87 | └── guides
88 | ├── gs-guide1
89 | ├── gs-guide2
90 | └── gs-guide3
91 | ```
92 |
93 | This means that the project contains 3 guides that would
94 | correspond to the following guides in Spring Guides org.
95 |
96 | - https://github.com/spring-guides/gs-guide1
97 | - https://github.com/spring-guides/gs-guide2
98 | - https://github.com/spring-guides/gs-guide3
99 |
100 | If you deploy your project with the `-Pguides` profile like this
101 |
102 | ```
103 | $ ./mvnw clean deploy -Pguides
104 | ```
105 |
106 | what will happen is that for GA project versions, we will clone `gs-guide1`, `gs-guide2` and `gs-guide3` and update their contents with the ones being under your `guides` project.
107 |
108 | You can skip this by either not adding the `guides` profile, or passing the `-DskipGuides` system property when the profile is turned on.
109 |
110 | 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`).
111 |
--------------------------------------------------------------------------------
/docs/src/main/java/org/springframework/cloud/internal/Main.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2012-2020 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.internal;
18 |
19 | import java.io.File;
20 | import java.io.IOException;
21 | import java.nio.file.Files;
22 | import java.util.HashMap;
23 | import java.util.List;
24 | import java.util.Map;
25 | import java.util.TreeSet;
26 | import java.util.concurrent.atomic.AtomicInteger;
27 | import java.util.regex.Pattern;
28 | import java.util.stream.Collectors;
29 |
30 | import com.fasterxml.jackson.databind.ObjectMapper;
31 |
32 | import org.springframework.core.io.Resource;
33 | import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
34 | import org.springframework.util.StreamUtils;
35 | import org.springframework.util.StringUtils;
36 |
37 | /**
38 | * @author Marcin Grzejszczak
39 | */
40 | public class Main {
41 |
42 | public static void main(String... args) {
43 | String outputFile = args[0];
44 | String inclusionPattern = args.length > 1 ? args[1] : ".*";
45 | File parent = new File(outputFile).getParentFile();
46 | if (!parent.exists()) {
47 | System.out.println("No parent directory [" + parent.toString()
48 | + "] found. Will not generate the configuration properties file");
49 | return;
50 | }
51 | new Generator().generate(outputFile, inclusionPattern);
52 | }
53 |
54 | static class Generator {
55 |
56 | void generate(String outputFile, String inclusionPattern) {
57 | try {
58 | System.out.println("Parsing all configuration metadata");
59 | Resource[] resources = getResources();
60 | System.out.println("Found [" + resources.length + "] configuration metadata jsons");
61 | TreeSet names = new TreeSet<>();
62 | Map descriptions = new HashMap<>();
63 | final AtomicInteger count = new AtomicInteger();
64 | final AtomicInteger matchingPropertyCount = new AtomicInteger();
65 | final AtomicInteger propertyCount = new AtomicInteger();
66 | Pattern pattern = Pattern.compile(inclusionPattern);
67 | for (Resource resource : resources) {
68 | if (resourceNameContainsPattern(resource)) {
69 | count.incrementAndGet();
70 | byte[] bytes = StreamUtils.copyToByteArray(resource.getInputStream());
71 | Map response = new ObjectMapper().readValue(bytes, HashMap.class);
72 | List