├── .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> properties = (List>) response.get("properties"); 73 | properties.forEach(val -> { 74 | propertyCount.incrementAndGet(); 75 | String name = String.valueOf(val.get("name")); 76 | if (!pattern.matcher(name).matches()) { 77 | return; 78 | } 79 | Object description = val.get("description"); 80 | Object defaultValue = val.get("defaultValue"); 81 | matchingPropertyCount.incrementAndGet(); 82 | names.add(name); 83 | descriptions.put(name, new ConfigValue(name, description, defaultValue)); 84 | }); 85 | } 86 | } 87 | System.out.println( 88 | "Found [" + count + "] Cloud projects configuration metadata jsons. [" + matchingPropertyCount 89 | + "/" + propertyCount + "] were matching the pattern [" + inclusionPattern + "]"); 90 | System.out.println("Successfully built the description table"); 91 | if (names.isEmpty()) { 92 | System.out.println("Will not update the table, since no configuration properties were found!"); 93 | return; 94 | } 95 | Files.write(new File(outputFile).toPath(), 96 | ("|===\n" 97 | + "|Name | Default | Description\n\n" + names.stream() 98 | .map(it -> descriptions.get(it).toString()).collect(Collectors.joining("\n")) 99 | + "\n\n" + "|===").getBytes()); 100 | System.out.println("Successfully stored the output file"); 101 | } 102 | catch (IOException e) { 103 | throw new IllegalStateException(e); 104 | } 105 | } 106 | 107 | protected boolean resourceNameContainsPattern(Resource resource) { 108 | try { 109 | return resource.getURL().toString().contains("cloud"); 110 | } 111 | catch (Exception e) { 112 | System.out.println("Exception [" + e + "] for resource [" + resource 113 | + "] occurred while trying to retrieve its URL"); 114 | return false; 115 | } 116 | } 117 | 118 | protected Resource[] getResources() throws IOException { 119 | return new PathMatchingResourcePatternResolver() 120 | .getResources("classpath*:/META-INF/spring-configuration-metadata.json"); 121 | } 122 | 123 | } 124 | 125 | static class ConfigValue { 126 | 127 | public String name; 128 | 129 | public String description; 130 | 131 | public String defaultValue; 132 | 133 | ConfigValue() { 134 | } 135 | 136 | ConfigValue(String name, Object description, Object defaultValue) { 137 | this.name = name; 138 | this.description = escapedValue(description); 139 | this.defaultValue = escapedValue(defaultValue); 140 | } 141 | 142 | private String escapedValue(Object value) { 143 | return value != null ? value.toString().replaceAll("\\|", "\\\\|") : ""; 144 | } 145 | 146 | public String toString() { 147 | return "|" + name + " | " + (StringUtils.hasText(defaultValue) ? ("`+++" + defaultValue + "+++`") : "") + " | " + description; 148 | } 149 | 150 | } 151 | 152 | } 153 | -------------------------------------------------------------------------------- /docs/src/main/java/org/springframework/cloud/internal/asciidoctor/CoalescerPreprocessor.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.asciidoctor; 18 | 19 | import java.io.File; 20 | import java.io.IOException; 21 | import java.nio.file.Files; 22 | import java.util.Arrays; 23 | import java.util.LinkedList; 24 | import java.util.List; 25 | 26 | import org.asciidoctor.ast.Document; 27 | import org.asciidoctor.extension.Preprocessor; 28 | import org.asciidoctor.extension.PreprocessorReader; 29 | 30 | // taken from https://github.com/hibernate/hibernate-asciidoctor-extensions/blob/1.0.3.Final/src/main/java/org/hibernate/infra/asciidoctor/extensions/savepreprocessed/SavePreprocessedOutputPreprocessor.java 31 | /** 32 | * Preprocessor used to save the preprocessed output of the asciidoctor conversion. It allows to generate a single file 33 | * integrating all the includes. 34 | * 35 | * @author Guillaume Smet 36 | */ 37 | class CoalescerPreprocessor extends Preprocessor { 38 | 39 | private final File outputFile; 40 | 41 | private static final List FILTER_LICENSE_MARKERS = Arrays.asList("[preface]", "<<<"); 42 | 43 | private static final String COMMENT_MARKER = "//"; 44 | 45 | private static final String SOURCE_MARKER = "[source"; 46 | 47 | private static final List SECTION_MARKERS = Arrays.asList("----", "...."); 48 | 49 | private static final String HEADER = "////\n" + "DO NOT EDIT THIS FILE. IT WAS GENERATED.\n" 50 | + "Manual changes to this file will be lost when it is generated again.\n" 51 | + "Edit the files in the src/main/asciidoc/ directory instead.\n" + "////\n\n"; 52 | 53 | CoalescerPreprocessor(File output_file) { 54 | outputFile = output_file; 55 | } 56 | 57 | @Override 58 | public void process(Document document, PreprocessorReader preprocessorReader) { 59 | try { 60 | LinkedList filteredLines = filterLines(preprocessorReader.readLines()); 61 | filteredLines.addFirst(HEADER); 62 | Files.write(outputFile.toPath(), filteredLines); 63 | } 64 | catch (IOException e) { 65 | throw new IllegalStateException("Unable to write the preprocessed file " + outputFile, e); 66 | } 67 | } 68 | 69 | /** 70 | * This is used to filter out the license headers that are just after the markers 71 | * defined. It also reindents the source code with spaces to be consistent with the 72 | * 1.1 spec. 73 | */ 74 | private LinkedList filterLines(List lines) { 75 | LinkedList filteredLines = new LinkedList<>(); 76 | ParsingState state = ParsingState.NORMAL; 77 | int counter = 0; 78 | for (String line : lines) { 79 | counter++; 80 | switch (state) { 81 | case NORMAL: 82 | if (FILTER_LICENSE_MARKERS.contains(line)) { 83 | state = ParsingState.FILTER_LICENSE; 84 | } 85 | else if (line.startsWith(SOURCE_MARKER)) { 86 | state = ParsingState.SOURCE; 87 | } 88 | break; 89 | case SOURCE: 90 | if (SECTION_MARKERS.contains(line)) { 91 | state = ParsingState.SOURCE_CONTENT; 92 | } 93 | else { 94 | System.err.println("[source] requires to be followed by a section marker and line number [" + counter + "] with content [" + line + "] doesn't have it"); 95 | } 96 | break; 97 | case SOURCE_CONTENT: 98 | if (SECTION_MARKERS.contains(line)) { 99 | state = ParsingState.NORMAL; 100 | } 101 | else { 102 | filteredLines.add(line.replaceAll("\t", " ")); 103 | continue; 104 | } 105 | break; 106 | case FILTER_LICENSE: 107 | if (line.startsWith(COMMENT_MARKER)) { 108 | continue; 109 | } 110 | else { 111 | state = ParsingState.NORMAL; 112 | } 113 | break; 114 | } 115 | filteredLines.add(line); 116 | } 117 | return filteredLines; 118 | } 119 | 120 | private enum ParsingState { 121 | 122 | NORMAL, FILTER_LICENSE, SOURCE, SOURCE_CONTENT, 123 | 124 | } 125 | 126 | } 127 | -------------------------------------------------------------------------------- /docs/src/main/java/org/springframework/cloud/internal/asciidoctor/ReadmeMain.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.asciidoctor; 18 | 19 | import java.io.File; 20 | import java.io.IOException; 21 | import java.nio.file.Files; 22 | 23 | import org.asciidoctor.Asciidoctor; 24 | import org.asciidoctor.Attributes; 25 | import org.asciidoctor.Options; 26 | import org.asciidoctor.SafeMode; 27 | 28 | public class ReadmeMain { 29 | public static void main(String... args) { 30 | File inputFile = new File(args[0]); 31 | File outputFile = new File(args[1]); 32 | System.out.println("Will do the Readme conversion from [" + inputFile + "] to [" + outputFile + "]"); 33 | if (!inputFile.exists()) { 34 | System.out.println("There's no file [" + inputFile + "], skipping readme generation"); 35 | return; 36 | } 37 | new ReadmeMain().convert(inputFile, outputFile); 38 | } 39 | 40 | void convert(File input, File output) { 41 | Asciidoctor asciidoctor = Asciidoctor.Factory.create(); 42 | asciidoctor.javaExtensionRegistry().preprocessor(new CoalescerPreprocessor(output)); 43 | Options options = options(input, output); 44 | try { 45 | String fileAsString = new String(Files.readAllBytes(input.toPath())); 46 | asciidoctor.convert(fileAsString, options); 47 | System.out.println("Successfully converted the Readme file!\n"); 48 | } catch (IOException ex) { 49 | throw new IllegalStateException("Failed to convert the file", ex); 50 | } 51 | } 52 | 53 | private Options options(File input, File output) { 54 | Attributes attributes = Attributes.builder() 55 | .allowUriRead(true) 56 | .attribute("project-root", output.getParent()) 57 | .build(); 58 | 59 | return Options.builder() 60 | .sourceDir(input.getParentFile()) 61 | .baseDir(input.getParentFile()) 62 | .attributes(attributes) 63 | .safe(SafeMode.UNSAFE) 64 | .parseHeaderOnly(true) 65 | .build(); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /docs/src/test/java/org/springframework/cloud/internal/GeneratorTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2019 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.net.URISyntaxException; 22 | import java.net.URL; 23 | import java.nio.file.Files; 24 | 25 | import org.junit.jupiter.api.Test; 26 | 27 | import org.springframework.core.io.FileSystemResource; 28 | import org.springframework.core.io.Resource; 29 | 30 | import static org.assertj.core.api.BDDAssertions.then; 31 | 32 | class GeneratorTests { 33 | 34 | URL root = GeneratorTests.class.getResource("."); 35 | 36 | @Test 37 | void should_not_create_a_file_when_no_properties_were_found() 38 | throws URISyntaxException { 39 | Main.Generator generator = new Main.Generator() { 40 | @Override 41 | protected Resource[] getResources() { 42 | return new Resource[0]; 43 | } 44 | }; 45 | File file = new File(root.toURI().toString(), "output.adoc"); 46 | String inclusionPattern = ".*"; 47 | 48 | generator.generate(file.getAbsolutePath(), inclusionPattern); 49 | 50 | then(file).doesNotExist(); 51 | } 52 | 53 | @Test 54 | void should_create_a_file_when_cloud_file_was_found() { 55 | Main.Generator generator = new Main.Generator() { 56 | @Override 57 | protected Resource[] getResources() { 58 | return new Resource[] { resource("/not-matching-name.json"), 59 | resource("/with-cloud-in-name.json") }; 60 | } 61 | 62 | @Override 63 | protected boolean resourceNameContainsPattern(Resource resource) { 64 | try { 65 | return resource.getURI().toString().contains("with-cloud"); 66 | } 67 | catch (IOException ex) { 68 | throw new IllegalStateException(ex); 69 | } 70 | } 71 | }; 72 | File file = new File(root.getFile().toString(), "output.adoc"); 73 | String inclusionPattern = ".*"; 74 | 75 | generator.generate(file.getAbsolutePath(), inclusionPattern); 76 | 77 | then(file).exists(); 78 | then(asString(file)).contains("spring.first-property") 79 | .contains("unmatched.second-property") 80 | .doesNotContain("example1.first-property"); 81 | } 82 | 83 | @Test 84 | void should_create_a_file_when_spring_property_was_found() { 85 | Main.Generator generator = new Main.Generator() { 86 | @Override 87 | protected Resource[] getResources() { 88 | return new Resource[] { resource("/not-matching-name.json"), 89 | resource("/with-cloud-in-name.json") }; 90 | } 91 | }; 92 | File file = new File(root.getFile().toString(), "output.adoc"); 93 | String inclusionPattern = "spring.*"; 94 | 95 | generator.generate(file.getAbsolutePath(), inclusionPattern); 96 | 97 | then(file).exists(); 98 | then(asString(file)).contains("spring.first-property") 99 | .doesNotContain("example1.first-property") 100 | .doesNotContain("unmatched.second-property"); 101 | } 102 | 103 | static String asString(File file) { 104 | try { 105 | return new String(Files.readAllBytes(file.toPath())); 106 | } 107 | catch (IOException ex) { 108 | throw new IllegalStateException(ex); 109 | } 110 | } 111 | 112 | static Resource resource(String path) { 113 | return new FileSystemResource(GeneratorTests.class.getResource(path).getFile()); 114 | } 115 | 116 | } 117 | -------------------------------------------------------------------------------- /docs/src/test/java/org/springframework/cloud/internal/MainTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2019 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 | 21 | import org.junit.jupiter.api.Test; 22 | 23 | import static org.assertj.core.api.BDDAssertions.then; 24 | 25 | class MainTests { 26 | 27 | @Test 28 | void should_do_nothing_when_parent_dir_is_not_found() { 29 | File nonExistantFile = new File("/this/file/does/not/exist"); 30 | 31 | Main.main(nonExistantFile.getAbsolutePath()); 32 | 33 | then(nonExistantFile).doesNotExist(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /docs/src/test/java/org/springframework/cloud/internal/asciidoctor/ReadmeMainTests.java: -------------------------------------------------------------------------------- 1 | package org.springframework.cloud.internal.asciidoctor; 2 | 3 | import java.io.File; 4 | import java.io.IOException; 5 | import java.net.URISyntaxException; 6 | import java.nio.file.Files; 7 | 8 | import org.junit.jupiter.api.Test; 9 | 10 | import static org.assertj.core.api.BDDAssertions.then; 11 | 12 | class ReadmeMainTests { 13 | 14 | @Test 15 | void should_convert_input_with_include_of_external_sources_to_a_single_file() throws URISyntaxException, IOException { 16 | File inputFile = new File(ReadmeMainTests.class.getResource("/README.adoc").toURI()); 17 | File outputFile = deleteIfExists(new File("target/output.adoc")); 18 | 19 | ReadmeMain.main(inputFile.getAbsolutePath(), outputFile.getAbsolutePath()); 20 | 21 | then(new String(Files.readAllBytes(outputFile.toPath()))) 22 | .doesNotContain("include:") 23 | .doesNotContain("Unresolved directive") 24 | .contains("DO NOT EDIT THIS FILE. IT WAS GENERATED") 25 | .contains("Hello world!"); 26 | then(new File("target/output.html")) 27 | .as("Conversion to HTML must not happen").doesNotExist(); 28 | } 29 | 30 | private File deleteIfExists(File outputFile) { 31 | if (outputFile.exists()) { 32 | outputFile.delete(); 33 | } 34 | return outputFile; 35 | } 36 | } -------------------------------------------------------------------------------- /docs/src/test/resources/README.adoc: -------------------------------------------------------------------------------- 1 | image:https://circleci.com/gh/spring-cloud/spring-cloud-build.svg?style=svg[link="https://travis-ci.org/spring-cloud/spring-cloud-build"] 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 | 8 | To install locally: 9 | 10 | ---- 11 | 12 | $ mvn install -s .settings.xml 13 | ---- 14 | 15 | and to deploy snapshots to repo.spring.io: 16 | 17 | ---- 18 | $ mvn deploy -DaltSnapshotDeploymentRepository=repo.spring.io::default::https://repo.spring.io/libs-snapshot-local 19 | ---- 20 | 21 | for a RELEASE build use 22 | 23 | ---- 24 | $ mvn deploy -DaltReleaseDeploymentRepository=repo.spring.io::default::https://repo.spring.io/libs-release-local 25 | ---- 26 | 27 | and for jcenter use 28 | 29 | ---- 30 | $ mvn deploy -DaltReleaseDeploymentRepository=bintray::default::https://api.bintray.com/maven/spring/jars/org.springframework.cloud:build 31 | ---- 32 | 33 | and for Maven Central use 34 | 35 | ---- 36 | $ mvn deploy -P central -DaltReleaseDeploymentRepository=sonatype-nexus-staging::default::https://oss.sonatype.org/service/local/staging/deploy/maven2 37 | ---- 38 | 39 | (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). 40 | 41 | == Contributing 42 | 43 | include::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/main/docs/modules/ROOT/partials/contributing.adoc[] 44 | 45 | == Flattening the POMs 46 | 47 | 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. 48 | 49 | In order to add it, add the `org.codehaus.mojo:flatten-maven-plugin` to your `pom.xml`. 50 | 51 | [source,xml] 52 | ---- 53 | 54 | 55 | 56 | org.codehaus.mojo 57 | flatten-maven-plugin 58 | 59 | 60 | 61 | ---- 62 | 63 | == Reusing the documentation 64 | 65 | Spring Cloud Build publishes its `spring-cloud-build-docs` module that contains 66 | helpful scripts (e.g. README generation ruby script) and css, xslt and images 67 | for the Spring Cloud documentation. If you want to follow the same convention 68 | approach of generating documentation just add these plugins to your `docs` module 69 | 70 | [source,xml] 71 | ---- 72 | 73 | 74 | docs 75 | 76 | 77 | 78 | pl.project13.maven 79 | git-commit-id-plugin <1> 80 | 81 | 82 | org.apache.maven.plugins 83 | maven-dependency-plugin <2> 84 | 85 | 86 | org.apache.maven.plugins 87 | maven-resources-plugin <3> 88 | 89 | 90 | org.codehaus.mojo 91 | exec-maven-plugin <4> 92 | 93 | 94 | org.asciidoctor 95 | asciidoctor-maven-plugin <5> 96 | 97 | 98 | org.apache.maven.plugins 99 | maven-antrun-plugin <6> 100 | 101 | 102 | maven-deploy-plugin <7> 103 | 104 | 105 | 106 | 107 | 108 | ---- 109 | <1> This plugin downloads sets up all the git information of the project 110 | <2> This plugin downloads the resources of the `spring-cloud-build-docs` module 111 | <3> This plugin unpacks the resources of the `spring-cloud-build-docs` module 112 | <4> This plugin generates an `adoc` file with all the configuration properties from the classpath 113 | <5> This plugin is required to parse the Asciidoctor documentation 114 | <6> This plugin is required to copy resources into proper final destinations and to generate main README.adoc and to assert that no files use unresolved links 115 | <7> This plugin ensures that the generated zip docs will get published 116 | 117 | IMPORTANT: The order of plugin declaration is important! 118 | 119 | 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. The file will be output to `${docsModule}/src/main/asciidoc/_configprops.adoc` file (configurable via the `configprops.path` property). 120 | 121 | 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.*`). 122 | 123 | Spring Cloud Build Docs comes with a set of attributes for asciidoctor that you can reuse. 124 | 125 | [source,xml] 126 | ---- 127 | include::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/main/docs/pom.xml[tags=docs,indent=0] 128 | ---- 129 | 130 | == Updating the guides 131 | 132 | We assume that your project contains guides under the `guides` folder. 133 | 134 | ``` 135 | . 136 | └── guides 137 | ├── gs-guide1 138 | ├── gs-guide2 139 | └── gs-guide3 140 | ``` 141 | 142 | This means that the project contains 3 guides that would 143 | correspond to the following guides in Spring Guides org. 144 | 145 | - https://github.com/spring-guides/gs-guide1 146 | - https://github.com/spring-guides/gs-guide2 147 | - https://github.com/spring-guides/gs-guide3 148 | 149 | If you deploy your project with the `-Pguides` profile like this 150 | 151 | ``` 152 | $ ./mvnw clean deploy -Pguides 153 | ``` 154 | 155 | 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. 156 | 157 | You can skip this by either not adding the `guides` profile, or passing the `-DskipGuides` system property when the profile is turned on. 158 | 159 | 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`). 160 | 161 | include::included.adoc[] -------------------------------------------------------------------------------- /docs/src/test/resources/included.adoc: -------------------------------------------------------------------------------- 1 | Hello world! -------------------------------------------------------------------------------- /docs/src/test/resources/not-matching-name.json: -------------------------------------------------------------------------------- 1 | { 2 | "properties": [ 3 | { 4 | "defaultValue": "false", 5 | "name": "example1.first-property", 6 | "description": "First Description", 7 | "type": "java.lang.Boolean" 8 | }, 9 | { 10 | "defaultValue": "true", 11 | "name": "example2.second-property", 12 | "description": "Second Description", 13 | "type": "java.lang.Boolean" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /docs/src/test/resources/test.adoc: -------------------------------------------------------------------------------- 1 | include::included.adoc[] -------------------------------------------------------------------------------- /docs/src/test/resources/with-cloud-in-name.json: -------------------------------------------------------------------------------- 1 | { 2 | "properties": [ 3 | { 4 | "defaultValue": "false", 5 | "name": "spring.first-property", 6 | "description": "First Description", 7 | "type": "java.lang.Boolean" 8 | }, 9 | { 10 | "defaultValue": "true", 11 | "name": "unmatched.second-property", 12 | "description": "Second Description", 13 | "type": "java.lang.Boolean" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /mvnw: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # ---------------------------------------------------------------------------- 3 | # Licensed to the Apache Software Foundation (ASF) under one 4 | # or more contributor license agreements. See the NOTICE file 5 | # distributed with this work for additional information 6 | # regarding copyright ownership. The ASF licenses this file 7 | # to you under the Apache License, Version 2.0 (the 8 | # "License"); you may not use this file except in compliance 9 | # with the License. You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, 14 | # software distributed under the License is distributed on an 15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | # KIND, either express or implied. See the License for the 17 | # specific language governing permissions and limitations 18 | # under the License. 19 | # ---------------------------------------------------------------------------- 20 | 21 | # ---------------------------------------------------------------------------- 22 | # Maven Start Up Batch script 23 | # 24 | # Required ENV vars: 25 | # ------------------ 26 | # JAVA_HOME - location of a JDK home dir 27 | # 28 | # Optional ENV vars 29 | # ----------------- 30 | # M2_HOME - location of maven2's installed home dir 31 | # MAVEN_OPTS - parameters passed to the Java VM when running Maven 32 | # e.g. to debug Maven itself, use 33 | # set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 34 | # MAVEN_SKIP_RC - flag to disable loading of mavenrc files 35 | # ---------------------------------------------------------------------------- 36 | 37 | if [ -z "$MAVEN_SKIP_RC" ] ; then 38 | 39 | if [ -f /etc/mavenrc ] ; then 40 | . /etc/mavenrc 41 | fi 42 | 43 | if [ -f "$HOME/.mavenrc" ] ; then 44 | . "$HOME/.mavenrc" 45 | fi 46 | 47 | fi 48 | 49 | # OS specific support. $var _must_ be set to either true or false. 50 | cygwin=false; 51 | darwin=false; 52 | mingw=false 53 | case "`uname`" in 54 | CYGWIN*) cygwin=true ;; 55 | MINGW*) mingw=true;; 56 | Darwin*) darwin=true 57 | # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home 58 | # See https://developer.apple.com/library/mac/qa/qa1170/_index.html 59 | if [ -z "$JAVA_HOME" ]; then 60 | if [ -x "/usr/libexec/java_home" ]; then 61 | export JAVA_HOME="`/usr/libexec/java_home`" 62 | else 63 | export JAVA_HOME="/Library/Java/Home" 64 | fi 65 | fi 66 | ;; 67 | esac 68 | 69 | if [ -z "$JAVA_HOME" ] ; then 70 | if [ -r /etc/gentoo-release ] ; then 71 | JAVA_HOME=`java-config --jre-home` 72 | fi 73 | fi 74 | 75 | if [ -z "$M2_HOME" ] ; then 76 | ## resolve links - $0 may be a link to maven's home 77 | PRG="$0" 78 | 79 | # need this for relative symlinks 80 | while [ -h "$PRG" ] ; do 81 | ls=`ls -ld "$PRG"` 82 | link=`expr "$ls" : '.*-> \(.*\)$'` 83 | if expr "$link" : '/.*' > /dev/null; then 84 | PRG="$link" 85 | else 86 | PRG="`dirname "$PRG"`/$link" 87 | fi 88 | done 89 | 90 | saveddir=`pwd` 91 | 92 | M2_HOME=`dirname "$PRG"`/.. 93 | 94 | # make it fully qualified 95 | M2_HOME=`cd "$M2_HOME" && pwd` 96 | 97 | cd "$saveddir" 98 | # echo Using m2 at $M2_HOME 99 | fi 100 | 101 | # For Cygwin, ensure paths are in UNIX format before anything is touched 102 | if $cygwin ; then 103 | [ -n "$M2_HOME" ] && 104 | M2_HOME=`cygpath --unix "$M2_HOME"` 105 | [ -n "$JAVA_HOME" ] && 106 | JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 107 | [ -n "$CLASSPATH" ] && 108 | CLASSPATH=`cygpath --path --unix "$CLASSPATH"` 109 | fi 110 | 111 | # For Mingw, ensure paths are in UNIX format before anything is touched 112 | if $mingw ; then 113 | [ -n "$M2_HOME" ] && 114 | M2_HOME="`(cd "$M2_HOME"; pwd)`" 115 | [ -n "$JAVA_HOME" ] && 116 | JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" 117 | fi 118 | 119 | if [ -z "$JAVA_HOME" ]; then 120 | javaExecutable="`which javac`" 121 | if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then 122 | # readlink(1) is not available as standard on Solaris 10. 123 | readLink=`which readlink` 124 | if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then 125 | if $darwin ; then 126 | javaHome="`dirname \"$javaExecutable\"`" 127 | javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" 128 | else 129 | javaExecutable="`readlink -f \"$javaExecutable\"`" 130 | fi 131 | javaHome="`dirname \"$javaExecutable\"`" 132 | javaHome=`expr "$javaHome" : '\(.*\)/bin'` 133 | JAVA_HOME="$javaHome" 134 | export JAVA_HOME 135 | fi 136 | fi 137 | fi 138 | 139 | if [ -z "$JAVACMD" ] ; then 140 | if [ -n "$JAVA_HOME" ] ; then 141 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 142 | # IBM's JDK on AIX uses strange locations for the executables 143 | JAVACMD="$JAVA_HOME/jre/sh/java" 144 | else 145 | JAVACMD="$JAVA_HOME/bin/java" 146 | fi 147 | else 148 | JAVACMD="`which java`" 149 | fi 150 | fi 151 | 152 | if [ ! -x "$JAVACMD" ] ; then 153 | echo "Error: JAVA_HOME is not defined correctly." >&2 154 | echo " We cannot execute $JAVACMD" >&2 155 | exit 1 156 | fi 157 | 158 | if [ -z "$JAVA_HOME" ] ; then 159 | echo "Warning: JAVA_HOME environment variable is not set." 160 | fi 161 | 162 | CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher 163 | 164 | # traverses directory structure from process work directory to filesystem root 165 | # first directory with .mvn subdirectory is considered project base directory 166 | find_maven_basedir() { 167 | 168 | if [ -z "$1" ] 169 | then 170 | echo "Path not specified to find_maven_basedir" 171 | return 1 172 | fi 173 | 174 | basedir="$1" 175 | wdir="$1" 176 | while [ "$wdir" != '/' ] ; do 177 | if [ -d "$wdir"/.mvn ] ; then 178 | basedir=$wdir 179 | break 180 | fi 181 | # workaround for JBEAP-8937 (on Solaris 10/Sparc) 182 | if [ -d "${wdir}" ]; then 183 | wdir=`cd "$wdir/.."; pwd` 184 | fi 185 | # end of workaround 186 | done 187 | echo "${basedir}" 188 | } 189 | 190 | # concatenates all lines of a file 191 | concat_lines() { 192 | if [ -f "$1" ]; then 193 | echo "$(tr -s '\n' ' ' < "$1")" 194 | fi 195 | } 196 | 197 | BASE_DIR=`find_maven_basedir "$(pwd)"` 198 | if [ -z "$BASE_DIR" ]; then 199 | exit 1; 200 | fi 201 | 202 | ########################################################################################## 203 | # Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 204 | # This allows using the maven wrapper in projects that prohibit checking in binary data. 205 | ########################################################################################## 206 | if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then 207 | if [ "$MVNW_VERBOSE" = true ]; then 208 | echo "Found .mvn/wrapper/maven-wrapper.jar" 209 | fi 210 | else 211 | if [ "$MVNW_VERBOSE" = true ]; then 212 | echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." 213 | fi 214 | if [ -n "$MVNW_REPOURL" ]; then 215 | jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 216 | else 217 | jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 218 | fi 219 | while IFS="=" read key value; do 220 | case "$key" in (wrapperUrl) jarUrl="$value"; break ;; 221 | esac 222 | done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" 223 | if [ "$MVNW_VERBOSE" = true ]; then 224 | echo "Downloading from: $jarUrl" 225 | fi 226 | wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" 227 | if $cygwin; then 228 | wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` 229 | fi 230 | 231 | if command -v wget > /dev/null; then 232 | if [ "$MVNW_VERBOSE" = true ]; then 233 | echo "Found wget ... using wget" 234 | fi 235 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then 236 | wget "$jarUrl" -O "$wrapperJarPath" 237 | else 238 | wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" 239 | fi 240 | elif command -v curl > /dev/null; then 241 | if [ "$MVNW_VERBOSE" = true ]; then 242 | echo "Found curl ... using curl" 243 | fi 244 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then 245 | curl -o "$wrapperJarPath" "$jarUrl" -f 246 | else 247 | curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f 248 | fi 249 | 250 | else 251 | if [ "$MVNW_VERBOSE" = true ]; then 252 | echo "Falling back to using Java to download" 253 | fi 254 | javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" 255 | # For Cygwin, switch paths to Windows format before running javac 256 | if $cygwin; then 257 | javaClass=`cygpath --path --windows "$javaClass"` 258 | fi 259 | if [ -e "$javaClass" ]; then 260 | if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then 261 | if [ "$MVNW_VERBOSE" = true ]; then 262 | echo " - Compiling MavenWrapperDownloader.java ..." 263 | fi 264 | # Compiling the Java class 265 | ("$JAVA_HOME/bin/javac" "$javaClass") 266 | fi 267 | if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then 268 | # Running the downloader 269 | if [ "$MVNW_VERBOSE" = true ]; then 270 | echo " - Running MavenWrapperDownloader.java ..." 271 | fi 272 | ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") 273 | fi 274 | fi 275 | fi 276 | fi 277 | ########################################################################################## 278 | # End of extension 279 | ########################################################################################## 280 | 281 | export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} 282 | if [ "$MVNW_VERBOSE" = true ]; then 283 | echo $MAVEN_PROJECTBASEDIR 284 | fi 285 | MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" 286 | 287 | # For Cygwin, switch paths to Windows format before running java 288 | if $cygwin; then 289 | [ -n "$M2_HOME" ] && 290 | M2_HOME=`cygpath --path --windows "$M2_HOME"` 291 | [ -n "$JAVA_HOME" ] && 292 | JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` 293 | [ -n "$CLASSPATH" ] && 294 | CLASSPATH=`cygpath --path --windows "$CLASSPATH"` 295 | [ -n "$MAVEN_PROJECTBASEDIR" ] && 296 | MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` 297 | fi 298 | 299 | # Provide a "standardized" way to retrieve the CLI args that will 300 | # work with both Windows and non-Windows executions. 301 | MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" 302 | export MAVEN_CMD_LINE_ARGS 303 | 304 | WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 305 | 306 | exec "$JAVACMD" \ 307 | $MAVEN_OPTS \ 308 | -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ 309 | "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ 310 | ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" 311 | -------------------------------------------------------------------------------- /mvnw.cmd: -------------------------------------------------------------------------------- 1 | @REM ---------------------------------------------------------------------------- 2 | @REM Licensed to the Apache Software Foundation (ASF) under one 3 | @REM or more contributor license agreements. See the NOTICE file 4 | @REM distributed with this work for additional information 5 | @REM regarding copyright ownership. The ASF licenses this file 6 | @REM to you under the Apache License, Version 2.0 (the 7 | @REM "License"); you may not use this file except in compliance 8 | @REM with the License. You may obtain a copy of the License at 9 | @REM 10 | @REM http://www.apache.org/licenses/LICENSE-2.0 11 | @REM 12 | @REM Unless required by applicable law or agreed to in writing, 13 | @REM software distributed under the License is distributed on an 14 | @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | @REM KIND, either express or implied. See the License for the 16 | @REM specific language governing permissions and limitations 17 | @REM under the License. 18 | @REM ---------------------------------------------------------------------------- 19 | 20 | @REM ---------------------------------------------------------------------------- 21 | @REM Maven Start Up Batch script 22 | @REM 23 | @REM Required ENV vars: 24 | @REM JAVA_HOME - location of a JDK home dir 25 | @REM 26 | @REM Optional ENV vars 27 | @REM M2_HOME - location of maven2's installed home dir 28 | @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands 29 | @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending 30 | @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven 31 | @REM e.g. to debug Maven itself, use 32 | @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 33 | @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files 34 | @REM ---------------------------------------------------------------------------- 35 | 36 | @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' 37 | @echo off 38 | @REM set title of command window 39 | title %0 40 | @REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' 41 | @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% 42 | 43 | @REM set %HOME% to equivalent of $HOME 44 | if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") 45 | 46 | @REM Execute a user defined script before this one 47 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre 48 | @REM check for pre script, once with legacy .bat ending and once with .cmd ending 49 | if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" 50 | if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" 51 | :skipRcPre 52 | 53 | @setlocal 54 | 55 | set ERROR_CODE=0 56 | 57 | @REM To isolate internal variables from possible post scripts, we use another setlocal 58 | @setlocal 59 | 60 | @REM ==== START VALIDATION ==== 61 | if not "%JAVA_HOME%" == "" goto OkJHome 62 | 63 | echo. 64 | echo Error: JAVA_HOME not found in your environment. >&2 65 | echo Please set the JAVA_HOME variable in your environment to match the >&2 66 | echo location of your Java installation. >&2 67 | echo. 68 | goto error 69 | 70 | :OkJHome 71 | if exist "%JAVA_HOME%\bin\java.exe" goto init 72 | 73 | echo. 74 | echo Error: JAVA_HOME is set to an invalid directory. >&2 75 | echo JAVA_HOME = "%JAVA_HOME%" >&2 76 | echo Please set the JAVA_HOME variable in your environment to match the >&2 77 | echo location of your Java installation. >&2 78 | echo. 79 | goto error 80 | 81 | @REM ==== END VALIDATION ==== 82 | 83 | :init 84 | 85 | @REM Find the project base dir, i.e. the directory that contains the folder ".mvn". 86 | @REM Fallback to current working directory if not found. 87 | 88 | set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% 89 | IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir 90 | 91 | set EXEC_DIR=%CD% 92 | set WDIR=%EXEC_DIR% 93 | :findBaseDir 94 | IF EXIST "%WDIR%"\.mvn goto baseDirFound 95 | cd .. 96 | IF "%WDIR%"=="%CD%" goto baseDirNotFound 97 | set WDIR=%CD% 98 | goto findBaseDir 99 | 100 | :baseDirFound 101 | set MAVEN_PROJECTBASEDIR=%WDIR% 102 | cd "%EXEC_DIR%" 103 | goto endDetectBaseDir 104 | 105 | :baseDirNotFound 106 | set MAVEN_PROJECTBASEDIR=%EXEC_DIR% 107 | cd "%EXEC_DIR%" 108 | 109 | :endDetectBaseDir 110 | 111 | IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig 112 | 113 | @setlocal EnableExtensions EnableDelayedExpansion 114 | for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a 115 | @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% 116 | 117 | :endReadAdditionalConfig 118 | 119 | SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" 120 | set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" 121 | set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 122 | 123 | set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 124 | 125 | FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( 126 | IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B 127 | ) 128 | 129 | @REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 130 | @REM This allows using the maven wrapper in projects that prohibit checking in binary data. 131 | if exist %WRAPPER_JAR% ( 132 | if "%MVNW_VERBOSE%" == "true" ( 133 | echo Found %WRAPPER_JAR% 134 | ) 135 | ) else ( 136 | if not "%MVNW_REPOURL%" == "" ( 137 | SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 138 | ) 139 | if "%MVNW_VERBOSE%" == "true" ( 140 | echo Couldn't find %WRAPPER_JAR%, downloading it ... 141 | echo Downloading from: %DOWNLOAD_URL% 142 | ) 143 | 144 | powershell -Command "&{"^ 145 | "$webclient = new-object System.Net.WebClient;"^ 146 | "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ 147 | "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ 148 | "}"^ 149 | "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ 150 | "}" 151 | if "%MVNW_VERBOSE%" == "true" ( 152 | echo Finished downloading %WRAPPER_JAR% 153 | ) 154 | ) 155 | @REM End of extension 156 | 157 | @REM Provide a "standardized" way to retrieve the CLI args that will 158 | @REM work with both Windows and non-Windows executions. 159 | set MAVEN_CMD_LINE_ARGS=%* 160 | 161 | %MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* 162 | if ERRORLEVEL 1 goto error 163 | goto end 164 | 165 | :error 166 | set ERROR_CODE=1 167 | 168 | :end 169 | @endlocal & set ERROR_CODE=%ERROR_CODE% 170 | 171 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost 172 | @REM check for post script, once with legacy .bat ending and once with .cmd ending 173 | if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" 174 | if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" 175 | :skipRcPost 176 | 177 | @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' 178 | if "%MAVEN_BATCH_PAUSE%" == "on" pause 179 | 180 | if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% 181 | 182 | exit /B %ERROR_CODE% 183 | -------------------------------------------------------------------------------- /scripts/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ./mvnw clean install -B -Pdocs ${@} 4 | #./mvnw clean install -B -DskipTests ${@} 5 | -------------------------------------------------------------------------------- /scripts/sync_mvnw.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Either clones or pulls the repo for given project 6 | # Params: 7 | # $1 organization e.g. spring-cloud 8 | # $2 repo name e.g. spring-cloud-sleuth 9 | function clone_or_pull() { 10 | if [ "$#" -ne 2 ] 11 | then 12 | echo "You haven't provided 2 args... \$1 organization e.g. spring-cloud; \$2 repo name e.g. spring-cloud-sleuth" 13 | exit 1 14 | fi 15 | if [[ "${JUST_PUSH}" == "yes" ]] ; then 16 | echo "Skipping cloning since the option to just push was provided" 17 | exit 0 18 | fi 19 | local ORGANIZATION=$1 20 | local REPO_NAME=$2 21 | local LOCALREPO_VC_DIR=${REPO_NAME}/.git 22 | if [ ! -d ${LOCALREPO_VC_DIR} ] 23 | then 24 | echo "Repo [${REPO_NAME}] doesn't exist - will clone it!" 25 | git clone git@github.com:${ORGANIZATION}/${REPO_NAME}.git 26 | else 27 | echo "Repo [${REPO_NAME}] exists - will pull the changes" 28 | cd ${REPO_NAME} && git pull || echo "Not pulling since repo is up to date" 29 | cd ${ROOT_FOLDER} 30 | fi 31 | } 32 | 33 | # For the given branch updates the docs/src/main/asciidoc/ghpages.sh 34 | # with the one from spring-cloud-build. Then commits and pushes the change 35 | # Params: 36 | # $1 repo name e.g. spring-cloud-sleuth 37 | # $2 branch name 38 | function update_mvnw_script() { 39 | if [ "$#" -ne 2 ] 40 | then 41 | echo "You haven't provided 2 args... \$1 repo name e.g. spring-cloud-sleuth; \$2 branch name e.g. master" 42 | exit 1 43 | fi 44 | local REPO_NAME=$1 45 | local BRANCH_NAME=$2 46 | echo "Updating ghpages script for [${REPO_NAME}] and branch [${BRANCH_NAME}]" 47 | cd ${REPO_NAME} 48 | echo "Checking out [${BRANCH_NAME}]" 49 | git checkout ${BRANCH_NAME} 50 | echo "Resetting the repo and pulling before commiting" 51 | git reset --hard origin/${BRANCH_NAME} && git pull origin ${BRANCH_NAME} 52 | # If the user wants to just push we will not copy / add / commit files 53 | if [[ "${JUST_PUSH}" != "yes" ]] ; then 54 | echo "Copying [${MVNW_LOCATION}] to [${MVNW_IN_REPO_PATH}]" 55 | cp -rf ${MVNW_LOCATION} ${MVNW_IN_REPO_PATH} 56 | echo "Adding and committing [${MVNW_IN_REPO_PATH}] with message [${COMMIT_MESSAGE}]" 57 | git add ${MVNW_IN_REPO_PATH} 58 | git commit -m "${COMMIT_MESSAGE}" || echo "Proceeding to the next repo" 59 | fi 60 | if [[ "${AUTO_PUSH}" == "yes" ]] ; then 61 | echo "Pushing the branch [${BRANCH_NAME}]" 62 | wait_if_manual_proceed 63 | git push origin ${BRANCH_NAME} 64 | fi 65 | cd ${ROOT_FOLDER} 66 | } 67 | 68 | # Either clones or pulls the repo for given project and then updates gh-pages for the given project 69 | # Params: 70 | # $1 organization e.g. spring-cloud 71 | # $2 repo name e.g. spring-cloud-sleuth 72 | # $3 branch name e.g. master 73 | function clone_and_update_mvnw() { 74 | if [ "$#" -ne 3 ] 75 | then 76 | echo "You haven't provided 3 args... \$1 organization e.g. spring-cloud; \$2 repo name e.g. spring-cloud-sleuth; \$3 branch name e.g. master" 77 | exit 1 78 | fi 79 | local ORGANIZATION=$1 80 | local REPO_NAME=$2 81 | local BRANCH_NAME=$3 82 | local VAR 83 | echo -e "\n\nWill clone the repo and update scripts for org [${ORGANIZATION}], repo [${REPO_NAME}] and branch [${BRANCH_NAME}]\n\n" 84 | clone_or_pull ${ORGANIZATION} ${REPO_NAME} 85 | update_mvnw_script ${REPO_NAME} ${BRANCH_NAME} 86 | echo "Proceeding to next project" 87 | wait_if_manual_proceed 88 | } 89 | 90 | function wait_if_manual_proceed() { 91 | if [[ "${AUTO_PROCEED}" != "yes" ]] ; then 92 | echo -n "Press [ENTER] to continue..." 93 | read VAR 94 | fi 95 | } 96 | 97 | # Prints the provided parameters 98 | function print_parameters() { 99 | cat < 0 ]] 144 | do 145 | key="$1" 146 | case ${key} in 147 | -p|--nopush) 148 | AUTO_PUSH="no" 149 | ;; 150 | -m|--manualproceed) 151 | AUTO_PROCEED="no" 152 | ;; 153 | -x|--justpush) 154 | JUST_PUSH="yes" 155 | ;; 156 | -f|--file) 157 | MVNW_LOCATION="$2" 158 | shift 159 | ;; 160 | -h|--help) 161 | print_usage 162 | exit 0 163 | ;; 164 | *) 165 | echo "Invalid option: [$1]" 166 | print_usage 167 | exit 1 168 | ;; 169 | esac 170 | shift # past argument or value 171 | done 172 | 173 | export COMMIT_MESSAGE=${COMMIT_MESSAGE:-Updating mvnw for all projects} 174 | export MVNW_IN_REPO_PATH=${MVNW_IN_REPO_PATH:-mvnw} 175 | export MVNW_LOCATION=${MVNW_LOCATION:-`pwd`/mvnw} 176 | export AUTO_PROCEED=${AUTO_PROCEED:-yes} 177 | export AUTO_PUSH=${AUTO_PUSH:-yes} 178 | export JUST_PUSH=${JUST_PUSH:-no} 179 | export ROOT_FOLDER=`pwd` 180 | 181 | 182 | print_parameters 183 | if [[ ! -f "${MVNW_LOCATION}" ]]; then 184 | echo -e "\n\nWARNING: In order to run the script you need to have the mvnw file present. You've provided [${MVNW_LOCATION}] and the file is missing." 185 | exit 1 186 | fi 187 | clone_and_update_mvnw spring-cloud spring-cloud-aws master 188 | clone_and_update_mvnw spring-cloud spring-cloud-aws 1.0.x 189 | clone_and_update_mvnw spring-cloud spring-cloud-aws 1.2.x 190 | clone_and_update_mvnw spring-cloud spring-cloud-bus master 191 | clone_and_update_mvnw spring-cloud spring-cloud-cli 1.0.x 192 | clone_and_update_mvnw spring-cloud spring-cloud-cli 1.1.x 193 | clone_and_update_mvnw spring-cloud spring-cloud-cli master 194 | clone_and_update_mvnw spring-cloud spring-cloud-cloudfoundry master 195 | clone_and_update_mvnw spring-cloud spring-cloud-cluster master 196 | clone_and_update_mvnw spring-cloud spring-cloud-commons master 197 | clone_and_update_mvnw spring-cloud spring-cloud-config master 198 | clone_and_update_mvnw spring-cloud spring-cloud-config 1.1.x 199 | clone_and_update_mvnw spring-cloud spring-cloud-consul 1.0.x 200 | clone_and_update_mvnw spring-cloud spring-cloud-consul master 201 | clone_and_update_mvnw spring-cloud spring-cloud-contract master 202 | clone_and_update_mvnw spring-cloud spring-cloud-netflix 1.0.x 203 | clone_and_update_mvnw spring-cloud spring-cloud-netflix 1.1.x 204 | clone_and_update_mvnw spring-cloud spring-cloud-netflix master 205 | clone_and_update_mvnw spring-cloud spring-cloud-security master 206 | clone_and_update_mvnw spring-cloud spring-cloud-sleuth 1.0.x 207 | clone_and_update_mvnw spring-cloud spring-cloud-sleuth master 208 | clone_and_update_mvnw spring-cloud spring-cloud-starters Brixton 209 | clone_and_update_mvnw spring-cloud spring-cloud-starters master 210 | clone_and_update_mvnw spring-cloud-incubator spring-cloud-vault-config master 211 | clone_and_update_mvnw spring-cloud spring-cloud-zookeeper master 212 | -------------------------------------------------------------------------------- /spring-cloud-build-dependencies/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | org.springframework.cloud 7 | spring-cloud-build-dependencies 8 | 4.3.1-SNAPSHOT 9 | spring-cloud-build-dependencies 10 | pom 11 | Spring Cloud Build Dependencies: an internal BOM for use with Spring 12 | Cloud projects. Use as a BOM or by inheriting from the spring-cloud build parent. 13 | 14 | 15 | org.springframework.boot 16 | spring-boot-dependencies 17 | 3.5.0 18 | 19 | 20 | 21 | UTF-8 22 | 3.5.0 23 | 4.12.0 24 | 3.0.1 25 | 26 | 27 | 28 | 29 | 30 | com.squareup.okhttp3 31 | okhttp-bom 32 | ${okhttp.version} 33 | pom 34 | import 35 | 36 | 37 | 38 | 39 | 40 | 41 | org.codehaus.mojo 42 | flatten-maven-plugin 43 | false 44 | 45 | 46 | 47 | flatten 48 | process-resources 49 | 50 | flatten 51 | 52 | 53 | true 54 | bom 55 | 56 | expand 57 | keep 58 | keep 59 | remove 60 | 61 | 62 | 63 | 64 | flatten-clean 65 | clean 66 | 67 | clean 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | https://github.com/spring-cloud 76 | 77 | spring-docs 78 | 79 | https:/docs.spring.io/${project.artifactId}/docs/${project.version}/reference/html/ 80 | 81 | 82 | 83 | repo.spring.io 84 | Spring Release Repository 85 | https://repo.spring.io/libs-release-local 86 | 87 | 88 | repo.spring.io 89 | Spring Snapshot Repository 90 | https://repo.spring.io/libs-snapshot-local 91 | 92 | 93 | 94 | 95 | milestone 96 | 97 | 98 | repo.spring.io 99 | Spring Milestone Repository 100 | https://repo.spring.io/libs-milestone-local 101 | 102 | 103 | 104 | 105 | central 106 | 107 | 108 | sonatype-nexus-snapshots 109 | Sonatype Nexus Snapshots 110 | https://s01.oss.sonatype.org/content/repositories/snapshots 111 | 112 | 113 | sonatype-nexus-staging 114 | Nexus Release Repository 115 | https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ 116 | 117 | 118 | 119 | 120 | 121 | 122 | org.apache.maven.plugins 123 | maven-gpg-plugin 124 | ${maven-gpg-plugin.version} 125 | 126 | 127 | sign-artifacts 128 | verify 129 | 130 | sign 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | spring 140 | 141 | 142 | spring-snapshots 143 | Spring Snapshots 144 | https://repo.spring.io/snapshot 145 | 146 | true 147 | 148 | 149 | 150 | spring-milestones 151 | Spring Milestones 152 | https://repo.spring.io/milestone 153 | 154 | false 155 | 156 | 157 | 158 | 159 | 160 | spring-snapshots 161 | Spring Snapshots 162 | https://repo.spring.io/snapshot 163 | 164 | true 165 | 166 | 167 | 168 | spring-milestones 169 | Spring Milestones 170 | https://repo.spring.io/milestone 171 | 172 | false 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | -------------------------------------------------------------------------------- /spring-cloud-build-tools/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | spring-cloud-build-tools 7 | spring-cloud-build-tools 8 | jar 9 | Spring Cloud Build Tools 10 | 11 | org.springframework.cloud 12 | spring-cloud-build 13 | 4.3.1-SNAPSHOT 14 | 15 | 16 | 17 | com.puppycrawl.tools 18 | checkstyle 19 | ${puppycrawl-tools-checkstyle.version} 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /spring-cloud-build-tools/src/checkstyle/checkstyle-suppressions.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /spring-cloud-build-tools/src/checkstyle/nohttp-checkstyle.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 29 | -------------------------------------------------------------------------------- /spring-cloud-build-tools/src/main/resources/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 | -------------------------------------------------------------------------------- /spring-cloud-build-tools/src/main/resources/checkstyle-header.txt: -------------------------------------------------------------------------------- 1 | ^\Q/*\E$ 2 | ^\Q * Copyright \E20\d\d\-20\d\d\Q the original author or authors.\E$ 3 | ^\Q *\E$ 4 | ^\Q * Licensed under the Apache License, Version 2.0 (the "License");\E$ 5 | ^\Q * you may not use this file except in compliance with the License.\E$ 6 | ^\Q * You may obtain a copy of the License at\E$ 7 | ^\Q *\E$ 8 | ^\Q * https://www.apache.org/licenses/LICENSE-2.0\E$ 9 | ^\Q *\E$ 10 | ^\Q * Unless required by applicable law or agreed to in writing, software\E$ 11 | ^\Q * distributed under the License is distributed on an "AS IS" BASIS,\E$ 12 | ^\Q * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\E$ 13 | ^\Q * See the License for the specific language governing permissions and\E$ 14 | ^\Q * limitations under the License.\E$ 15 | ^\Q */\E$ 16 | ^$ 17 | ^.*$ 18 | -------------------------------------------------------------------------------- /spring-cloud-build-tools/src/main/resources/checkstyle.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 135 | 136 | 137 | 138 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 158 | 159 | 160 | 167 | 168 | 169 | 171 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 207 | 208 | 209 | 210 | 211 | -------------------------------------------------------------------------------- /spring-cloud-build-tools/src/main/resources/intellij/Intellij_Project_Defaults.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /spring-cloud-build-tools/src/main/resources/intellij/Intellij_Spring_Boot_Java_Conventions.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | -------------------------------------------------------------------------------- /spring-cloud-dependencies-parent/Guardfile: -------------------------------------------------------------------------------- 1 | require 'asciidoctor' 2 | require 'erb' 3 | 4 | options = {:mkdirs => true, :safe => :unsafe, :attributes => 'linkcss'} 5 | 6 | guard 'shell' do 7 | watch(/^[A-Za-z].*\.adoc$/) {|m| 8 | Asciidoctor.load_file('src/main/asciidoc/README.adoc', :to_file => './README.adoc', safe: :safe, parse: false) 9 | Asciidoctor.render_file('src/main/asciidoc/spring-cloud-build.adoc', options.merge(:to_dir => 'target/generated-docs')) 10 | Asciidoctor.render_file('src/main/asciidoc/building.adoc', options.merge(:to_dir => 'target/generated-docs')) 11 | } 12 | end 13 | -------------------------------------------------------------------------------- /spring-cloud-dependencies-parent/README.adoc: -------------------------------------------------------------------------------- 1 | // Do not edit this file (e.g. go instead to src/main/asciidoc) 2 | 3 | Spring Cloud Build is a common utility project for Spring Cloud 4 | to use for plugin and dependency management. 5 | -------------------------------------------------------------------------------- /spring-cloud-dependencies-parent/eclipse-code-formatter.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 9 | 12 | 15 | 18 | 20 | 23 | 25 | 28 | 31 | 32 | 35 | 38 | 41 | 44 | 46 | 47 | 49 | 52 | 55 | 58 | 61 | 63 | 65 | 66 | 68 | 70 | 71 | 73 | 76 | 79 | 82 | 84 | 86 | 87 | 90 | 93 | 96 | 99 | 101 | 104 | 107 | 109 | 111 | 113 | 116 | 119 | 122 | 125 | 128 | 131 | 134 | 137 | 140 | 141 | 144 | 146 | 148 | 151 | 154 | 157 | 160 | 163 | 164 | 166 | 167 | 170 | 173 | 176 | 179 | 182 | 185 | 188 | 191 | 193 | 196 | 199 | 201 | 204 | 207 | 209 | 211 | 214 | 217 | 220 | 223 | 226 | 229 | 232 | 234 | 237 | 239 | 242 | 244 | 245 | 248 | 251 | 254 | 256 | 259 | 262 | 265 | 268 | 270 | 273 | 276 | 279 | 282 | 285 | 288 | 290 | 292 | 295 | 298 | 300 | 302 | 304 | 307 | 309 | 312 | 315 | 318 | 321 | 324 | 326 | 329 | 331 | 332 | 334 | 337 | 340 | 343 | 346 | 349 | 351 | 354 | 357 | 359 | 362 | 365 | 368 | 370 | 372 | 375 | 376 | 379 | 382 | 385 | 387 | 390 | 392 | 393 | 396 | 399 | 402 | 405 | 408 | 411 | 413 | 415 | 418 | 421 | 424 | 425 | 428 | 431 | 432 | 435 | 438 | 441 | 444 | 446 | 449 | 452 | 455 | 456 | 458 | 461 | 464 | 465 | 468 | 471 | 474 | 477 | 478 | 480 | 483 | 486 | 488 | 491 | 494 | 495 | 498 | 501 | 502 | 503 | 506 | 508 | 511 | 513 | 516 | 519 | 522 | 525 | 528 | 531 | 533 | 535 | 538 | 541 | 544 | 547 | 550 | 553 | 556 | 559 | 561 | 563 | 566 | 569 | 572 | 575 | 578 | 581 | 583 | 586 | 589 | 591 | 593 | 596 | 599 | 602 | 604 | 606 | 609 | 611 | 614 | 617 | 620 | 623 | 625 | 628 | 631 | 633 | 635 | 638 | 640 | 642 | 644 | 647 | 650 | 653 | 654 | 657 | 660 | 663 | 666 | 668 | 671 | 674 | 677 | 680 | 682 | 685 | 687 | 689 | 691 | 694 | 697 | 700 | 703 | 706 | 709 | 712 | 715 | 718 | 721 | 723 | 726 | 729 | 730 | 733 | 736 | 738 | 741 | 742 | 745 | 747 | 748 | 751 | 754 | 755 | 756 | -------------------------------------------------------------------------------- /spring-cloud-dependencies-parent/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | org.springframework.cloud 7 | 4.3.1-SNAPSHOT 8 | spring-cloud-dependencies-parent 9 | pom 10 | spring-cloud-dependencies-parent 11 | Spring Cloud Build Dependencies 12 | https://projects.spring.io/spring-cloud/ 13 | 14 | Pivotal Software, Inc. 15 | https://www.spring.io 16 | 17 | 18 | 19 | Apache License, Version 2.0 20 | https://www.apache.org/licenses/LICENSE-2.0 21 | 22 | Copyright 2014-2021 the original author or authors. 23 | 24 | Licensed under the Apache License, Version 2.0 (the "License"); 25 | you may not use this file except in compliance with the License. 26 | You may obtain a copy of the License at 27 | 28 | https://www.apache.org/licenses/LICENSE-2.0 29 | 30 | Unless required by applicable law or agreed to in writing, software 31 | distributed under the License is distributed on an "AS IS" BASIS, 32 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 33 | implied. 34 | 35 | See the License for the specific language governing permissions and 36 | limitations under the License. 37 | 38 | 39 | 40 | 41 | https://github.com/spring-cloud/spring-cloud-build 42 | scm:git:git://github.com/spring-cloud/spring-cloud-build.git 43 | 44 | 45 | scm:git:ssh://git@github.com/spring-cloud/spring-cloud-build.git 46 | 47 | HEAD 48 | 49 | 50 | 51 | dsyer 52 | Dave Syer 53 | dsyer at pivotal.io 54 | Pivotal Software, Inc. 55 | https://www.spring.io 56 | 57 | Project lead 58 | 59 | 60 | 61 | sgibb 62 | Spencer Gibb 63 | sgibb at pivotal.io 64 | Pivotal Software, Inc. 65 | https://www.spring.io 66 | 67 | Project lead 68 | 69 | 70 | 71 | 72 | UTF-8 73 | 74 | 75 | https://github.com/spring-cloud 76 | 77 | spring-docs 78 | 79 | https:/docs.spring.io/${project.artifactId}/docs/${project.version}/reference/html/ 80 | 81 | 82 | 83 | repo.spring.io 84 | Spring Release Repository 85 | https://repo.spring.io/libs-release-local 86 | 87 | 88 | repo.spring.io 89 | Spring Snapshot Repository 90 | https://repo.spring.io/libs-snapshot-local 91 | 92 | 93 | 94 | 95 | milestone 96 | 97 | 98 | repo.spring.io 99 | Spring Milestone Repository 100 | https://repo.spring.io/libs-milestone-local 101 | 102 | 103 | 104 | 105 | central 106 | 107 | 108 | sonatype-nexus-snapshots 109 | Sonatype Nexus Snapshots 110 | https://s01.oss.sonatype.org/content/repositories/snapshots 111 | 112 | 113 | sonatype-nexus-staging 114 | Nexus Release Repository 115 | https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ 116 | 117 | 118 | 119 | 120 | 121 | 122 | org.codehaus.mojo 123 | flatten-maven-plugin 124 | true 125 | 126 | 127 | 128 | flatten 129 | process-resources 130 | 131 | flatten 132 | 133 | 134 | true 135 | bom 136 | 137 | expand 138 | keep 139 | keep 140 | remove 141 | keep 142 | 143 | 144 | 145 | 146 | flatten-clean 147 | clean 148 | 149 | clean 150 | 151 | 152 | 153 | 154 | 155 | org.apache.maven.plugins 156 | maven-gpg-plugin 157 | 1.6 158 | 159 | 160 | sign-artifacts 161 | verify 162 | 163 | sign 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | spring 173 | 174 | 175 | spring-snapshots 176 | Spring Snapshots 177 | https://repo.spring.io/snapshot 178 | 179 | true 180 | 181 | 182 | 183 | spring-milestones 184 | Spring Milestones 185 | https://repo.spring.io/milestone 186 | 187 | false 188 | 189 | 190 | 191 | 192 | 193 | spring-snapshots 194 | Spring Snapshots 195 | https://repo.spring.io/snapshot 196 | 197 | true 198 | 199 | 200 | 201 | spring-milestones 202 | Spring Milestones 203 | https://repo.spring.io/milestone 204 | 205 | false 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | org.apache.maven.plugins 216 | maven-enforcer-plugin 217 | ${maven-enforcer-plugin.version} 218 | 219 | 220 | enforce-versions 221 | 222 | enforce 223 | 224 | 225 | 226 | 227 | false 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | --------------------------------------------------------------------------------