├── .nvmrc ├── .mvn ├── jvm.config ├── maven.config ├── extensions.xml └── wrapper │ ├── maven-wrapper.properties │ └── MavenWrapperDownloader.java ├── src ├── test │ └── resources │ │ └── projects │ │ └── it1 │ │ ├── goal.txt │ │ └── archetype.properties └── main │ └── resources │ ├── archetype-resources │ ├── README.md │ ├── src │ │ ├── test │ │ │ └── java │ │ │ │ ├── BadCase.java │ │ │ │ ├── GoodCase.java │ │ │ │ └── MyDetectorTest.java │ │ └── main │ │ │ ├── resources │ │ │ ├── findbugs.xml │ │ │ └── messages.xml │ │ │ └── java │ │ │ └── MyDetector.java │ └── pom.xml │ └── META-INF │ └── maven │ └── archetype-metadata.xml ├── .gitattributes ├── renovate.json ├── package.json ├── README.md ├── .github └── workflows │ └── build.yml ├── pom.xml ├── target ├── classes │ └── archetype-resources │ │ └── pom.xml └── test-classes │ └── projects │ └── it1 │ └── project │ └── basic-integration-test │ └── pom.xml ├── .gitignore ├── CHANGELOG.md ├── mvnw.cmd ├── LICENSE └── mvnw /.nvmrc: -------------------------------------------------------------------------------- 1 | 24 2 | -------------------------------------------------------------------------------- /.mvn/jvm.config: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/test/resources/projects/it1/goal.txt: -------------------------------------------------------------------------------- 1 | verify 2 | -------------------------------------------------------------------------------- /src/main/resources/archetype-resources/README.md: -------------------------------------------------------------------------------- 1 | # My SpotBugs plugin 2 | -------------------------------------------------------------------------------- /.mvn/maven.config: -------------------------------------------------------------------------------- 1 | -Daether.checksums.algorithms=SHA-512,SHA-256,SHA-1,MD5 2 | -Daether.connector.smartChecksums=false 3 | --no-transfer-progress 4 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | mvnw linguist-generated=true 2 | mvnw.cmd linguist-generated=true 3 | .mvn/wrapper/MavenWrapperDownloader.java linguist-generated=true 4 | -------------------------------------------------------------------------------- /src/test/resources/projects/it1/archetype.properties: -------------------------------------------------------------------------------- 1 | groupId=com.github.spotbugs 2 | artifactId=basic-integration-test 3 | package=com.github.spotbugs.test 4 | version=1.0.0 5 | -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "extends": [ 4 | "config:recommended", 5 | "helpers:pinGitHubActionDigests" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /src/main/resources/archetype-resources/src/test/java/BadCase.java: -------------------------------------------------------------------------------- 1 | package ${package}; 2 | 3 | class BadCase { 4 | void method() { 5 | System.out.println("Hello SpotBugs!"); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/main/resources/archetype-resources/src/test/java/GoodCase.java: -------------------------------------------------------------------------------- 1 | package ${package}; 2 | 3 | class GoodCase { 4 | void method() { 5 | System.err.println("Hello SpotBugs!"); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | fr.jcgay.maven 5 | maven-profiler 6 | 3.3 7 | 8 | 9 | -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionType=source 2 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.12/apache-maven-3.9.12-bin.zip 3 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.3.4/maven-wrapper-3.3.4.jar 4 | wrapperVersion=3.3.4 5 | -------------------------------------------------------------------------------- /src/main/resources/archetype-resources/src/main/resources/findbugs.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "devDependencies": { 3 | "@semantic-release/changelog": "6.0.3", 4 | "@semantic-release/git": "10.0.1", 5 | "@terrestris/maven-semantic-release": "3.1.0", 6 | "semantic-release": "25.0.2" 7 | }, 8 | "release": { 9 | "tagFormat": "${version}", 10 | "plugins": [ 11 | "@semantic-release/commit-analyzer", 12 | "@semantic-release/release-notes-generator", 13 | "@semantic-release/changelog", 14 | [ 15 | "@terrestris/maven-semantic-release", 16 | { 17 | "mvnw": true, 18 | "settingsPath": "maven_settings.xml", 19 | "updateSnapshotVersion": true 20 | } 21 | ], 22 | "@semantic-release/github", 23 | [ 24 | "@semantic-release/git", 25 | { 26 | "assets": [ 27 | "pom.xml", 28 | "CHANGELOG.md" 29 | ] 30 | } 31 | ] 32 | ] 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/resources/META-INF/maven/archetype-metadata.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | src/main/java 7 | 8 | 9 | src/main/resources 10 | 11 | 12 | src/test/java 13 | 14 | 15 | 16 | 17 | README.md 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/main/resources/archetype-resources/src/main/java/MyDetector.java: -------------------------------------------------------------------------------- 1 | package ${package}; 2 | 3 | import org.apache.bcel.Const; 4 | 5 | import edu.umd.cs.findbugs.BugInstance; 6 | import edu.umd.cs.findbugs.BugReporter; 7 | import edu.umd.cs.findbugs.bcel.OpcodeStackDetector; 8 | 9 | public class MyDetector extends OpcodeStackDetector { 10 | private final BugReporter bugReporter; 11 | 12 | public MyDetector(BugReporter bugReporter) { 13 | this.bugReporter = bugReporter; 14 | } 15 | 16 | @Override 17 | public void sawOpcode(int seen) { 18 | if (seen != Const.GETSTATIC) { 19 | return; 20 | } 21 | if (getClassConstantOperand().equals("java/lang/System") 22 | && getNameConstantOperand().equals("out")) { 23 | // report bug when System.out is used in code 24 | BugInstance bug = new BugInstance(this, "MY_BUG", NORMAL_PRIORITY) 25 | .addClassAndMethod(this) 26 | .addSourceLine(this, getPC()); 27 | bugReporter.reportBug(bug); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/resources/archetype-resources/src/main/resources/messages.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | My SpotBugs Plugin 7 |
This plugin provides original detectors
8 |
9 | 10 | 11 |
12 | Original detector to detect MY_BUG bug pattern. 13 |
14 |
15 | 16 | 17 | Explain bug pattern shortly. 18 | 19 | Explain existing problem in code, and how developer should improve their implementation. 20 | 21 |
22 | Explain existing problem in code, and how developer should improve their implementation.

24 | ]]> 25 |
26 |
27 | 28 | My SpotBugs BugCode 29 |
30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Maven Archetype for SpotBugs Plugin project 2 | 3 | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.spotbugs/spotbugs-archetype/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.github.spotbugs/spotbugs-archetype) 4 | [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/) 5 | [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release) 6 | 7 | ## How to use 8 | 9 | ```sh 10 | $ mvn archetype:generate \ 11 | -DarchetypeArtifactId=spotbugs-archetype \ 12 | -DarchetypeGroupId=com.github.spotbugs \ 13 | -DarchetypeVersion=0.4.5 14 | ``` 15 | 16 | ## License 17 | 18 | Copyright 2017-2025 SpotBugs team 19 | 20 | Licensed under the Apache License, Version 2.0 (the "License"); 21 | you may not use this file except in compliance with the License. 22 | You may obtain a copy of the License at 23 | 24 | http://www.apache.org/licenses/LICENSE-2.0 25 | 26 | Unless required by applicable law or agreed to in writing, software 27 | distributed under the License is distributed on an "AS IS" BASIS, 28 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 29 | See the License for the specific language governing permissions and 30 | limitations under the License. 31 | -------------------------------------------------------------------------------- /src/main/resources/archetype-resources/src/test/java/MyDetectorTest.java: -------------------------------------------------------------------------------- 1 | package ${package}; 2 | 3 | import static edu.umd.cs.findbugs.test.CountMatcher.containsExactly; 4 | import static org.hamcrest.MatcherAssert.assertThat; 5 | 6 | import java.nio.file.Path; 7 | 8 | import org.junit.jupiter.api.extension.ExtendWith; 9 | import org.junit.jupiter.api.Test; 10 | 11 | import edu.umd.cs.findbugs.BugCollection; 12 | import edu.umd.cs.findbugs.test.matcher.BugInstanceMatcher; 13 | import edu.umd.cs.findbugs.test.matcher.BugInstanceMatcherBuilder; 14 | import edu.umd.cs.findbugs.test.SpotBugsExtension; 15 | import edu.umd.cs.findbugs.test.SpotBugsRunner; 16 | 17 | @ExtendWith(SpotBugsExtension.class) 18 | public class MyDetectorTest { 19 | 20 | @Test 21 | public void testGoodCase(SpotBugsRunner spotbugs) { 22 | Path path = Path.of("target/test-classes", "${package}".replace('.', '/'), "GoodCase.class"); 23 | BugCollection bugCollection = spotbugs.performAnalysis(path); 24 | 25 | BugInstanceMatcher bugTypeMatcher = new BugInstanceMatcherBuilder() 26 | .bugType("MY_BUG").build(); 27 | assertThat(bugCollection, containsExactly(0, bugTypeMatcher)); 28 | } 29 | 30 | @Test 31 | public void testBadCase(SpotBugsRunner spotbugs) { 32 | Path path = Path.of("target/test-classes", "${package}".replace('.', '/'), "BadCase.class"); 33 | BugCollection bugCollection = spotbugs.performAnalysis(path); 34 | 35 | BugInstanceMatcher bugTypeMatcher = new BugInstanceMatcherBuilder() 36 | .bugType("MY_BUG").build(); 37 | assertThat(bugCollection, containsExactly(1, bugTypeMatcher)); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | on: 2 | push: 3 | branches: 4 | - master 5 | pull_request: 6 | branches: 7 | - master 8 | 9 | permissions: 10 | contents: write 11 | 12 | concurrency: 13 | group: ${{ github.workflow }}-${{ github.ref }}-${{ github.sha }} 14 | cancel-in-progress: true 15 | 16 | jobs: 17 | build: 18 | runs-on: 'windows-latest' 19 | timeout-minutes: 30 20 | steps: 21 | - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 22 | with: 23 | fetch-depth: 0 24 | - uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e # v5 25 | with: 26 | cache: maven 27 | distribution: temurin 28 | java-version: 21 29 | server-id: central 30 | server-username: CI_DEPLOY_USERNAME 31 | server-password: CI_DEPLOY_PASSWORD 32 | gpg-private-key: ${{ secrets.SIGNING_KEY }} 33 | gpg-passphrase: ${{ secrets.SIGNING_PASSWORD }} 34 | - uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6 35 | with: 36 | node-version-file: '.nvmrc' 37 | - name: Verify with Maven 38 | if: github.repository_owner == 'spotbugs' && github.event_name == 'push' 39 | run: ./mvnw -B verify -D"org.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn" 40 | env: 41 | MAVEN_GPG_KEY_NAME: ${{ secrets.SIGNING_KEY }} 42 | MAVEN_GPG_PASSPHRASE: ${{ secrets.SIGNING_PASSWORD }} 43 | - name: Verify with Maven 44 | if: github.repository_owner != 'spotbugs' || (github.repository_owner == 'spotbugs' && github.event_name != 'push') 45 | run: ./mvnw -B verify -D"org.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn" -D"gpg.skip=true" 46 | - name: NPM CI 47 | run: npm ci 48 | - name: Copy Maven settings 49 | shell: bash 50 | run: cp ~/.m2/settings.xml ./maven_settings.xml 51 | - name: NPM Exec Semantic Release 52 | run: npm exec semantic-release 53 | env: 54 | CI_DEPLOY_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }} 55 | CI_DEPLOY_PASSWORD: ${{ secrets.CI_DEPLOY_PASSWORD }} 56 | MAVEN_GPG_KEY_NAME: ${{ secrets.SIGNING_KEY }} 57 | MAVEN_GPG_PASSPHRASE: ${{ secrets.SIGNING_PASSWORD }} 58 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 59 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | com.github.spotbugs 6 | spotbugs-archetype 7 | SpotBugs Maven Archetype 8 | 0.4.14-SNAPSHOT 9 | maven-archetype 10 | 11 | https://github.com/spotbugs/spotbugs-archetype 12 | A Maven archetype for SpotBugs plugin project 13 | 14 | 15 | scm:git:git@github.com:spotbugs/spotbugs-archetype.git 16 | scm:git:git@github.com:spotbugs/spotbugs-archetype.git 17 | git@github.com:spotbugs/spotbugs-archetype.git 18 | 19 | 20 | 21 | 22 | central 23 | https://central.sonatype.com/repository/maven-snapshots/ 24 | 25 | 26 | 27 | 28 | 29 | KengoTODA 30 | Kengo TODA 31 | https://kengotoda.github.io/ 32 | 33 | 34 | 35 | 36 | Apache License, Version 2.0 37 | http://www.apache.org/licenses/LICENSE-2.0 38 | 39 | 40 | 41 | 42 | 11 43 | 3.4.1 44 | UTF-8 45 | 46 | 47 | 48 | 49 | 50 | org.apache.maven.archetype 51 | archetype-packaging 52 | ${mavenArchetypeVersion} 53 | 54 | 55 | 56 | 57 | 58 | maven-archetype-plugin 59 | ${mavenArchetypeVersion} 60 | 61 | 62 | 63 | 64 | 65 | maven-source-plugin 66 | 3.4.0 67 | 68 | 69 | attach-sources 70 | 71 | jar-no-fork 72 | 73 | 74 | 75 | 76 | 77 | maven-javadoc-plugin 78 | 3.12.0 79 | 80 | 81 | attach-javadocs 82 | 83 | jar 84 | 85 | 86 | 87 | 88 | 89 | maven-gpg-plugin 90 | 3.2.8 91 | 92 | 93 | sign-artifacts 94 | verify 95 | 96 | sign 97 | 98 | 99 | 100 | 101 | 102 | org.sonatype.central 103 | central-publishing-maven-plugin 104 | 0.9.0 105 | true 106 | 107 | true 108 | central 109 | published 110 | 111 | 112 | 113 | 114 | 115 | -------------------------------------------------------------------------------- /.mvn/wrapper/MavenWrapperDownloader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | import java.io.IOException; 21 | import java.io.InputStream; 22 | import java.net.Authenticator; 23 | import java.net.PasswordAuthentication; 24 | import java.net.URI; 25 | import java.net.URL; 26 | import java.nio.file.Files; 27 | import java.nio.file.Path; 28 | import java.nio.file.StandardCopyOption; 29 | import java.util.concurrent.ThreadLocalRandom; 30 | 31 | public final class MavenWrapperDownloader { 32 | private static final String WRAPPER_VERSION = "3.3.4"; 33 | 34 | private static final boolean VERBOSE = Boolean.parseBoolean(System.getenv("MVNW_VERBOSE")); 35 | 36 | public static void main(String[] args) { 37 | log("Apache Maven Wrapper Downloader " + WRAPPER_VERSION); 38 | 39 | if (args.length != 2) { 40 | System.err.println(" - ERROR wrapperUrl or wrapperJarPath parameter missing"); 41 | System.exit(1); 42 | } 43 | 44 | try { 45 | log(" - Downloader started"); 46 | final URL wrapperUrl = URI.create(args[0]).toURL(); 47 | final Path baseDir = Path.of(".").toAbsolutePath().normalize(); 48 | final Path wrapperJarPath = baseDir.resolve(args[1]).normalize(); 49 | if (!wrapperJarPath.startsWith(baseDir)) { 50 | throw new IOException("Invalid path: outside of allowed directory"); 51 | } 52 | downloadFileFromURL(wrapperUrl, wrapperJarPath); 53 | log("Done"); 54 | } catch (IOException e) { 55 | System.err.println("- Error downloading: " + e.getMessage()); 56 | if (VERBOSE) { 57 | e.printStackTrace(); 58 | } 59 | System.exit(1); 60 | } 61 | } 62 | 63 | private static void downloadFileFromURL(URL wrapperUrl, Path wrapperJarPath) 64 | throws IOException { 65 | log(" - Downloading to: " + wrapperJarPath); 66 | if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) { 67 | final String username = System.getenv("MVNW_USERNAME"); 68 | final char[] password = System.getenv("MVNW_PASSWORD").toCharArray(); 69 | Authenticator.setDefault(new Authenticator() { 70 | @Override 71 | protected PasswordAuthentication getPasswordAuthentication() { 72 | return new PasswordAuthentication(username, password); 73 | } 74 | }); 75 | } 76 | Path temp = wrapperJarPath 77 | .getParent() 78 | .resolve(wrapperJarPath.getFileName() + "." 79 | + Long.toUnsignedString(ThreadLocalRandom.current().nextLong()) + ".tmp"); 80 | try (InputStream inStream = wrapperUrl.openStream()) { 81 | Files.copy(inStream, temp, StandardCopyOption.REPLACE_EXISTING); 82 | Files.move(temp, wrapperJarPath, StandardCopyOption.REPLACE_EXISTING); 83 | } finally { 84 | Files.deleteIfExists(temp); 85 | } 86 | log(" - Downloader complete"); 87 | } 88 | 89 | private static void log(String msg) { 90 | if (VERBOSE) { 91 | System.out.println(msg); 92 | } 93 | } 94 | 95 | } 96 | -------------------------------------------------------------------------------- /target/classes/archetype-resources/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 4.0.0 5 | 6 | ${groupId} 7 | ${artifactId} 8 | ${version} 9 | 10 | 11 | 11 12 | UTF-8 13 | 4.9.8 14 | 15 | 16 | My SpotBugs plugin project 17 | 18 | 19 | 20 | org.junit 21 | junit-bom 22 | 6.0.1 23 | pom 24 | import 25 | 26 | 27 | 28 | 29 | 30 | org.ow2.asm 31 | asm 32 | 9.9.1 33 | provided 34 | 35 | 36 | com.github.spotbugs 37 | spotbugs 38 | ${spotBugsVersion} 39 | provided 40 | 41 | 42 | org.junit.jupiter 43 | junit-jupiter-engine 44 | test 45 | 46 | 47 | com.github.spotbugs 48 | test-harness 49 | ${spotBugsVersion} 50 | test 51 | 52 | 53 | com.github.spotbugs 54 | test-harness-jupiter 55 | ${spotBugsVersion} 56 | test 57 | 58 | 59 | org.hamcrest 60 | hamcrest 61 | 3.0 62 | test 63 | 64 | 65 | 66 | 67 | 68 | 69 | org.codehaus.mojo 70 | xml-maven-plugin 71 | 1.2.0 72 | 73 | 74 | validate-spotbugs-configuration 75 | 76 | validate 77 | 78 | 79 | 80 | 81 | ${project.basedir}/src/main/resources 82 | 83 | findbugs.xml 84 | 85 | findbugsplugin.xsd 86 | 87 | 88 | ${project.basedir}/src/main/resources 89 | 90 | messages.xml 91 | 92 | messagecollection.xsd 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | com.github.spotbugs 101 | spotbugs 102 | ${spotBugsVersion} 103 | 104 | 105 | 106 | 107 | maven-surefire-plugin 108 | 3.5.4 109 | 110 | 111 | maven-failsafe-plugin 112 | 3.5.4 113 | 114 | 115 | 116 | 117 | -------------------------------------------------------------------------------- /src/main/resources/archetype-resources/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 4.0.0 5 | 6 | ${groupId} 7 | ${artifactId} 8 | ${version} 9 | 10 | 11 | 11 12 | UTF-8 13 | 4.9.8 14 | 15 | 16 | My SpotBugs plugin project 17 | 18 | 19 | 20 | org.junit 21 | junit-bom 22 | 6.0.1 23 | pom 24 | import 25 | 26 | 27 | 28 | 29 | 30 | org.ow2.asm 31 | asm 32 | 9.9.1 33 | provided 34 | 35 | 36 | com.github.spotbugs 37 | spotbugs 38 | ${spotBugsVersion} 39 | provided 40 | 41 | 42 | org.junit.jupiter 43 | junit-jupiter-engine 44 | test 45 | 46 | 47 | com.github.spotbugs 48 | test-harness 49 | ${spotBugsVersion} 50 | test 51 | 52 | 53 | com.github.spotbugs 54 | test-harness-jupiter 55 | ${spotBugsVersion} 56 | test 57 | 58 | 59 | org.hamcrest 60 | hamcrest 61 | 3.0 62 | test 63 | 64 | 65 | 66 | 67 | 68 | 69 | org.codehaus.mojo 70 | xml-maven-plugin 71 | 1.2.0 72 | 73 | 74 | validate-spotbugs-configuration 75 | 76 | validate 77 | 78 | 79 | 80 | 81 | ${project.basedir}/src/main/resources 82 | 83 | findbugs.xml 84 | 85 | findbugsplugin.xsd 86 | 87 | 88 | ${project.basedir}/src/main/resources 89 | 90 | messages.xml 91 | 92 | messagecollection.xsd 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | com.github.spotbugs 101 | spotbugs 102 | ${spotBugsVersion} 103 | 104 | 105 | 106 | 107 | maven-surefire-plugin 108 | 3.5.4 109 | 110 | 111 | maven-failsafe-plugin 112 | 3.5.4 113 | 114 | 115 | 116 | 117 | -------------------------------------------------------------------------------- /target/test-classes/projects/it1/project/basic-integration-test/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 4.0.0 5 | 6 | com.github.spotbugs 7 | basic-integration-test 8 | 1.0.0 9 | 10 | 11 | 11 12 | UTF-8 13 | 4.9.8 14 | 15 | 16 | My SpotBugs plugin project 17 | 18 | 19 | 20 | org.junit 21 | junit-bom 22 | 6.0.1 23 | pom 24 | import 25 | 26 | 27 | 28 | 29 | 30 | org.ow2.asm 31 | asm 32 | 9.9.1 33 | provided 34 | 35 | 36 | com.github.spotbugs 37 | spotbugs 38 | ${spotBugsVersion} 39 | provided 40 | 41 | 42 | org.junit.jupiter 43 | junit-jupiter-engine 44 | test 45 | 46 | 47 | com.github.spotbugs 48 | test-harness 49 | ${spotBugsVersion} 50 | test 51 | 52 | 53 | com.github.spotbugs 54 | test-harness-jupiter 55 | ${spotBugsVersion} 56 | test 57 | 58 | 59 | org.hamcrest 60 | hamcrest 61 | 3.0 62 | test 63 | 64 | 65 | 66 | 67 | 68 | 69 | org.codehaus.mojo 70 | xml-maven-plugin 71 | 1.2.0 72 | 73 | 74 | validate-spotbugs-configuration 75 | 76 | validate 77 | 78 | 79 | 80 | 81 | ${project.basedir}/src/main/resources 82 | 83 | findbugs.xml 84 | 85 | findbugsplugin.xsd 86 | 87 | 88 | ${project.basedir}/src/main/resources 89 | 90 | messages.xml 91 | 92 | messagecollection.xsd 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | com.github.spotbugs 101 | spotbugs 102 | ${spotBugsVersion} 103 | 104 | 105 | 106 | 107 | maven-surefire-plugin 108 | 3.5.4 109 | 110 | 111 | maven-failsafe-plugin 112 | 3.5.4 113 | 114 | 115 | 116 | 117 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Created by https://www.toptal.com/developers/gitignore/api/node,maven,intellij,eclipse 3 | # Edit at https://www.toptal.com/developers/gitignore?templates=node,maven,intellij,eclipse 4 | 5 | ### Eclipse ### 6 | .metadata 7 | bin/ 8 | tmp/ 9 | *.tmp 10 | *.bak 11 | *.swp 12 | *~.nib 13 | local.properties 14 | .settings/ 15 | .loadpath 16 | .recommenders 17 | 18 | # External tool builders 19 | .externalToolBuilders/ 20 | 21 | # Locally stored "Eclipse launch configurations" 22 | *.launch 23 | 24 | # PyDev specific (Python IDE for Eclipse) 25 | *.pydevproject 26 | 27 | # CDT-specific (C/C++ Development Tooling) 28 | .cproject 29 | 30 | # CDT- autotools 31 | .autotools 32 | 33 | # Java annotation processor (APT) 34 | .factorypath 35 | 36 | # PDT-specific (PHP Development Tools) 37 | .buildpath 38 | 39 | # sbteclipse plugin 40 | .target 41 | 42 | # Tern plugin 43 | .tern-project 44 | 45 | # TeXlipse plugin 46 | .texlipse 47 | 48 | # STS (Spring Tool Suite) 49 | .springBeans 50 | 51 | # Code Recommenders 52 | .recommenders/ 53 | 54 | # Annotation Processing 55 | .apt_generated/ 56 | .apt_generated_test/ 57 | 58 | # Scala IDE specific (Scala & Java development for Eclipse) 59 | .cache-main 60 | .scala_dependencies 61 | .worksheet 62 | 63 | # Uncomment this line if you wish to ignore the project description file. 64 | # Typically, this file would be tracked if it contains build/dependency configurations: 65 | #.project 66 | 67 | ### Eclipse Patch ### 68 | # Spring Boot Tooling 69 | .sts4-cache/ 70 | 71 | ### Intellij ### 72 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider 73 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 74 | 75 | # User-specific stuff 76 | .idea/**/workspace.xml 77 | .idea/**/tasks.xml 78 | .idea/**/usage.statistics.xml 79 | .idea/**/dictionaries 80 | .idea/**/shelf 81 | 82 | # AWS User-specific 83 | .idea/**/aws.xml 84 | 85 | # Generated files 86 | .idea/**/contentModel.xml 87 | 88 | # Sensitive or high-churn files 89 | .idea/**/dataSources/ 90 | .idea/**/dataSources.ids 91 | .idea/**/dataSources.local.xml 92 | .idea/**/sqlDataSources.xml 93 | .idea/**/dynamic.xml 94 | .idea/**/uiDesigner.xml 95 | .idea/**/dbnavigator.xml 96 | 97 | # Gradle 98 | .idea/**/gradle.xml 99 | .idea/**/libraries 100 | 101 | # Gradle and Maven with auto-import 102 | # When using Gradle or Maven with auto-import, you should exclude module files, 103 | # since they will be recreated, and may cause churn. Uncomment if using 104 | # auto-import. 105 | # .idea/artifacts 106 | # .idea/compiler.xml 107 | # .idea/jarRepositories.xml 108 | # .idea/modules.xml 109 | # .idea/*.iml 110 | # .idea/modules 111 | # *.iml 112 | # *.ipr 113 | 114 | # CMake 115 | cmake-build-*/ 116 | 117 | # Mongo Explorer plugin 118 | .idea/**/mongoSettings.xml 119 | 120 | # File-based project format 121 | *.iws 122 | 123 | # IntelliJ 124 | out/ 125 | 126 | # mpeltonen/sbt-idea plugin 127 | .idea_modules/ 128 | 129 | # JIRA plugin 130 | atlassian-ide-plugin.xml 131 | 132 | # Cursive Clojure plugin 133 | .idea/replstate.xml 134 | 135 | # Crashlytics plugin (for Android Studio and IntelliJ) 136 | com_crashlytics_export_strings.xml 137 | crashlytics.properties 138 | crashlytics-build.properties 139 | fabric.properties 140 | 141 | # Editor-based Rest Client 142 | .idea/httpRequests 143 | 144 | # Android studio 3.1+ serialized cache file 145 | .idea/caches/build_file_checksums.ser 146 | 147 | ### Intellij Patch ### 148 | # Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 149 | 150 | # *.iml 151 | # modules.xml 152 | # .idea/misc.xml 153 | # *.ipr 154 | 155 | # Sonarlint plugin 156 | # https://plugins.jetbrains.com/plugin/7973-sonarlint 157 | .idea/**/sonarlint/ 158 | 159 | # SonarQube Plugin 160 | # https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin 161 | .idea/**/sonarIssues.xml 162 | 163 | # Markdown Navigator plugin 164 | # https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced 165 | .idea/**/markdown-navigator.xml 166 | .idea/**/markdown-navigator-enh.xml 167 | .idea/**/markdown-navigator/ 168 | 169 | # Cache file creation bug 170 | # See https://youtrack.jetbrains.com/issue/JBR-2257 171 | .idea/$CACHE_FILE$ 172 | 173 | # CodeStream plugin 174 | # https://plugins.jetbrains.com/plugin/12206-codestream 175 | .idea/codestream.xml 176 | 177 | ### Maven ### 178 | target/ 179 | pom.xml.tag 180 | pom.xml.releaseBackup 181 | pom.xml.versionsBackup 182 | pom.xml.next 183 | release.properties 184 | dependency-reduced-pom.xml 185 | buildNumber.properties 186 | .mvn/timing.properties 187 | # https://github.com/takari/maven-wrapper#usage-without-binary-jar 188 | .mvn/wrapper/maven-wrapper.jar 189 | 190 | ### Maven Patch ### 191 | # Eclipse m2e generated files 192 | # Eclipse Core 193 | .project 194 | # JDT-specific (Eclipse Java Development Tools) 195 | .classpath 196 | 197 | ### Node ### 198 | # Logs 199 | logs 200 | *.log 201 | npm-debug.log* 202 | yarn-debug.log* 203 | yarn-error.log* 204 | lerna-debug.log* 205 | .pnpm-debug.log* 206 | 207 | # Diagnostic reports (https://nodejs.org/api/report.html) 208 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 209 | 210 | # Runtime data 211 | pids 212 | *.pid 213 | *.seed 214 | *.pid.lock 215 | 216 | # Directory for instrumented libs generated by jscoverage/JSCover 217 | lib-cov 218 | 219 | # Coverage directory used by tools like istanbul 220 | coverage 221 | *.lcov 222 | 223 | # nyc test coverage 224 | .nyc_output 225 | 226 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 227 | .grunt 228 | 229 | # Bower dependency directory (https://bower.io/) 230 | bower_components 231 | 232 | # node-waf configuration 233 | .lock-wscript 234 | 235 | # Compiled binary addons (https://nodejs.org/api/addons.html) 236 | build/Release 237 | 238 | # Dependency directories 239 | node_modules/ 240 | jspm_packages/ 241 | 242 | # Snowpack dependency directory (https://snowpack.dev/) 243 | web_modules/ 244 | 245 | # TypeScript cache 246 | *.tsbuildinfo 247 | 248 | # Optional npm cache directory 249 | .npm 250 | 251 | # Optional eslint cache 252 | .eslintcache 253 | 254 | # Microbundle cache 255 | .rpt2_cache/ 256 | .rts2_cache_cjs/ 257 | .rts2_cache_es/ 258 | .rts2_cache_umd/ 259 | 260 | # Optional REPL history 261 | .node_repl_history 262 | 263 | # Output of 'npm pack' 264 | *.tgz 265 | 266 | # Yarn Integrity file 267 | .yarn-integrity 268 | 269 | # dotenv environment variables file 270 | .env 271 | .env.test 272 | .env.production 273 | 274 | # parcel-bundler cache (https://parceljs.org/) 275 | .cache 276 | .parcel-cache 277 | 278 | # Next.js build output 279 | .next 280 | out 281 | 282 | # Nuxt.js build / generate output 283 | .nuxt 284 | dist 285 | 286 | # Gatsby files 287 | .cache/ 288 | # Comment in the public line in if your project uses Gatsby and not Next.js 289 | # https://nextjs.org/blog/next-9-1#public-directory-support 290 | # public 291 | 292 | # vuepress build output 293 | .vuepress/dist 294 | 295 | # Serverless directories 296 | .serverless/ 297 | 298 | # FuseBox cache 299 | .fusebox/ 300 | 301 | # DynamoDB Local files 302 | .dynamodb/ 303 | 304 | # TernJS port file 305 | .tern-port 306 | 307 | # Stores VSCode versions used for testing VSCode extensions 308 | .vscode-test 309 | 310 | # yarn v2 311 | .yarn/cache 312 | .yarn/unplugged 313 | .yarn/build-state.yml 314 | .yarn/install-state.gz 315 | .pnp.* 316 | 317 | # End of https://www.toptal.com/developers/gitignore/api/node,maven,intellij,eclipse 318 | .pmd 319 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## [0.4.13](https://github.com/spotbugs/spotbugs-archetype/compare/0.4.12...0.4.13) (2025-12-17) 2 | 3 | 4 | ### Bug Fixes 5 | 6 | * **deps:** update dependency org.ow2.asm:asm to v9.9.1 ([#278](https://github.com/spotbugs/spotbugs-archetype/issues/278)) ([19b2d08](https://github.com/spotbugs/spotbugs-archetype/commit/19b2d08f91df4fe8dd1bf455e34db82cf99f6c44)) 7 | 8 | ## [0.4.12](https://github.com/spotbugs/spotbugs-archetype/compare/0.4.11...0.4.12) (2025-11-15) 9 | 10 | 11 | ### Bug Fixes 12 | 13 | * **deps:** update dependency org.junit:junit-bom to v6.0.1 ([#269](https://github.com/spotbugs/spotbugs-archetype/issues/269)) ([21cc1e4](https://github.com/spotbugs/spotbugs-archetype/commit/21cc1e465aa713743aba11f50e557e78e6d91dc3)) 14 | 15 | ## [0.4.11](https://github.com/spotbugs/spotbugs-archetype/compare/0.4.10...0.4.11) (2025-10-18) 16 | 17 | 18 | ### Bug Fixes 19 | 20 | * **deps:** update spotbugsversion to v4.9.8 ([#264](https://github.com/spotbugs/spotbugs-archetype/issues/264)) ([45ae95e](https://github.com/spotbugs/spotbugs-archetype/commit/45ae95e0840657920e7869ced01161e648335fb3)) 21 | 22 | ## [0.4.10](https://github.com/spotbugs/spotbugs-archetype/compare/0.4.9...0.4.10) (2025-10-14) 23 | 24 | 25 | ### Bug Fixes 26 | 27 | * **deps:** update spotbugsversion to v4.9.7 ([#262](https://github.com/spotbugs/spotbugs-archetype/issues/262)) ([198b8f2](https://github.com/spotbugs/spotbugs-archetype/commit/198b8f29e0960b6042441f4adbae8ec59706569e)) 28 | 29 | ## [0.4.9](https://github.com/spotbugs/spotbugs-archetype/compare/0.4.8...0.4.9) (2025-10-05) 30 | 31 | 32 | ### Bug Fixes 33 | 34 | * **deps:** update dependency org.ow2.asm:asm to v9.9 ([#259](https://github.com/spotbugs/spotbugs-archetype/issues/259)) ([ddd77f4](https://github.com/spotbugs/spotbugs-archetype/commit/ddd77f4845744a744daf9c80e0ac6ef9c0708f86)) 35 | 36 | ## [0.4.8](https://github.com/spotbugs/spotbugs-archetype/compare/0.4.7...0.4.8) (2025-10-04) 37 | 38 | 39 | ### Bug Fixes 40 | 41 | * **deps:** update dependency org.junit:junit-bom to v6 ([#258](https://github.com/spotbugs/spotbugs-archetype/issues/258)) ([28dbb53](https://github.com/spotbugs/spotbugs-archetype/commit/28dbb539e3a255180e43790e62d6f7dcd8e312d6)) 42 | 43 | ## [0.4.7](https://github.com/spotbugs/spotbugs-archetype/compare/0.4.6...0.4.7) (2025-09-17) 44 | 45 | 46 | ### Bug Fixes 47 | 48 | * **deps:** update spotbugsversion to v4.9.6 ([#253](https://github.com/spotbugs/spotbugs-archetype/issues/253)) ([6be9aff](https://github.com/spotbugs/spotbugs-archetype/commit/6be9affe9137c8a9e0478b7568853d64e262a04b)) 49 | 50 | ## [0.4.6](https://github.com/spotbugs/spotbugs-archetype/compare/0.4.5...0.4.6) (2025-09-15) 51 | 52 | 53 | ### Bug Fixes 54 | 55 | * **deps:** update spotbugsversion to v4.9.5 ([#252](https://github.com/spotbugs/spotbugs-archetype/issues/252)) ([9d7e117](https://github.com/spotbugs/spotbugs-archetype/commit/9d7e11778ef3dee71bf74c71cc471e6d69e3c9ae)) 56 | 57 | ## [0.4.5](https://github.com/spotbugs/spotbugs-archetype/compare/0.4.4...0.4.5) (2025-08-10) 58 | 59 | 60 | ### Bug Fixes 61 | 62 | * **deps:** update spotbugsversion to v4.9.4 ([#238](https://github.com/spotbugs/spotbugs-archetype/issues/238)) ([3318115](https://github.com/spotbugs/spotbugs-archetype/commit/331811524fe9e8065b9a6a9a2114b8b029d7a1b7)) 63 | 64 | ## [0.4.4](https://github.com/spotbugs/spotbugs-archetype/compare/0.4.3...0.4.4) (2025-07-22) 65 | 66 | 67 | ### Bug Fixes 68 | 69 | * **deps:** update dependency org.junit:junit-bom to v5.13.4 ([#237](https://github.com/spotbugs/spotbugs-archetype/issues/237)) ([6dd8de6](https://github.com/spotbugs/spotbugs-archetype/commit/6dd8de6b5a536074fe0d0c41aa0fc89f4d4763b3)) 70 | 71 | ## [0.4.3](https://github.com/spotbugs/spotbugs-archetype/compare/0.4.2...0.4.3) (2025-07-05) 72 | 73 | 74 | ### Bug Fixes 75 | 76 | * **deps:** update dependency org.junit:junit-bom to v5.13.3 ([#234](https://github.com/spotbugs/spotbugs-archetype/issues/234)) ([c08b180](https://github.com/spotbugs/spotbugs-archetype/commit/c08b18022746282427d01e5010b9c7b693950b40)) 77 | 78 | ## [0.4.2](https://github.com/spotbugs/spotbugs-archetype/compare/0.4.1...0.4.2) (2025-07-04) 79 | 80 | 81 | ### Bug Fixes 82 | 83 | * **build:** Trying again ([9566e1a](https://github.com/spotbugs/spotbugs-archetype/commit/9566e1a040979e24d6951c25cd185fd540900b3d)) 84 | 85 | ## [0.4.1](https://github.com/spotbugs/spotbugs-archetype/compare/0.4.0...0.4.1) (2025-07-04) 86 | 87 | 88 | ### Bug Fixes 89 | 90 | * **build:** Correct version number ([045a582](https://github.com/spotbugs/spotbugs-archetype/commit/045a582d1c797983c639dd096a25e35a664be1f9)) 91 | 92 | # [0.4.0](https://github.com/spotbugs/spotbugs-archetype/compare/0.3.0...0.4.0) (2025-07-04) 93 | 94 | 95 | ### Features 96 | 97 | * **spotbugs:** Trying again ([b5cb122](https://github.com/spotbugs/spotbugs-archetype/commit/b5cb122b7da50eb6ca3c4d44635baf67728e468a)) 98 | 99 | # [0.3.0](https://github.com/spotbugs/spotbugs-archetype/compare/0.2.10...0.3.0) (2025-07-04) 100 | 101 | 102 | ### Bug Fixes 103 | 104 | * **build:** Try to adjust for release ([e2d2185](https://github.com/spotbugs/spotbugs-archetype/commit/e2d218554cf2d7a52d0bb0a17aa7b16e6a4e5b8e)) 105 | 106 | 107 | ### Features 108 | 109 | * **spotbugs:** Move to 4.9.3 ([2b92791](https://github.com/spotbugs/spotbugs-archetype/commit/2b92791b132301a5da346bf2598611fb5a05647e)) 110 | 111 | ## [0.2.10](https://github.com/spotbugs/spotbugs-archetype/compare/0.2.9...0.2.10) (2025-07-04) 112 | 113 | 114 | ### Bug Fixes 115 | 116 | * **build:** Move to spotbugs 4.9.3 ([cc753fd](https://github.com/spotbugs/spotbugs-archetype/commit/cc753fdd329b97fed25008bd2bd8ce9219132820)) 117 | 118 | ## [0.2.9](https://github.com/spotbugs/spotbugs-archetype/compare/0.2.7...0.2.9) (2025-07-03) 119 | 120 | ### Usage 121 | 122 | * Allows up to java 25 as asm overridden 123 | * Still compliant to spotbugs 4.7.3 due to junit 4 tests in place 124 | * Build fixed to proper jvm compliancy level (8 in this case) 125 | 126 | ### Build 127 | 128 | * Removed .idea folder as that is auto generated and not to be checked in 129 | * Secure github actions file and fix issues with it 130 | * Add extension for maven to profile Build 131 | * Setup for osssrh to central migration 132 | * Moved maven settings file to .mvn folder and corrected name 133 | * Updated maven wrapper to 3.9.10 including script files along with correcting line endings 134 | * Corrected package lock file for node through regeneration 135 | * Move from obsolete conveyal maven semantic release to terrestris 136 | 137 | ## [0.2.7](https://github.com/spotbugs/spotbugs-archetype/compare/0.2.6...0.2.7) (2025-03-29) 138 | 139 | ### Bug Fixes 140 | 141 | * use latest SpotBugs built with JUnit4 ([13301a3](https://github.com/spotbugs/spotbugs-archetype/commit/13301a38143758dc5c7c8ec511d73955f76457d2)) 142 | 143 | ## [0.2.6](https://github.com/spotbugs/spotbugs-archetype/compare/0.2.5...0.2.6) (2022-10-13) 144 | 145 | 146 | ### Bug Fixes 147 | 148 | * broken release process ([#172](https://github.com/spotbugs/spotbugs-archetype/issues/172)) ([5ef6f1d](https://github.com/spotbugs/spotbugs-archetype/commit/5ef6f1db2ac9f74bba2cb2a4fdde46c7a109fde4)) 149 | 150 | ## [0.2.5](https://github.com/spotbugs/spotbugs-archetype/compare/0.2.4...0.2.5) (2022-10-13) 151 | 152 | 153 | ### Bug Fixes 154 | 155 | * missing package on the Maven Central ([43a3af0](https://github.com/spotbugs/spotbugs-archetype/commit/43a3af0c4293086a2ee91d7014b63d3374de73c5)), closes [#167](https://github.com/spotbugs/spotbugs-archetype/issues/167) 156 | 157 | ## [0.2.4](https://github.com/spotbugs/spotbugs-archetype/compare/0.2.3...0.2.4) (2021-08-29) 158 | 159 | 160 | ### Bug Fixes 161 | 162 | * use hamcrest' assertThat ([4a4b6d9](https://github.com/spotbugs/spotbugs-archetype/commit/4a4b6d96961344704d5d291292461bd060d47493)), closes [/github.com/junit-team/junit4/blob/HEAD/doc/ReleaseNotes4.13.md#pull-request-1150](https://github.com//github.com/junit-team/junit4/blob/HEAD/doc/ReleaseNotes4.13.md/issues/pull-request-1150) 163 | 164 | ## [0.2.3](https://github.com/spotbugs/spotbugs-archetype/compare/0.2.2...0.2.3) (2020-02-16) 165 | 166 | 167 | ### Bug Fixes 168 | 169 | * bump up JUnit to 4.13 ([3de9584](https://github.com/spotbugs/spotbugs-archetype/commit/3de9584)) 170 | * bump up SpotBugs to v4.0.0 stable ([c47ddf1](https://github.com/spotbugs/spotbugs-archetype/commit/c47ddf1)) 171 | * remove deprecated attribute in findbugs.xml ([cb04445](https://github.com/spotbugs/spotbugs-archetype/commit/cb04445)), closes [#guide-for-migration-from-spotbugs-3-1-to-4-0](https://github.com/spotbugs/spotbugs-archetype/issues/guide-for-migration-from-spotbugs-3-1-to-4-0) 172 | -------------------------------------------------------------------------------- /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 https://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 Apache Maven Wrapper startup batch script, version 3.3.4 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 MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands 28 | @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending 29 | @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven 30 | @REM e.g. to debug Maven itself, use 31 | @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 32 | @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files 33 | @REM ---------------------------------------------------------------------------- 34 | 35 | @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' 36 | @echo off 37 | @REM set title of command window 38 | title %0 39 | @REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' 40 | @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% 41 | 42 | @REM set %HOME% to equivalent of $HOME 43 | if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") 44 | 45 | @REM Execute a user defined script before this one 46 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre 47 | @REM check for pre script, once with legacy .bat ending and once with .cmd ending 48 | if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %* 49 | if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %* 50 | :skipRcPre 51 | 52 | @setlocal 53 | 54 | set ERROR_CODE=0 55 | 56 | @REM To isolate internal variables from possible post scripts, we use another setlocal 57 | @setlocal 58 | 59 | @REM ==== START VALIDATION ==== 60 | if not "%JAVA_HOME%" == "" goto OkJHome 61 | 62 | echo. >&2 63 | echo Error: JAVA_HOME not found in your environment. >&2 64 | echo Please set the JAVA_HOME variable in your environment to match the >&2 65 | echo location of your Java installation. >&2 66 | echo. >&2 67 | goto error 68 | 69 | :OkJHome 70 | if exist "%JAVA_HOME%\bin\java.exe" goto init 71 | 72 | echo. >&2 73 | echo Error: JAVA_HOME is set to an invalid directory. >&2 74 | echo JAVA_HOME = "%JAVA_HOME%" >&2 75 | echo Please set the JAVA_HOME variable in your environment to match the >&2 76 | echo location of your Java installation. >&2 77 | echo. >&2 78 | goto error 79 | 80 | @REM ==== END VALIDATION ==== 81 | 82 | :init 83 | 84 | @REM Find the project base dir, i.e. the directory that contains the folder ".mvn". 85 | @REM Fallback to current working directory if not found. 86 | 87 | set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% 88 | IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir 89 | 90 | set EXEC_DIR=%CD% 91 | set WDIR=%EXEC_DIR% 92 | :findBaseDir 93 | IF EXIST "%WDIR%"\.mvn goto baseDirFound 94 | cd .. 95 | IF "%WDIR%"=="%CD%" goto baseDirNotFound 96 | set WDIR=%CD% 97 | goto findBaseDir 98 | 99 | :baseDirFound 100 | set MAVEN_PROJECTBASEDIR=%WDIR% 101 | cd "%EXEC_DIR%" 102 | goto endDetectBaseDir 103 | 104 | :baseDirNotFound 105 | set MAVEN_PROJECTBASEDIR=%EXEC_DIR% 106 | cd "%EXEC_DIR%" 107 | 108 | :endDetectBaseDir 109 | 110 | IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig 111 | 112 | @setlocal EnableExtensions EnableDelayedExpansion 113 | for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a 114 | @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% 115 | 116 | :endReadAdditionalConfig 117 | 118 | SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" 119 | set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" 120 | 121 | @REM Maven main class is here to fix maven 4.0.0-beta-5 through 4.0.0-rc-4 122 | set MAVEN_MAIN_CLASS=org.apache.maven.cling.MavenCling 123 | set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 124 | 125 | set WRAPPER_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.3.4/maven-wrapper-3.3.4.jar" 126 | 127 | FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( 128 | IF "%%A"=="wrapperUrl" SET WRAPPER_URL=%%B 129 | ) 130 | 131 | @REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 132 | @REM This allows using the maven wrapper in projects that prohibit checking in binary data. 133 | if exist %WRAPPER_JAR% ( 134 | if "%MVNW_VERBOSE%" == "true" ( 135 | echo Found %WRAPPER_JAR% 136 | ) 137 | ) else ( 138 | if not "%MVNW_REPOURL%" == "" ( 139 | SET WRAPPER_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.3.4/maven-wrapper-3.3.4.jar" 140 | ) 141 | if "%MVNW_VERBOSE%" == "true" ( 142 | echo Couldn't find %WRAPPER_JAR%, downloading it ... 143 | echo Downloading from: %WRAPPER_URL% 144 | ) 145 | 146 | powershell -Command "&{"^ 147 | "$webclient = new-object System.Net.WebClient;"^ 148 | "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ 149 | "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ 150 | "}"^ 151 | "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%WRAPPER_URL%', '%WRAPPER_JAR%')"^ 152 | "}" 153 | if "%MVNW_VERBOSE%" == "true" ( 154 | echo Finished downloading %WRAPPER_JAR% 155 | ) 156 | ) 157 | @REM End of extension 158 | 159 | @REM If specified, validate the SHA-256 sum of the Maven wrapper jar file 160 | SET WRAPPER_SHA_256_SUM="" 161 | FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( 162 | IF "%%A"=="wrapperSha256Sum" SET WRAPPER_SHA_256_SUM=%%B 163 | ) 164 | IF NOT %WRAPPER_SHA_256_SUM%=="" ( 165 | powershell -Command "&{"^ 166 | "Import-Module $PSHOME\Modules\Microsoft.PowerShell.Utility -Function Get-FileHash;"^ 167 | "$hash = (Get-FileHash \"%WRAPPER_JAR%\" -Algorithm SHA256).Hash.ToLower();"^ 168 | "If('%WRAPPER_SHA_256_SUM%' -ne $hash){"^ 169 | " Write-Error 'Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised.';"^ 170 | " Write-Error 'Investigate or delete %WRAPPER_JAR% to attempt a clean download.';"^ 171 | " Write-Error 'If you updated your Maven version, you need to update the specified wrapperSha256Sum property.';"^ 172 | " exit 1;"^ 173 | "}"^ 174 | "}" 175 | if ERRORLEVEL 1 goto error 176 | ) 177 | 178 | @REM Provide a "standardized" way to retrieve the CLI args that will 179 | @REM work with both Windows and non-Windows executions. 180 | set MAVEN_CMD_LINE_ARGS=%* 181 | 182 | %MAVEN_JAVA_EXE% ^ 183 | %JVM_CONFIG_MAVEN_PROPS% ^ 184 | %MAVEN_OPTS% ^ 185 | %MAVEN_DEBUG_OPTS% ^ 186 | -classpath %WRAPPER_JAR% ^ 187 | "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^ 188 | "-Dmaven.mainClass=%MAVEN_MAIN_CLASS%" ^ 189 | %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* 190 | if ERRORLEVEL 1 goto error 191 | goto end 192 | 193 | :error 194 | set ERROR_CODE=1 195 | 196 | :end 197 | @endlocal & set ERROR_CODE=%ERROR_CODE% 198 | 199 | if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost 200 | @REM check for post script, once with legacy .bat ending and once with .cmd ending 201 | if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat" 202 | if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd" 203 | :skipRcPost 204 | 205 | @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' 206 | if "%MAVEN_BATCH_PAUSE%"=="on" pause 207 | 208 | if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE% 209 | 210 | cmd /C exit /B %ERROR_CODE% 211 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://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 | http://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 | -------------------------------------------------------------------------------- /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 | # https://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 | # Apache Maven Wrapper startup batch script, version 3.3.4 23 | # 24 | # Required ENV vars: 25 | # ------------------ 26 | # JAVA_HOME - location of a JDK home dir 27 | # 28 | # Optional ENV vars 29 | # ----------------- 30 | # MAVEN_OPTS - parameters passed to the Java VM when running Maven 31 | # e.g. to debug Maven itself, use 32 | # set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 33 | # MAVEN_SKIP_RC - flag to disable loading of mavenrc files 34 | # ---------------------------------------------------------------------------- 35 | 36 | if [ -z "$MAVEN_SKIP_RC" ]; then 37 | 38 | if [ -f /usr/local/etc/mavenrc ]; then 39 | . /usr/local/etc/mavenrc 40 | fi 41 | 42 | if [ -f /etc/mavenrc ]; then 43 | . /etc/mavenrc 44 | fi 45 | 46 | if [ -f "$HOME/.mavenrc" ]; then 47 | . "$HOME/.mavenrc" 48 | fi 49 | 50 | fi 51 | 52 | # OS specific support. $var _must_ be set to either true or false. 53 | cygwin=false 54 | darwin=false 55 | mingw=false 56 | case "$(uname)" in 57 | CYGWIN*) cygwin=true ;; 58 | MINGW*) mingw=true ;; 59 | Darwin*) 60 | darwin=true 61 | # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home 62 | # See https://developer.apple.com/library/mac/qa/qa1170/_index.html 63 | if [ -z "$JAVA_HOME" ]; then 64 | if [ -x "/usr/libexec/java_home" ]; then 65 | JAVA_HOME="$(/usr/libexec/java_home)" 66 | export JAVA_HOME 67 | else 68 | JAVA_HOME="/Library/Java/Home" 69 | export JAVA_HOME 70 | fi 71 | fi 72 | ;; 73 | esac 74 | 75 | if [ -z "$JAVA_HOME" ]; then 76 | if [ -r /etc/gentoo-release ]; then 77 | JAVA_HOME=$(java-config --jre-home) 78 | fi 79 | fi 80 | 81 | # For Cygwin, ensure paths are in UNIX format before anything is touched 82 | if $cygwin; then 83 | [ -n "$JAVA_HOME" ] \ 84 | && JAVA_HOME=$(cygpath --unix "$JAVA_HOME") 85 | [ -n "$CLASSPATH" ] \ 86 | && CLASSPATH=$(cygpath --path --unix "$CLASSPATH") 87 | fi 88 | 89 | # For Mingw, ensure paths are in UNIX format before anything is touched 90 | if $mingw; then 91 | [ -n "$JAVA_HOME" ] && [ -d "$JAVA_HOME" ] \ 92 | && JAVA_HOME="$( 93 | cd "$JAVA_HOME" || ( 94 | echo "cannot cd into $JAVA_HOME." >&2 95 | exit 1 96 | ) 97 | pwd 98 | )" 99 | fi 100 | 101 | if [ -z "$JAVA_HOME" ]; then 102 | javaExecutable="$(which javac)" 103 | if [ -n "$javaExecutable" ] && ! [ "$(expr "$javaExecutable" : '\([^ ]*\)')" = "no" ]; then 104 | # readlink(1) is not available as standard on Solaris 10. 105 | readLink=$(which readlink) 106 | if [ ! "$(expr "$readLink" : '\([^ ]*\)')" = "no" ]; then 107 | if $darwin; then 108 | javaHome="$(dirname "$javaExecutable")" 109 | javaExecutable="$(cd "$javaHome" && pwd -P)/javac" 110 | else 111 | javaExecutable="$(readlink -f "$javaExecutable")" 112 | fi 113 | javaHome="$(dirname "$javaExecutable")" 114 | javaHome=$(expr "$javaHome" : '\(.*\)/bin') 115 | JAVA_HOME="$javaHome" 116 | export JAVA_HOME 117 | fi 118 | fi 119 | fi 120 | 121 | if [ -z "$JAVACMD" ]; then 122 | if [ -n "$JAVA_HOME" ]; then 123 | if [ -x "$JAVA_HOME/jre/sh/java" ]; then 124 | # IBM's JDK on AIX uses strange locations for the executables 125 | JAVACMD="$JAVA_HOME/jre/sh/java" 126 | else 127 | JAVACMD="$JAVA_HOME/bin/java" 128 | fi 129 | else 130 | JAVACMD="$( 131 | \unset -f command 2>/dev/null 132 | \command -v java 133 | )" 134 | fi 135 | fi 136 | 137 | if [ ! -x "$JAVACMD" ]; then 138 | echo "Error: JAVA_HOME is not defined correctly." >&2 139 | echo " We cannot execute $JAVACMD" >&2 140 | exit 1 141 | fi 142 | 143 | if [ -z "$JAVA_HOME" ]; then 144 | echo "Warning: JAVA_HOME environment variable is not set." >&2 145 | fi 146 | 147 | # traverses directory structure from process work directory to filesystem root 148 | # first directory with .mvn subdirectory is considered project base directory 149 | find_maven_basedir() { 150 | if [ -z "$1" ]; then 151 | echo "Path not specified to find_maven_basedir" >&2 152 | return 1 153 | fi 154 | 155 | basedir="$1" 156 | wdir="$1" 157 | while [ "$wdir" != '/' ]; do 158 | if [ -d "$wdir"/.mvn ]; then 159 | basedir=$wdir 160 | break 161 | fi 162 | # workaround for JBEAP-8937 (on Solaris 10/Sparc) 163 | if [ -d "${wdir}" ]; then 164 | wdir=$( 165 | cd "$wdir/.." || exit 1 166 | pwd 167 | ) 168 | fi 169 | # end of workaround 170 | done 171 | printf '%s' "$( 172 | cd "$basedir" || exit 1 173 | pwd 174 | )" 175 | } 176 | 177 | # concatenates all lines of a file 178 | concat_lines() { 179 | if [ -f "$1" ]; then 180 | # Remove \r in case we run on Windows within Git Bash 181 | # and check out the repository with auto CRLF management 182 | # enabled. Otherwise, we may read lines that are delimited with 183 | # \r\n and produce $'-Xarg\r' rather than -Xarg due to word 184 | # splitting rules. 185 | tr -s '\r\n' ' ' <"$1" 186 | fi 187 | } 188 | 189 | log() { 190 | if [ "$MVNW_VERBOSE" = true ]; then 191 | printf '%s\n' "$1" 192 | fi 193 | } 194 | 195 | BASE_DIR=$(find_maven_basedir "$(dirname "$0")") 196 | if [ -z "$BASE_DIR" ]; then 197 | exit 1 198 | fi 199 | 200 | MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} 201 | export MAVEN_PROJECTBASEDIR 202 | log "$MAVEN_PROJECTBASEDIR" 203 | 204 | trim() { 205 | # MWRAPPER-139: 206 | # Trims trailing and leading whitespace, carriage returns, tabs, and linefeeds. 207 | # Needed for removing poorly interpreted newline sequences when running in more 208 | # exotic environments such as mingw bash on Windows. 209 | printf "%s" "${1}" | tr -d '[:space:]' 210 | } 211 | 212 | ########################################################################################## 213 | # Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 214 | # This allows using the maven wrapper in projects that prohibit checking in binary data. 215 | ########################################################################################## 216 | wrapperJarPath="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" 217 | if [ -r "$wrapperJarPath" ]; then 218 | log "Found $wrapperJarPath" 219 | else 220 | log "Couldn't find $wrapperJarPath, downloading it ..." 221 | 222 | if [ -n "$MVNW_REPOURL" ]; then 223 | wrapperUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.3.4/maven-wrapper-3.3.4.jar" 224 | else 225 | wrapperUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.3.4/maven-wrapper-3.3.4.jar" 226 | fi 227 | while IFS="=" read -r key value; do 228 | case "$key" in wrapperUrl) 229 | wrapperUrl=$(trim "${value-}") 230 | break 231 | ;; 232 | esac 233 | done <"$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties" 234 | log "Downloading from: $wrapperUrl" 235 | 236 | if $cygwin; then 237 | wrapperJarPath=$(cygpath --path --windows "$wrapperJarPath") 238 | fi 239 | 240 | if command -v wget >/dev/null; then 241 | log "Found wget ... using wget" 242 | [ "$MVNW_VERBOSE" = true ] && QUIET="" || QUIET="--quiet" 243 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then 244 | wget ${QUIET:+"$QUIET"} "$wrapperUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" 245 | else 246 | wget ${QUIET:+"$QUIET"} --http-user="$MVNW_USERNAME" --http-password="$MVNW_PASSWORD" "$wrapperUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" 247 | fi 248 | elif command -v curl >/dev/null; then 249 | log "Found curl ... using curl" 250 | [ "$MVNW_VERBOSE" = true ] && QUIET="" || QUIET="--silent" 251 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then 252 | curl ${QUIET:+"$QUIET"} -o "$wrapperJarPath" "$wrapperUrl" -f -L || rm -f "$wrapperJarPath" 253 | else 254 | curl ${QUIET:+"$QUIET"} --user "$MVNW_USERNAME:$MVNW_PASSWORD" -o "$wrapperJarPath" "$wrapperUrl" -f -L || rm -f "$wrapperJarPath" 255 | fi 256 | else 257 | log "Falling back to using Java to download" 258 | javaSource="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.java" 259 | javaClass="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.class" 260 | # For Cygwin, switch paths to Windows format before running javac 261 | if $cygwin; then 262 | javaSource=$(cygpath --path --windows "$javaSource") 263 | javaClass=$(cygpath --path --windows "$javaClass") 264 | fi 265 | if [ -e "$javaSource" ]; then 266 | if [ ! -e "$javaClass" ]; then 267 | log " - Compiling MavenWrapperDownloader.java ..." 268 | ("$JAVA_HOME/bin/javac" "$javaSource") 269 | fi 270 | if [ -e "$javaClass" ]; then 271 | log " - Running MavenWrapperDownloader.java ..." 272 | ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$wrapperUrl" "$wrapperJarPath") || rm -f "$wrapperJarPath" 273 | fi 274 | fi 275 | fi 276 | fi 277 | ########################################################################################## 278 | # End of extension 279 | ########################################################################################## 280 | 281 | # If specified, validate the SHA-256 sum of the Maven wrapper jar file 282 | wrapperSha256Sum="" 283 | while IFS="=" read -r key value; do 284 | case "$key" in wrapperSha256Sum) 285 | wrapperSha256Sum=$(trim "${value-}") 286 | break 287 | ;; 288 | esac 289 | done <"$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties" 290 | if [ -n "$wrapperSha256Sum" ]; then 291 | wrapperSha256Result=false 292 | if command -v sha256sum >/dev/null; then 293 | if echo "$wrapperSha256Sum $wrapperJarPath" | sha256sum -c - >/dev/null 2>&1; then 294 | wrapperSha256Result=true 295 | fi 296 | elif command -v shasum >/dev/null; then 297 | if echo "$wrapperSha256Sum $wrapperJarPath" | shasum -a 256 -c >/dev/null 2>&1; then 298 | wrapperSha256Result=true 299 | fi 300 | else 301 | echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." >&2 302 | echo "Please install either command, or disable validation by removing 'wrapperSha256Sum' from your maven-wrapper.properties." >&2 303 | exit 1 304 | fi 305 | if [ $wrapperSha256Result = false ]; then 306 | echo "Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised." >&2 307 | echo "Investigate or delete $wrapperJarPath to attempt a clean download." >&2 308 | echo "If you updated your Maven version, you need to update the specified wrapperSha256Sum property." >&2 309 | exit 1 310 | fi 311 | fi 312 | 313 | MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" 314 | 315 | # For Cygwin, switch paths to Windows format before running java 316 | if $cygwin; then 317 | [ -n "$JAVA_HOME" ] \ 318 | && JAVA_HOME=$(cygpath --path --windows "$JAVA_HOME") 319 | [ -n "$CLASSPATH" ] \ 320 | && CLASSPATH=$(cygpath --path --windows "$CLASSPATH") 321 | [ -n "$MAVEN_PROJECTBASEDIR" ] \ 322 | && MAVEN_PROJECTBASEDIR=$(cygpath --path --windows "$MAVEN_PROJECTBASEDIR") 323 | fi 324 | 325 | # Provide a "standardized" way to retrieve the CLI args that will 326 | # work with both Windows and non-Windows executions. 327 | MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $*" 328 | export MAVEN_CMD_LINE_ARGS 329 | 330 | # Maven main class is here to fix maven 4.0.0-beta-5 through 4.0.0-rc-4 331 | MAVEN_MAIN_CLASS=org.apache.maven.cling.MavenCling 332 | WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 333 | 334 | # shellcheck disable=SC2086 # safe args 335 | exec "$JAVACMD" \ 336 | $MAVEN_OPTS \ 337 | $MAVEN_DEBUG_OPTS \ 338 | -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ 339 | "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ 340 | "-Dmaven.mainClass=${MAVEN_MAIN_CLASS}" \ 341 | ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" 342 | --------------------------------------------------------------------------------