├── .editorconfig ├── .github └── workflows │ ├── ci.yaml │ └── release.yaml ├── .gitignore ├── CONTRIBUTING.md ├── LICENSE.txt ├── README.md ├── pom.xml ├── src ├── main │ └── java │ │ └── com │ │ └── github │ │ └── danielflower │ │ └── mavenplugins │ │ └── release │ │ ├── AnnotatedTag.java │ │ ├── AnnotatedTagFinder.java │ │ ├── BaseMojo.java │ │ ├── DiffDetector.java │ │ ├── FileUtils.java │ │ ├── GitHelper.java │ │ ├── GitOperations.java │ │ ├── Guard.java │ │ ├── LocalGitRepo.java │ │ ├── MavenVersionResolver.java │ │ ├── NextMojo.java │ │ ├── NoChangesAction.java │ │ ├── PomUpdater.java │ │ ├── Reactor.java │ │ ├── RefWithCommitId.java │ │ ├── ReleasableModule.java │ │ ├── ReleaseInvoker.java │ │ ├── ReleaseMojo.java │ │ ├── ResolverWrapper.java │ │ ├── SshAgentSessionFactory.java │ │ ├── TreeWalkingDiffDetector.java │ │ ├── UnresolvedSnapshotDependencyException.java │ │ ├── ValidationException.java │ │ ├── VersionName.java │ │ ├── VersionNamer.java │ │ ├── VersionReport.java │ │ └── VersionReportFormat.java ├── site │ ├── fml │ │ └── FAQ.fml │ ├── markdown │ │ ├── changelog.md │ │ ├── deploy-to-ossrh.md.vm │ │ ├── https-authentication.md.vm │ │ ├── index.md.vm │ │ ├── ssh-authentication.md.vm │ │ └── usage.md.vm │ └── site.xml └── test │ ├── java │ ├── com │ │ └── github │ │ │ └── danielflower │ │ │ └── mavenplugins │ │ │ └── release │ │ │ ├── AnnotatedTagFinderTest.java │ │ │ ├── AnnotatedTagTest.java │ │ │ ├── BaseMojoTest.java │ │ │ ├── DiffDetectorTest.java │ │ │ ├── LocalGitRepoTest.java │ │ │ ├── ReactorTest.java │ │ │ ├── ReleasableModuleTest.java │ │ │ ├── ReleaseInvokerTest.java │ │ │ ├── SshAgentSessionFactoryTest.java │ │ │ └── VersionNamerTest.java │ ├── e2e │ │ ├── BomDependencyTest.java │ │ ├── BomDependencyUsingParentModuleVersionTest.java │ │ ├── DifferentDelimiterTest.java │ │ ├── ExecutionTest.java │ │ ├── GitRelatedTest.java │ │ ├── HelpTest.java │ │ ├── IndependentVersionsTest.java │ │ ├── InheritedVersionsTest.java │ │ ├── JGitDiscoveryTest.java │ │ ├── LocalPluginTest.java │ │ ├── MavenCompatibilityTest.java │ │ ├── NestedModulesTest.java │ │ ├── NextMojoTest.java │ │ ├── ParentAsSiblingTest.java │ │ ├── PartialReleaseTest.java │ │ ├── SingleModuleTest.java │ │ ├── SkippingUnchangedModulesTest.java │ │ ├── TestRunningTest.java │ │ ├── ValidationTest.java │ │ ├── VersionOnlyTagTest.java │ │ └── VersionsReportTest.java │ └── scaffolding │ │ ├── CollectingLogOutputStream.java │ │ ├── ExactCountMatcher.java │ │ ├── GitMatchers.java │ │ ├── MavenExecutionException.java │ │ ├── MvnRunner.java │ │ ├── Photocopier.java │ │ ├── ReleasableModuleBuilder.java │ │ └── TestProject.java │ └── resources │ ├── known_hosts │ ├── testid_rsa │ ├── testid_rsa.pub │ ├── testid_with_password_rsa │ └── testid_with_password_rsa.pub └── test-projects ├── deep-dependencies ├── .gitignore ├── README.md ├── console-app │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── github │ │ └── danielflower │ │ └── mavenplugins │ │ └── testprojects │ │ └── versioninheritor │ │ └── App.java ├── more-utilities │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── github │ │ │ └── danielflower │ │ │ └── mavenplugins │ │ │ └── testprojects │ │ │ └── versioninheritor │ │ │ └── Calculator.java │ │ └── test │ │ └── java │ │ └── com │ │ └── github │ │ └── danielflower │ │ └── mavenplugins │ │ └── testprojects │ │ └── versioninheritor │ │ └── CalculatorTest.java ├── parent-module │ └── pom.xml ├── pom.xml └── the-core-utilities │ ├── pom.xml │ └── src │ ├── main │ └── java │ │ └── com │ │ └── github │ │ └── danielflower │ │ └── mavenplugins │ │ └── testprojects │ │ └── versioninheritor │ │ └── Calculator.java │ └── test │ └── java │ └── com │ └── github │ └── danielflower │ └── mavenplugins │ └── testprojects │ └── versioninheritor │ └── CalculatorTest.java ├── dependencymanagement-using-parent-module-version-property ├── .gitignore ├── README.md ├── console-app │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── github │ │ └── danielflower │ │ └── mavenplugins │ │ └── testprojects │ │ └── versioninheritor │ │ └── App.java ├── more-utilities │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── github │ │ │ └── danielflower │ │ │ └── mavenplugins │ │ │ └── testprojects │ │ │ └── versioninheritor │ │ │ └── Calculator.java │ │ └── test │ │ └── java │ │ └── com │ │ └── github │ │ └── danielflower │ │ └── mavenplugins │ │ └── testprojects │ │ └── versioninheritor │ │ └── CalculatorTest.java ├── parent-module │ └── pom.xml ├── pom.xml ├── root-bom │ └── pom.xml └── the-core-utilities │ ├── pom.xml │ └── src │ ├── main │ └── java │ │ └── com │ │ └── github │ │ └── danielflower │ │ └── mavenplugins │ │ └── testprojects │ │ └── versioninheritor │ │ └── Calculator.java │ └── test │ └── java │ └── com │ └── github │ └── danielflower │ └── mavenplugins │ └── testprojects │ └── versioninheritor │ └── CalculatorTest.java ├── dependencymanagement ├── .gitignore ├── README.md ├── console-app │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── github │ │ └── danielflower │ │ └── mavenplugins │ │ └── testprojects │ │ └── versioninheritor │ │ └── App.java ├── more-utilities │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── github │ │ │ └── danielflower │ │ │ └── mavenplugins │ │ │ └── testprojects │ │ │ └── versioninheritor │ │ │ └── Calculator.java │ │ └── test │ │ └── java │ │ └── com │ │ └── github │ │ └── danielflower │ │ └── mavenplugins │ │ └── testprojects │ │ └── versioninheritor │ │ └── CalculatorTest.java ├── parent-module │ └── pom.xml ├── pom.xml ├── root-bom │ └── pom.xml └── the-core-utilities │ ├── pom.xml │ └── src │ ├── main │ └── java │ │ └── com │ │ └── github │ │ └── danielflower │ │ └── mavenplugins │ │ └── testprojects │ │ └── versioninheritor │ │ └── Calculator.java │ └── test │ └── java │ └── com │ └── github │ └── danielflower │ └── mavenplugins │ └── testprojects │ └── versioninheritor │ └── CalculatorTest.java ├── different-delimiter ├── .gitignore ├── assembly-descriptor.xml ├── pom.xml └── src │ └── main │ └── java │ └── com │ └── github │ └── danielflower │ └── mavenplugins │ └── testproject │ └── singlepom │ └── Main.java ├── independent-versions ├── .gitignore ├── console-app │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── github │ │ └── danielflower │ │ └── mavenplugins │ │ └── testprojects │ │ └── versioninheritor │ │ └── App.java ├── core-utils │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── github │ │ │ └── danielflower │ │ │ └── mavenplugins │ │ │ └── testprojects │ │ │ └── versioninheritor │ │ │ └── Calculator.java │ │ └── test │ │ └── java │ │ └── com │ │ └── github │ │ └── danielflower │ │ └── mavenplugins │ │ └── testprojects │ │ └── versioninheritor │ │ └── CalculatorTest.java └── pom.xml ├── inherited-versions-from-parent ├── .gitignore ├── console-app │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── github │ │ └── danielflower │ │ └── mavenplugins │ │ └── testprojects │ │ └── versioninheritor │ │ └── App.java ├── core-utils │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── github │ │ │ └── danielflower │ │ │ └── mavenplugins │ │ │ └── testprojects │ │ │ └── versioninheritor │ │ │ └── Calculator.java │ │ └── test │ │ └── java │ │ └── com │ │ └── github │ │ └── danielflower │ │ └── mavenplugins │ │ └── testprojects │ │ └── versioninheritor │ │ └── CalculatorTest.java └── pom.xml ├── local-plugin ├── common │ ├── local-maven-plugin │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── github │ │ │ └── danielflower │ │ │ └── mavenplugins │ │ │ └── testproject │ │ │ └── localplugin │ │ │ └── pluginproject │ │ │ └── MyMojo.java │ └── pom.xml ├── pom.xml └── services │ ├── pom.xml │ └── simple-project │ ├── pom.xml │ └── src │ └── main │ └── java │ └── com │ └── github │ └── danielflower │ └── mavenplugins │ └── testprojects │ └── simpleproject │ └── Main.java ├── module-with-profiles ├── .gitignore ├── custom-settings.xml ├── pom.xml └── src │ ├── main │ └── java │ │ └── com │ │ └── github │ │ └── danielflower │ │ └── mavenplugins │ │ └── testproject │ │ └── singlepom │ │ └── Main.java │ └── test │ └── java │ └── com │ └── github │ └── danielflower │ └── mavenplugins │ └── testproject │ └── singlepom │ └── MainTest.java ├── module-with-scm-tag ├── .gitignore └── pom.xml ├── module-with-test-failure ├── .gitignore ├── pom.xml └── src │ ├── main │ └── java │ │ └── com │ │ └── github │ │ └── danielflower │ │ └── mavenplugins │ │ └── testproject │ │ └── singlepom │ │ └── Main.java │ └── test │ └── java │ └── com │ └── github │ └── danielflower │ └── mavenplugins │ └── testproject │ └── singlepom │ └── MainTest.java ├── nested-project ├── .gitignore ├── console-app │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── github │ │ └── danielflower │ │ └── mavenplugins │ │ └── testprojects │ │ └── versioninheritor │ │ └── App.java ├── core-utils │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── github │ │ │ └── danielflower │ │ │ └── mavenplugins │ │ │ └── testprojects │ │ │ └── versioninheritor │ │ │ └── Calculator.java │ │ └── test │ │ └── java │ │ └── com │ │ └── github │ │ └── danielflower │ │ └── mavenplugins │ │ └── testprojects │ │ └── versioninheritor │ │ └── CalculatorTest.java ├── parent-module │ └── pom.xml ├── pom.xml └── server-modules │ ├── a-misnamed-one │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── github │ │ │ └── danielflower │ │ │ └── mavenplugins │ │ │ └── testprojects │ │ │ └── versioninheritor │ │ │ └── Calculator.java │ │ └── test │ │ └── java │ │ └── com │ │ └── github │ │ └── danielflower │ │ └── mavenplugins │ │ └── testprojects │ │ └── versioninheritor │ │ └── CalculatorTest.java │ ├── pom.xml │ ├── server-module-a │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── github │ │ │ └── danielflower │ │ │ └── mavenplugins │ │ │ └── testprojects │ │ │ └── versioninheritor │ │ │ └── Calculator.java │ │ └── test │ │ └── java │ │ └── com │ │ └── github │ │ └── danielflower │ │ └── mavenplugins │ │ └── testprojects │ │ └── versioninheritor │ │ └── CalculatorTest.java │ └── server-module-b │ ├── pom.xml │ └── src │ ├── main │ └── java │ │ └── com │ │ └── github │ │ └── danielflower │ │ └── mavenplugins │ │ └── testprojects │ │ └── versioninheritor │ │ └── Calculator.java │ └── test │ └── java │ └── com │ └── github │ └── danielflower │ └── mavenplugins │ └── testprojects │ └── versioninheritor │ └── CalculatorTest.java ├── parent-as-sibling ├── .gitignore ├── README.md ├── console-app │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── github │ │ └── danielflower │ │ └── mavenplugins │ │ └── testprojects │ │ └── versioninheritor │ │ └── App.java ├── core-utils │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── github │ │ │ └── danielflower │ │ │ └── mavenplugins │ │ │ └── testprojects │ │ │ └── versioninheritor │ │ │ └── Calculator.java │ │ └── test │ │ └── java │ │ └── com │ │ └── github │ │ └── danielflower │ │ └── mavenplugins │ │ └── testprojects │ │ └── versioninheritor │ │ └── CalculatorTest.java ├── parent-module │ └── pom.xml └── pom.xml ├── single-module ├── .gitignore ├── assembly-descriptor.xml ├── pom.xml └── src │ └── main │ └── java │ └── com │ └── github │ └── danielflower │ └── mavenplugins │ └── testproject │ └── singlepom │ └── Main.java ├── snapshot-dependencies-with-version-properties ├── .gitignore ├── assembly-descriptor.xml ├── pom.xml └── src │ └── main │ └── java │ └── com │ └── github │ └── danielflower │ └── mavenplugins │ └── testproject │ └── snapshotdependencies │ └── Main.java ├── snapshot-dependencies ├── .gitignore ├── assembly-descriptor.xml ├── pom.xml └── src │ └── main │ └── java │ └── com │ └── github │ └── danielflower │ └── mavenplugins │ └── testproject │ └── snapshotdependencies │ └── Main.java ├── version-only-tag ├── .gitignore ├── assembly-descriptor.xml ├── pom.xml └── src │ └── main │ └── java │ └── com │ └── github │ └── danielflower │ └── mavenplugins │ └── testproject │ └── singlepom │ └── Main.java └── version-report ├── .gitignore ├── console-app ├── pom.xml └── src │ └── main │ └── java │ └── com │ └── github │ └── danielflower │ └── mavenplugins │ └── testprojects │ └── versioninheritor │ └── App.java ├── core-utils ├── pom.xml └── src │ ├── main │ └── java │ │ └── com │ │ └── github │ │ └── danielflower │ │ └── mavenplugins │ │ └── testprojects │ │ └── versioninheritor │ │ └── Calculator.java │ └── test │ └── java │ └── com │ └── github │ └── danielflower │ └── mavenplugins │ └── testprojects │ └── versioninheritor │ └── CalculatorTest.java └── pom.xml /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig is awesome: http://EditorConfig.org 2 | 3 | root = true 4 | 5 | [*.{java,xml}] 6 | charset = utf-8 7 | indent_style = space 8 | indent_size = 4 9 | -------------------------------------------------------------------------------- /.github/workflows/ci.yaml: -------------------------------------------------------------------------------- 1 | name: Build and test 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | build: 7 | runs-on: ubuntu-latest 8 | strategy: 9 | matrix: 10 | java: [ 8, 11, 21 ] 11 | name: Java ${{ matrix.java }} build 12 | steps: 13 | - uses: actions/checkout@v4 14 | - name: Set up JDK ${{ matrix.java }} 15 | uses: actions/setup-java@v4 16 | with: 17 | java-version: ${{ matrix.java }} 18 | distribution: 'temurin' 19 | cache: 'maven' 20 | 21 | - run: echo "M2_HOME=$(dirname $(dirname `which mvn`))" >> $GITHUB_ENV 22 | - run: git config --global user.email "test@example.com" 23 | - run: git config --global user.name "Test user" 24 | 25 | - name: Build with Maven on JDK ${{ matrix.java }} 26 | run: mvn --batch-mode --update-snapshots verify 27 | -------------------------------------------------------------------------------- /.github/workflows/release.yaml: -------------------------------------------------------------------------------- 1 | name: Publish to Maven Central Repository 2 | on: workflow_dispatch 3 | 4 | jobs: 5 | publish: 6 | runs-on: ubuntu-latest 7 | steps: 8 | - uses: actions/checkout@v4 9 | - name: Set up Maven Central Repository 10 | uses: actions/setup-java@v4 11 | with: 12 | java-version: '8' 13 | distribution: 'temurin' 14 | cache: 'maven' 15 | server-id: ossrh 16 | server-username: OSSRH_USERNAME 17 | server-password: OSSRH_TOKEN 18 | - run: git config --global user.email "test@example.com" 19 | - run: git config --global user.name "Github Action" 20 | - run: echo "M2_HOME=$(dirname $(dirname `which mvn`))" >> $GITHUB_ENV 21 | - name: Verify package 22 | run: mvn --batch-mode verify 23 | - name: Release package 24 | run: mvn --batch-mode -DskipTests=true releaser:release 25 | env: 26 | OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} 27 | OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }} 28 | MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} 29 | MAVEN_GPG_KEY: ${{ secrets.OSSRH_GPG_SECRET_KEY }} 30 | - name: Set up Java for publishing to GitHub Packages 31 | uses: actions/setup-java@v4 32 | with: 33 | java-version: '11' 34 | distribution: 'temurin' 35 | - name: Publish documentation 36 | run: mvn --batch-mode scm-publish:publish-scm 37 | env: 38 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 39 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | .idea/ 3 | *.iml 4 | .classpath 5 | .settings 6 | .project 7 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | Contributing 2 | ------------ 3 | 4 | Pull requests are gratefully welcomed. It would be appreciated if the following guidelines are followed: 5 | 6 | * Make sure tests cover your change, preferrably with unit tests. There are quite a few slower tests that run the plugin 7 | against sample projects in the `test-projects` folder. You amend existing tests or add a new one if necessary. 8 | * Follow semantic versioning and increment the minor or major version number in `pom.xml` and 9 | `scaffolding.TestProject.PLUGIN_VERSION_FOR_TESTS` 10 | * Update the the changelog: `src/site/markdown/changelog.md` 11 | * Use [.editorconfig](http://editorconfig.org/) to keep formatting consistent 12 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Daniel Flower 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Documentation, download, and usage instructions 2 | =============================================== 3 | 4 | Full usage details, FAQs, background and more are available on the 5 | **[project documentation website](https://danielflower.github.io/multi-module-maven-release-plugin/index.html)**. 6 | 7 | Development 8 | =========== 9 | 10 | [![Build Status](https://travis-ci.org/danielflower/multi-module-maven-release-plugin.svg?branch=master)](https://travis-ci.org/danielflower/multi-module-maven-release-plugin) ![Maven Central](https://img.shields.io/maven-central/v/com.github.danielflower.mavenplugins/multi-module-maven-release-plugin.svg) 11 | 12 | 13 | Contributing 14 | ------------ 15 | 16 | To build and run the tests, you need Java 8 or later and Maven 3 or later. Simply clone and run `mvn install` 17 | 18 | Note that the tests run the plugin against a number of sample test projects, located in the `test-projects` folder. 19 | If adding new functionality, or fixing a bug, it is recommended that a sample project be set up so that the scenario 20 | can be tested end-to-end. 21 | 22 | See also [CONTRIBUTING.md](CONTRIBUTING.md) for information on deploying to Nexus and releasing the plugin. 23 | -------------------------------------------------------------------------------- /src/main/java/com/github/danielflower/mavenplugins/release/DiffDetector.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.release; 2 | 3 | import java.io.IOException; 4 | import java.util.Collection; 5 | import java.util.List; 6 | 7 | public interface DiffDetector { 8 | boolean hasChangedSince(String modulePath, List childModules, Collection tags) throws IOException; 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/github/danielflower/mavenplugins/release/FileUtils.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.release; 2 | 3 | import java.io.File; 4 | import java.io.IOException; 5 | 6 | public class FileUtils { 7 | public static String pathOf(File file) { 8 | String path; 9 | try { 10 | path = file.getCanonicalPath(); 11 | } catch (IOException e1) { 12 | path = file.getAbsolutePath(); 13 | } 14 | return path; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/github/danielflower/mavenplugins/release/GitHelper.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.release; 2 | 3 | import org.eclipse.jgit.api.Git; 4 | import org.eclipse.jgit.api.errors.GitAPIException; 5 | import org.eclipse.jgit.lib.Ref; 6 | 7 | import java.util.ArrayList; 8 | import java.util.List; 9 | 10 | public class GitHelper { 11 | public static boolean hasLocalTag(Git repo, String tagToCheck) throws GitAPIException { 12 | return tag(repo, new EqualsMatcher(tagToCheck)) != null; 13 | } 14 | 15 | public static Ref refStartingWith(Git repo, final String tagPrefix) throws GitAPIException { 16 | return tag(repo, new Matcher() { 17 | @Override 18 | public boolean matches(String tagName) { 19 | return tagName.startsWith(tagPrefix); 20 | } 21 | }); 22 | } 23 | 24 | private static Ref tag(Git repo, Matcher matcher) throws GitAPIException { 25 | for (Ref ref : repo.tagList().call()) { 26 | String currentTag = ref.getName().replace("refs/tags/", ""); 27 | if (matcher.matches(currentTag)) { 28 | return ref; 29 | } 30 | } 31 | return null; 32 | } 33 | 34 | public static String scmUrlToRemote(String scmUrl) throws ValidationException { 35 | String GIT_PREFIX = "scm:git:"; 36 | if (!scmUrl.startsWith(GIT_PREFIX)) { 37 | List messages = new ArrayList(); 38 | String summary = "Cannot run the release plugin with a non-Git version control system"; 39 | messages.add(summary); 40 | messages.add("The value in your scm tag is " + scmUrl); 41 | throw new ValidationException(summary, messages); 42 | } 43 | String remote = scmUrl.substring(GIT_PREFIX.length()); 44 | remote = remote.replace("file://localhost/", "file:///"); 45 | return remote; 46 | } 47 | 48 | private interface Matcher { 49 | public boolean matches(String tagName); 50 | } 51 | 52 | private static class EqualsMatcher implements Matcher { 53 | private final String tagToCheck; 54 | 55 | public EqualsMatcher(String tagToCheck) { 56 | this.tagToCheck = tagToCheck; 57 | } 58 | 59 | @Override 60 | public boolean matches(String tagName) { 61 | return tagToCheck.equals(tagName); 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/main/java/com/github/danielflower/mavenplugins/release/GitOperations.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.release; 2 | 3 | public enum GitOperations { 4 | 5 | PULL_TAGS, PUSH_TAGS; 6 | 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/com/github/danielflower/mavenplugins/release/Guard.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.release; 2 | 3 | public class Guard { 4 | 5 | public static void notNull(String thing, Object value) { 6 | if (value == null) { 7 | throw new GuardException("The value for " + thing + " cannot be null"); 8 | } 9 | } 10 | 11 | public static void notBlank(String thing, String value) { 12 | notNull(thing, value); 13 | if (value.trim().length() == 0) { 14 | throw new GuardException("The value for " + thing + " cannot be a blank string"); 15 | } 16 | } 17 | 18 | public static class GuardException extends RuntimeException { 19 | public GuardException(String message) { 20 | super(message); 21 | } 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/github/danielflower/mavenplugins/release/MavenVersionResolver.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.release; 2 | 3 | import java.util.List; 4 | import java.util.Properties; 5 | 6 | import org.apache.maven.project.MavenProject; 7 | 8 | class MavenVersionResolver { 9 | 10 | static void resolveVersionsDefinedThroughProperties(List projects) { 11 | for (MavenProject project : projects) { 12 | if (isVersionDefinedWithProperty(project.getVersion())) { 13 | project.setVersion(resolveVersion(project.getVersion(), project.getProperties())); 14 | } 15 | } 16 | 17 | } 18 | 19 | static String resolveVersion(String version, Properties projectProperties) { 20 | if (isVersionDefinedWithProperty(version)) { 21 | return projectProperties.getProperty(version.replace("${", "").replace("}", ""), version); 22 | } 23 | return version; 24 | } 25 | 26 | static boolean isSnapshot(String version) { 27 | return (version != null && version.endsWith("-SNAPSHOT")); 28 | } 29 | 30 | private static boolean isVersionDefinedWithProperty(String version) { 31 | return version != null && version.startsWith("${"); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/github/danielflower/mavenplugins/release/NextMojo.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.release; 2 | 3 | import org.apache.maven.plugin.MojoExecutionException; 4 | import org.apache.maven.plugin.MojoFailureException; 5 | import org.apache.maven.plugin.logging.Log; 6 | import org.apache.maven.plugins.annotations.Mojo; 7 | import org.eclipse.jgit.api.errors.GitAPIException; 8 | 9 | import java.io.PrintWriter; 10 | import java.io.StringWriter; 11 | import java.util.EnumSet; 12 | import java.util.Set; 13 | 14 | import static java.util.Arrays.asList; 15 | 16 | /** 17 | * Logs the versions of the modules that the releaser will release on the next release. Does not run the build nor 18 | * tag the repo. 19 | * @since 1.4.0 20 | */ 21 | @Mojo( 22 | name = "next", 23 | requiresDirectInvocation = true, // this should not be bound to a phase as this plugin starts a phase itself 24 | inheritByDefault = true, // so you can configure this in a shared parent pom 25 | requiresProject = true, // this can only run against a maven project 26 | aggregator = true // the plugin should only run once against the aggregator pom 27 | ) 28 | public class NextMojo extends BaseMojo { 29 | 30 | @Override 31 | public void execute() throws MojoExecutionException, MojoFailureException { 32 | Log log = getLog(); 33 | 34 | try { 35 | configureJsch(log); 36 | 37 | Set gitOperations = EnumSet.noneOf(GitOperations.class); 38 | if (pullTags) { 39 | gitOperations.add(GitOperations.PULL_TAGS); 40 | } 41 | 42 | LocalGitRepo repo = new LocalGitRepo.Builder() 43 | .remoteGitOperationsAllowed(gitOperations) 44 | .remoteGitUrl(getRemoteUrlOrNullIfNoneSet(project.getOriginalModel().getScm(), 45 | project.getModel().getScm())) 46 | .credentialsProvider(getCredentialsProvider(log)) 47 | .buildFromCurrentDir(); 48 | ResolverWrapper resolverWrapper = new ResolverWrapper(factory, artifactResolver, remoteRepositories, localRepository); 49 | Reactor reactor = Reactor.fromProjects(this, log, repo, noChangesAction, resolverWrapper); 50 | if (reactor == null) { 51 | return; 52 | } 53 | ReleaseMojo.figureOutTagNamesAndThrowIfAlreadyExists(reactor.getModulesInBuildOrder(), repo, modulesToRelease); 54 | 55 | } catch (ValidationException e) { 56 | printBigErrorMessageAndThrow(log, e.getMessage(), e.getMessages()); 57 | } catch (GitAPIException gae) { 58 | 59 | StringWriter sw = new StringWriter(); 60 | gae.printStackTrace(new PrintWriter(sw)); 61 | String exceptionAsString = sw.toString(); 62 | 63 | printBigErrorMessageAndThrow(log, "Could not release due to a Git error", 64 | asList("There was an error while accessing the Git repository. The error returned from git was:", 65 | gae.getMessage(), "Stack trace:", exceptionAsString)); 66 | } 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /src/main/java/com/github/danielflower/mavenplugins/release/NoChangesAction.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.release; 2 | 3 | public enum NoChangesAction { 4 | ReleaseAll, ReleaseNone, FailBuild; 5 | } 6 | -------------------------------------------------------------------------------- /src/main/java/com/github/danielflower/mavenplugins/release/RefWithCommitId.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.release; 2 | 3 | import org.eclipse.jgit.lib.ObjectId; 4 | import org.eclipse.jgit.lib.Ref; 5 | 6 | public final class RefWithCommitId 7 | { 8 | private final Ref ref; 9 | private final ObjectId commitId; 10 | 11 | public RefWithCommitId(Ref ref, ObjectId commitId) { 12 | Guard.notNull("ref", ref); 13 | Guard.notNull("commitId", commitId); 14 | this.ref = ref; 15 | this.commitId = commitId; 16 | } 17 | 18 | public Ref getRef() { 19 | return ref; 20 | } 21 | 22 | 23 | 24 | public ObjectId getCommitObjectId() { 25 | return commitId; 26 | } 27 | 28 | @Override 29 | public String toString() { 30 | return "RefWithCommitId{" + 31 | "ref='" + ref.toString() + '\'' + 32 | ", commitId=" + commitId.toString() + 33 | '}'; 34 | } 35 | 36 | @Override 37 | public boolean equals(Object o) { 38 | if (this == o) return true; 39 | if (o == null || getClass() != o.getClass()) return false; 40 | RefWithCommitId that = (RefWithCommitId) o; 41 | return ref.equals(that.ref); 42 | } 43 | 44 | @Override 45 | public int hashCode() { 46 | return ref.hashCode(); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/com/github/danielflower/mavenplugins/release/ReleasableModule.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.release; 2 | 3 | import org.apache.maven.plugin.logging.Log; 4 | import org.apache.maven.project.MavenProject; 5 | import org.apache.maven.shared.utils.StringUtils; 6 | 7 | import java.util.List; 8 | 9 | public class ReleasableModule { 10 | 11 | private final MavenProject project; 12 | private final VersionName version; 13 | private final String tagName; 14 | private final String tagNameFormat; 15 | private final String equivalentVersion; 16 | private final String relativePathToModule; 17 | 18 | public ReleasableModule(MavenProject project, VersionName version, String equivalentVersion, String relativePathToModule, String tagNameFormat, Log log) { 19 | this.project = project; 20 | this.version = version; 21 | this.equivalentVersion = equivalentVersion; 22 | this.relativePathToModule = relativePathToModule; 23 | 24 | String defaultTagName = project.getArtifactId() + "-" + version.releaseVersion(); 25 | if (StringUtils.isNotEmpty(tagNameFormat)) { 26 | this.tagName = AnnotatedTag.formatTagName(defaultTagName, project.getGroupId(), project.getArtifactId(), version.releaseVersion(), tagNameFormat, log); 27 | } else { 28 | this.tagName = defaultTagName; 29 | } 30 | 31 | this.tagNameFormat = tagNameFormat; 32 | } 33 | 34 | public String getTagName() { 35 | return tagName; 36 | } 37 | 38 | public String getNewVersion() { 39 | return version.releaseVersion(); 40 | } 41 | 42 | public String getArtifactId() { 43 | return project.getArtifactId(); 44 | } 45 | 46 | public String getGroupId() { 47 | return project.getGroupId(); 48 | } 49 | 50 | public MavenProject getProject() { 51 | return project; 52 | } 53 | 54 | public String getVersion() { 55 | return version.businessVersion(); 56 | } 57 | 58 | public long getBuildNumber() { 59 | return version.buildNumber(); 60 | } 61 | 62 | public boolean isOneOf(List moduleNames) { 63 | String modulePath = project.getBasedir().getName(); 64 | for (String moduleName : moduleNames) { 65 | if (modulePath.equals(moduleName)) { 66 | return true; 67 | } 68 | } 69 | return false; 70 | } 71 | 72 | public boolean willBeReleased() { 73 | return equivalentVersion == null; 74 | } 75 | 76 | public String getVersionToDependOn() { 77 | return willBeReleased() ? version.releaseVersion() : equivalentVersion; 78 | } 79 | 80 | public String getRelativePathToModule() { 81 | return relativePathToModule; 82 | } 83 | 84 | public ReleasableModule createReleasableVersion(Log log) { 85 | return new ReleasableModule(project, version, null, relativePathToModule, tagNameFormat, log); 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /src/main/java/com/github/danielflower/mavenplugins/release/ResolverWrapper.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.release; 2 | 3 | import org.apache.maven.artifact.Artifact; 4 | import org.apache.maven.artifact.factory.ArtifactFactory; 5 | import org.apache.maven.artifact.repository.ArtifactRepository; 6 | import org.apache.maven.artifact.resolver.ArtifactNotFoundException; 7 | import org.apache.maven.artifact.resolver.ArtifactResolutionException; 8 | import org.apache.maven.artifact.resolver.ArtifactResolver; 9 | import org.apache.maven.plugin.logging.Log; 10 | 11 | import java.util.List; 12 | 13 | /** 14 | * 15 | */ 16 | public class ResolverWrapper { 17 | 18 | private final ArtifactFactory factory; 19 | 20 | private final ArtifactResolver artifactResolver; 21 | 22 | private final List remoteRepositories; 23 | 24 | private final ArtifactRepository localRepository; 25 | 26 | public ResolverWrapper(ArtifactFactory factory, ArtifactResolver artifactResolver, List remoteRepositories, ArtifactRepository localRepository) { 27 | this.factory = factory; 28 | this.artifactResolver = artifactResolver; 29 | this.remoteRepositories = remoteRepositories; 30 | this.localRepository = localRepository; 31 | } 32 | 33 | public ArtifactFactory getFactory() { 34 | return factory; 35 | } 36 | 37 | public ArtifactResolver getArtifactResolver() { 38 | return artifactResolver; 39 | } 40 | 41 | public List getRemoteRepositories() { 42 | return remoteRepositories; 43 | } 44 | 45 | public ArtifactRepository getLocalRepository() { 46 | return localRepository; 47 | } 48 | 49 | public boolean isResolvable(String groupId, String artifactId, String version, String type, Log log) { 50 | try { 51 | Artifact pomArtifact = this.factory.createArtifact(groupId, artifactId, version, "", type); 52 | artifactResolver.resolve(pomArtifact, remoteRepositories, localRepository); 53 | return true; 54 | 55 | } catch (ArtifactResolutionException e) { 56 | log.warn("can't resolve parent pom: " + e.getMessage()); 57 | } catch (ArtifactNotFoundException e) { 58 | log.info("can't resolve artifact: " + e.getMessage()); 59 | } 60 | 61 | return false; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/main/java/com/github/danielflower/mavenplugins/release/UnresolvedSnapshotDependencyException.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.release; 2 | 3 | public class UnresolvedSnapshotDependencyException extends Exception { 4 | public final String groupId; 5 | public final String artifactId; 6 | public final String version; 7 | 8 | public UnresolvedSnapshotDependencyException(String groupId, String artifactId, String version) { 9 | super("Could not find " + groupId + ":" + artifactId + ":" + version); 10 | this.groupId = groupId; 11 | this.artifactId = artifactId; 12 | this.version = version; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/github/danielflower/mavenplugins/release/ValidationException.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.release; 2 | 3 | import java.util.Arrays; 4 | import java.util.List; 5 | 6 | public class ValidationException extends Exception { 7 | private final List messages; 8 | 9 | public ValidationException(String summary, List messages) { 10 | super(summary); 11 | this.messages = messages; 12 | } 13 | 14 | public ValidationException(String summary, Throwable error) { 15 | super(summary); 16 | this.messages = Arrays.asList(summary, "" + error); 17 | } 18 | 19 | public List getMessages() { 20 | return messages; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/github/danielflower/mavenplugins/release/VersionName.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.release; 2 | 3 | public class VersionName { 4 | private final String version; 5 | private final long buildNumber; 6 | private final String developmentVersion; 7 | private final String delimiter; 8 | 9 | public VersionName(String developmentVersion, String version, long buildNumber, String delimiter) { 10 | Guard.notBlank("developmentVersion", developmentVersion); 11 | Guard.notBlank("version", version); 12 | Guard.notNull("buildNumber", buildNumber); 13 | this.version = version; 14 | this.buildNumber = buildNumber; 15 | this.developmentVersion = developmentVersion; 16 | this.delimiter = delimiter; 17 | } 18 | 19 | public VersionName(String developmentVersion, String version, long buildNumber) { 20 | this(developmentVersion, version, buildNumber, "."); 21 | } 22 | 23 | /** 24 | * For example, "1.0" if the development version is "1.0-SNAPSHOT" 25 | */ 26 | public String businessVersion() { 27 | return version; 28 | } 29 | 30 | public long buildNumber() { 31 | return buildNumber; 32 | } 33 | 34 | /** 35 | * The snapshot version, e.g. "1.0-SNAPSHOT" 36 | */ 37 | public String developmentVersion() { 38 | return developmentVersion; 39 | } 40 | 41 | /** 42 | * The business version with the build number appended, e.g. "1.0.1" 43 | */ 44 | public String releaseVersion() { 45 | return version + delimiter + buildNumber; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/com/github/danielflower/mavenplugins/release/VersionNamer.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.release; 2 | 3 | import org.apache.maven.plugins.annotations.Parameter; 4 | import org.eclipse.jgit.lib.Repository; 5 | 6 | import java.util.Collection; 7 | 8 | import static java.util.Arrays.asList; 9 | 10 | public class VersionNamer { 11 | 12 | /** 13 | *

14 | * The delimiter used to append the build number. 15 | *

16 | *

17 | * By default, it will use ".". However, for a three-digit version, a 18 | * dash ('-') is recommended to be in line with the maven versioning scheme. 19 | *

20 | *

21 | * This can be specified using a command line parameter ("-Ddelimiter=2") 22 | * or in this plugin's configuration. 23 | *

24 | */ 25 | @Parameter(property = "delimiter") 26 | private String delimiter; 27 | 28 | public VersionNamer(String delimiter) { 29 | this.delimiter = delimiter; 30 | } 31 | 32 | public VersionNamer() { 33 | this("."); 34 | } 35 | 36 | public VersionName name(String pomVersion, Long buildNumber, Collection previousBuildNumbers) throws ValidationException { 37 | 38 | if (buildNumber == null) { 39 | if (previousBuildNumbers.size() == 0) { 40 | buildNumber = 0L; 41 | } else { 42 | buildNumber = nextBuildNumber(previousBuildNumbers); 43 | } 44 | } 45 | 46 | VersionName versionName = new VersionName(pomVersion, pomVersion.replace("-SNAPSHOT", ""), buildNumber, this.delimiter); 47 | 48 | if (!Repository.isValidRefName("refs/tags/" + versionName.releaseVersion())) { 49 | String summary = "Sorry, '" + versionName.releaseVersion() + "' is not a valid version."; 50 | throw new ValidationException(summary, asList( 51 | summary, 52 | "Version numbers are used in the Git tag, and so can only contain characters that are valid in git tags.", 53 | "Please see https://www.kernel.org/pub/software/scm/git/docs/git-check-ref-format.html for tag naming rules." 54 | )); 55 | } 56 | return versionName; 57 | } 58 | 59 | private static long nextBuildNumber(Collection previousBuildNumbers) { 60 | long max = 0; 61 | for (Long buildNumber : previousBuildNumbers) { 62 | max = Math.max(max, buildNumber); 63 | } 64 | return max + 1; 65 | } 66 | 67 | String getDelimiter() { 68 | return delimiter; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/main/java/com/github/danielflower/mavenplugins/release/VersionReport.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.release; 2 | 3 | import org.apache.maven.plugin.logging.Log; 4 | import org.apache.maven.plugins.annotations.Parameter; 5 | import org.json.simple.JSONArray; 6 | import org.json.simple.JSONObject; 7 | 8 | import java.io.FileWriter; 9 | import java.io.IOException; 10 | import java.util.List; 11 | 12 | import static java.lang.String.format; 13 | 14 | public class VersionReport { 15 | 16 | /** 17 | * File format to use for @versionsReportFilePath 18 | */ 19 | @Parameter 20 | private VersionReportFormat versionsReportFormat; 21 | 22 | /** 23 | * If true then a report with all versions will be generated. 24 | */ 25 | @Parameter 26 | private String versionsReportFilePath; 27 | 28 | /** 29 | * If report should contain only released modules or all modules. 30 | */ 31 | @Parameter(alias = "releasedModulesOnly", defaultValue="false") 32 | private boolean releasedModulesOnly; 33 | 34 | public void generateVersionReport(Log log, List releasableModules) throws IOException { 35 | String res = ""; 36 | switch (versionsReportFormat) { 37 | case FLAT: 38 | for (ReleasableModule module : releasableModules) { 39 | if (skipModuleInReport(module)) continue; 40 | res += String.format("%s:%s%n", 41 | module.getArtifactId(), module.getVersionToDependOn()); 42 | } 43 | break; 44 | default: //JSON as default 45 | JSONObject jsonObject = new JSONObject(); 46 | JSONArray releasedModulesArray = new JSONArray(); 47 | 48 | for (ReleasableModule module : releasableModules) { 49 | if (skipModuleInReport(module)) continue; 50 | JSONObject releasedModuleObject = new JSONObject(); 51 | releasedModuleObject.put("name", module.getArtifactId()); 52 | releasedModuleObject.put("version", module.getVersionToDependOn()); 53 | releasedModulesArray.add(releasedModuleObject); 54 | } 55 | 56 | jsonObject.put("modules", releasedModulesArray); 57 | res = jsonObject.toJSONString(); 58 | break; 59 | } 60 | 61 | if (!res.equals("")) { 62 | try (FileWriter file = new FileWriter(versionsReportFilePath, true)) { 63 | file.write(res); 64 | log.info(format("Successfully written report file - %s", versionsReportFilePath)); 65 | } catch (IOException e) { 66 | log.warn(format("Failed to write report to file %nversionsReportFilePath=%s%ncontent=%s", 67 | versionsReportFilePath, res)); 68 | throw e; 69 | } 70 | } else { 71 | log.info(format("Nothing to write in report, versionsReportFilePath=%s", versionsReportFilePath)); 72 | } 73 | } 74 | 75 | private boolean skipModuleInReport(ReleasableModule module) { 76 | return (releasedModulesOnly && !module.willBeReleased()); 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /src/main/java/com/github/danielflower/mavenplugins/release/VersionReportFormat.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.release; 2 | 3 | public enum VersionReportFormat { 4 | JSON, FLAT; 5 | } 6 | -------------------------------------------------------------------------------- /src/site/fml/FAQ.fml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | Why this plugin 10 | 11 | 12 | Why not just use the default maven-release-plugin? 13 | 14 |

We found the built-in maven release plugin was falling short in the types of projects we were working on. Some specific issues:

15 |
    16 |
  • Performing commits during a release leads to a messy commit history and constant merges. Being able to make 17 | multiple releases without having to pull from the remote branch is rather liberating.
  • 18 |
  • It is too difficult to convince the built-in plugin to run tests only once.
  • 19 |
  • The maven-release-plugin relies on Git being available on the path, so this adds an unnecessary prerequisite on machines 20 | like build agents where you may not be able to install Git. Furthermore, the built-in plugin parses shell output from Git 21 | which makes it brittle: upgrading Git could sometimes break your builds. Because the multi-module-maven-release-plugin 22 | uses a Java implementation of Git, there is no dependency on Git being installed.
  • 23 |
24 |
25 |
26 | 27 |
28 | 29 | 30 | Building 31 | 32 | I have an aggregator pom which is separate from the parent pom. Do I declare the release plugin 33 | in the parent or the aggregator? 34 | You need to declare it in both poms unfortunately. The configuration in the parent pom will be ignored 35 | so should be left blank. All configuration should go into the aggregator. 36 | 37 | 38 | 39 | 40 | Source control 41 | 42 | 43 | 44 | Does the Git executable need to be installed? 45 | 46 | 47 |

48 | No. The jgit java implementation of Git is used meaning you do not need to have Git installed. 49 | This means you are free to use whichever version of Git you like without fear of compatibilty 50 | which sometimes happens with the default maven release plugin due to the way it interprets 51 | shell output of Git. 52 |

53 |
54 |
55 | 56 | 57 | 58 | Where do the tags get pushed? 59 | 60 | 61 |

The tags get pushed to the repo in the <scm> section of your pom, or if that is not specified 62 | then they will get pushed to origin. 63 |

64 |
65 |
66 |
67 | 68 |
-------------------------------------------------------------------------------- /src/site/markdown/https-authentication.md.vm: -------------------------------------------------------------------------------- 1 | ## Velocity treats double hashes as comments, which messes with markdown files. So $H can be used instead. 2 | #set( $H = '#' ) 3 | 4 | HTTPS authentication 5 | -------------------- 6 | 7 | To work with HTTPS authentication, you need to create a server entry in your machine's maven config, and 8 | then refer to this in the plugin config in your pom. 9 | 10 | $H$H$H Add server section to your Maven settings 11 | 12 | Add a server section to your Maven settings (normally in `~/.m2/settings.xml`) like this 13 | (see for further information): 14 | 15 | 16 | 17 | 18 | my-server 19 | your-username 20 | your-password 21 | 22 | 23 | 24 | 25 | For example, if using Github, the server ID could be `github` and the username and password would 26 | be your Github username and password. 27 | 28 | $H$H$H Configure the plugin 29 | 30 | Secondly, specify the `serverId` in the plugin configuration. 31 | 32 | 33 | ... 34 | 35 | my-server 36 | 37 | 38 | -------------------------------------------------------------------------------- /src/site/markdown/index.md.vm: -------------------------------------------------------------------------------- 1 | The Multi Module Maven Release Plugin for Git 2 | --------------------------------------------- 3 | 4 | This plugin is an alternative to the `maven-release-plugin` which was created with the following principles: 5 | 6 | * It should be trivial to release modules from a multi-module plugin, and only those modules that have changes should be released 7 | * No commits should be made to a repo during a release 8 | * Maven conventions such as developing against SNAPSHOT versions should be retained 9 | * Git should not need to be installed on the system. 10 | 11 | See the [introductory blog post](http://danielflower.github.io/2015/03/08/The-Multi-Module-Maven-Release-Plugin-for-Git.html) 12 | for more background. 13 | 14 | The plugin works with the idea that a software module has two types of versions: the "business version" and the 15 | "build number". The business version is used for semantic versioning, and may be something like "1.0", "1.1.0", etc. 16 | During development, the version in the pom is the business version with `-SNAPSHOT` appended. During a release, module 17 | version becomes `business-version.build-number` and this is what the repo is tagged with, and this is what the 18 | pom version becomes in the deployed artifact (however this version is not committed as a change to your pom). 19 | 20 | This plugin automatically generates build numbers, starting from 0 and incrementing each time, by looking at previous 21 | releases in the Git history. Alternatively, you can use a number that increments on each release - like your CI server's 22 | build number for example. 23 | 24 | Quickstart 25 | ---------- 26 | 27 | Add the following to your plugins section: 28 | 29 | 30 | ${project.groupId} 31 | ${project.artifactId} 32 | ${project.version} 33 | 34 | 35 | Release your project by running `mvn releaser:release` 36 | 37 | See [usage](usage.html) for more details. 38 | 39 | Differences with the maven-release-plugin 40 | ----------------------------------------- 41 | 42 | * Only Git is supported 43 | * Each module released will have a separate tag with its artifact ID and version so that it is easy to see when a 44 | version of a module was released 45 | * A module is only released if there are changes to it 46 | * The release version of the pom is not committed back to the repository 47 | * Tests are run once by default (or optionally not at all) 48 | 49 | Prerequisites 50 | ------------- 51 | 52 | The plugin requires **Maven ${project.prerequisites.maven}** or later and **Java 8** or later. If you need Java 6 support, 53 | then use version `1.4.6`. If you need Java 7 support, then use version `2.1.3`. 54 | -------------------------------------------------------------------------------- /src/site/markdown/ssh-authentication.md.vm: -------------------------------------------------------------------------------- 1 | ## Velocity treats double hashes as comments, which messes with markdown files. So $H can be used instead. 2 | #set( $H = '#' ) 3 | 4 | SSH authentication 5 | ------------------ 6 | 7 | Currently, only public key authentication is supported for SSH. By default, the plugin reads the private key from `~/.ssh/id_rsa`. 8 | If it's required to use a private key file from another location, you have two opportunities to achieve this: 9 | 10 | $H$H$H Add server section to your Maven settings 11 | 12 | This is the preferred way. Firstly, add a server section to your Maven settings 13 | like this (see for further information): 14 | 15 | 16 | 17 | 18 | my-server 19 | /path/to/your/private_key 20 | optional_passphrase 21 | 22 | 23 | 24 | 25 | If your key is password protected, specify the password within element **passphrase**. Tip: do _not confuse_ this with element **password**. 26 | 27 | Secondly, specify the `serverId` in the plugin configuration 28 | 29 | 30 | ... 31 | 32 | my-server 33 | 34 | 35 | 36 | 37 | $H$H$H Specify private key and optional passphrase in your POM 38 | 39 | This is the insecure way to specify your custom private key. Add following properties to your plugin configuration: 40 | 41 | 42 | ... 43 | 44 | /path/to/your/private_key 45 | optional_passphrase 46 | 47 | 48 | 49 | Note: POM configuration has precedence over Maven settings. 50 | 51 | $H$H$H Custom known_hosts 52 | 53 | Per default, the plugin uses `~/.ssh/known_hosts`. You can override this with following property in 54 | your plugin configuration: 55 | 56 | 57 | ... 58 | 59 | /path/to/your/known_hosts 60 | 61 | 62 | 63 | Note: Maven settings related to `known_hosts` will _not_ be considered by the plugin. -------------------------------------------------------------------------------- /src/site/site.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | org.apache.maven.skins 5 | maven-fluido-skin 6 | 2.0.1 7 | 8 | 9 | 10 | 11 | 12 | true 13 | true 14 | 15 | danielflower/multi-module-maven-release-plugin 16 | right 17 | gray 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /src/test/java/com/github/danielflower/mavenplugins/release/BaseMojoTest.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.release; 2 | 3 | import org.apache.maven.plugin.logging.Log; 4 | import org.apache.maven.settings.Server; 5 | import org.apache.maven.settings.Settings; 6 | import org.eclipse.jgit.transport.JschConfigSessionFactory; 7 | import org.junit.Before; 8 | import org.junit.Test; 9 | 10 | import static org.junit.Assert.assertEquals; 11 | import static org.mockito.Mockito.*; 12 | 13 | /** 14 | * @author Roland Hauser sourcepond@gmail.com 15 | * 16 | */ 17 | public class BaseMojoTest { 18 | private static final String KNOWN_HOSTS = "anyKnownHosts"; 19 | private static final String SERVER_ID = "anyServerId"; 20 | private static final String SETTINGS_IDENTITY_FILE = "settingsIdentityFile"; 21 | private static final String SETTINGS_PASSPHRASE = "settingsPassphrase"; 22 | private static final String POM_IDENTITY_FILE = "pomIdentityFile"; 23 | private static final String POM_PASSPHRASE = "pomPassphrase"; 24 | private final Log log = mock(Log.class); 25 | private final Settings settings = mock(Settings.class); 26 | private final Server server = mock(Server.class); 27 | private final BaseMojo mojo = mock(BaseMojo.class); 28 | 29 | @Before 30 | public void setup() { 31 | when(server.getPrivateKey()).thenReturn(SETTINGS_IDENTITY_FILE); 32 | when(server.getPassphrase()).thenReturn(SETTINGS_PASSPHRASE); 33 | when(settings.getServer(SERVER_ID)).thenReturn(server); 34 | mojo.setSettings(settings); 35 | JschConfigSessionFactory.setInstance(null); 36 | } 37 | 38 | @Test 39 | public void configureJsch_ServerIdDoesNotExist() { 40 | when(settings.getServer(SERVER_ID)).thenReturn(null); 41 | mojo.setServerId(SERVER_ID); 42 | mojo.configureJsch(log); 43 | verify(log).warn("No server configuration in Maven settings found with id anyServerId"); 44 | } 45 | 46 | @Test 47 | public void configureJsch_SshAgentDisabled() { 48 | mojo.disableSshAgent(); 49 | mojo.configureJsch(log); 50 | assertEquals("org.eclipse.jgit.transport.JschConfigSessionFactory", 51 | JschConfigSessionFactory.getInstance().getClass().getName()); 52 | } 53 | 54 | private void assertIdentity(final String identityFile, final String passphrase) { 55 | final SshAgentSessionFactory factory = (SshAgentSessionFactory) JschConfigSessionFactory.getInstance(); 56 | assertEquals(identityFile, factory.getIdentityFile()); 57 | assertEquals(passphrase, factory.getPassphraseOrNull()); 58 | } 59 | 60 | @Test 61 | public void configureJsch_PomIdentityFile() { 62 | mojo.setPrivateKey(POM_IDENTITY_FILE); 63 | mojo.setPassphrase(POM_PASSPHRASE); 64 | mojo.configureJsch(log); 65 | assertIdentity(POM_IDENTITY_FILE, POM_PASSPHRASE); 66 | } 67 | 68 | @Test 69 | public void configureJsch_SettingsIdentityFile() { 70 | mojo.setServerId(SERVER_ID); 71 | mojo.configureJsch(log); 72 | assertIdentity(SETTINGS_IDENTITY_FILE, SETTINGS_PASSPHRASE); 73 | } 74 | 75 | @Test 76 | public void configureJsch_CustomIdentityOverridesPom() { 77 | mojo.setServerId(SERVER_ID); 78 | mojo.setPrivateKey(POM_IDENTITY_FILE); 79 | mojo.configureJsch(log); 80 | assertIdentity(POM_IDENTITY_FILE, SETTINGS_PASSPHRASE); 81 | } 82 | 83 | @Test 84 | public void configureJsch_CustomPassphraseOverridesPom() { 85 | mojo.setServerId(SERVER_ID); 86 | mojo.setPassphrase(POM_PASSPHRASE); 87 | mojo.configureJsch(log); 88 | assertIdentity(SETTINGS_IDENTITY_FILE, POM_PASSPHRASE); 89 | } 90 | 91 | @Test 92 | public void configureJsch_CustomKnownHosts() { 93 | mojo.setKnownHosts(KNOWN_HOSTS); 94 | mojo.configureJsch(log); 95 | final SshAgentSessionFactory factory = (SshAgentSessionFactory) JschConfigSessionFactory.getInstance(); 96 | assertEquals(KNOWN_HOSTS, factory.getKnownHostsOrNull()); 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /src/test/java/com/github/danielflower/mavenplugins/release/LocalGitRepoTest.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.release; 2 | 3 | import org.eclipse.jgit.api.Git; 4 | import org.eclipse.jgit.api.errors.GitAPIException; 5 | import org.eclipse.jgit.lib.StoredConfig; 6 | import org.junit.Test; 7 | import scaffolding.TestProject; 8 | 9 | import java.util.ArrayList; 10 | import java.util.List; 11 | 12 | import static com.github.danielflower.mavenplugins.release.GitHelper.scmUrlToRemote; 13 | import static java.util.Arrays.asList; 14 | import static org.hamcrest.CoreMatchers.equalTo; 15 | import static org.hamcrest.CoreMatchers.is; 16 | import static org.hamcrest.MatcherAssert.assertThat; 17 | import static scaffolding.TestProject.dirToGitScmReference; 18 | 19 | public class LocalGitRepoTest { 20 | 21 | TestProject project = TestProject.singleModuleProject(); 22 | 23 | @Test 24 | public void canDetectLocalTags() throws GitAPIException { 25 | LocalGitRepo repo = new LocalGitRepo(project.local, new LocalTagFetcher(project.local), 26 | new LocalTagPusher(project.local)); 27 | tag(project.local, "some-tag"); 28 | assertThat(repo.hasLocalTag("some-tag"), is(true)); 29 | assertThat(repo.hasLocalTag("some-ta"), is(false)); 30 | assertThat(repo.hasLocalTag("some-tagyo"), is(false)); 31 | } 32 | 33 | @Test 34 | public void canDetectRemoteTags() throws Exception { 35 | LocalGitRepo repo = new LocalGitRepo(project.local, new RemoteTagFetcher(project.local, null, null), 36 | new LocalTagPusher(project.local)); 37 | tag(project.origin, "some-tag"); 38 | assertThat(repo.tagsFrom(tags("blah", "some-tag")), equalTo(asList("some-tag"))); 39 | assertThat(repo.tagsFrom(tags("blah", "some-taggart")), equalTo(emptyList())); 40 | } 41 | 42 | @Test 43 | public void usesThePassedInScmUrlToFindRemote() throws Exception { 44 | String remote = scmUrlToRemote(dirToGitScmReference(project.originDir)); 45 | LocalGitRepo repo = new LocalGitRepo(project.local, new RemoteTagFetcher(project.local, remote, null), 46 | new LocalTagPusher(project.local)); 47 | tag(project.origin, "some-tag"); 48 | 49 | StoredConfig config = project.local.getRepository().getConfig(); 50 | config.unsetSection("remote", "origin"); 51 | config.save(); 52 | 53 | assertThat(repo.tagsFrom(tags("blah", "some-tag")), equalTo(asList("some-tag"))); 54 | } 55 | 56 | @Test 57 | public void canHaveManyTags() throws GitAPIException { 58 | int numberOfTags = 50; // setting this to 1000 works but takes too long 59 | for (int i = 0; i < numberOfTags; i++) { 60 | tag(project.local, "this-is-a-tag-" + i); 61 | } 62 | project.local.push().setPushTags().call(); 63 | LocalGitRepo repo = new LocalGitRepo(project.local, new LocalTagFetcher(project.local), 64 | new LocalTagPusher(project.local)); 65 | for (int i = 0; i < numberOfTags; i++) { 66 | String tagName = "this-is-a-tag-" + i; 67 | assertThat(repo.hasLocalTag(tagName), is(true)); 68 | assertThat(repo.tagsFrom(tags(tagName)).size(), is(1)); 69 | } 70 | } 71 | 72 | private static List tags(String... tagNames) { 73 | List tags = new ArrayList(); 74 | for (String tagName : tagNames) { 75 | tags.add(AnnotatedTag.create(tagName, "1", 0)); 76 | } 77 | return tags; 78 | } 79 | private static List emptyList() { 80 | return new ArrayList(); 81 | } 82 | 83 | private static void tag(Git repo, String name) throws GitAPIException { 84 | repo.tag().setAnnotated(true).setName(name).setMessage("Some message").call(); 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /src/test/java/com/github/danielflower/mavenplugins/release/ReactorTest.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.release; 2 | 3 | import org.apache.maven.plugin.MojoExecutionException; 4 | import org.apache.maven.project.MavenProject; 5 | import org.junit.Assert; 6 | import org.junit.Test; 7 | 8 | import java.io.IOException; 9 | import java.util.Collection; 10 | import java.util.List; 11 | import java.util.Optional; 12 | 13 | import static java.util.Arrays.asList; 14 | import static org.hamcrest.CoreMatchers.*; 15 | import static org.hamcrest.MatcherAssert.assertThat; 16 | import static scaffolding.ReleasableModuleBuilder.aModule; 17 | 18 | public class ReactorTest { 19 | 20 | @Test 21 | public void canFindModulesByGroupAndArtifactName() throws Exception { 22 | ReleasableModule arty = aModule().withGroupId("my.great.group").withArtifactId("some-arty").build(); 23 | Reactor reactor = new Reactor(asList( 24 | aModule().build(), arty, aModule().build() 25 | )); 26 | assertThat(reactor.find("my.great.group", "some-arty", "1.0-SNAPSHOT"), is(arty)); 27 | assertThat(reactor.findByLabel("my.great.group:some-arty"), is(arty)); 28 | } 29 | 30 | @Test 31 | public void findOrReturnNullReturnsNullIfNotFound() throws Exception { 32 | Reactor reactor = new Reactor(asList( 33 | aModule().build(), aModule().build() 34 | )); 35 | assertThat(reactor.findByLabel("my.great.group:some-arty"), is(nullValue())); 36 | } 37 | 38 | @Test 39 | public void ifNotFoundThenAUnresolvedSnapshotDependencyExceptionIsThrown() throws Exception { 40 | Reactor reactor = new Reactor(asList( 41 | aModule().build(), aModule().build() 42 | )); 43 | try { 44 | reactor.find("my.great.group", "some-arty", "1.0-SNAPSHOT"); 45 | Assert.fail("Should have thrown"); 46 | } catch (UnresolvedSnapshotDependencyException e) { 47 | assertThat(e.getMessage(), equalTo("Could not find my.great.group:some-arty:1.0-SNAPSHOT")); 48 | } 49 | } 50 | 51 | @Test 52 | public void returnsTheLatestTagIfThereAreChanges() throws MojoExecutionException { 53 | AnnotatedTag onePointNine = AnnotatedTag.create("whatever-1.1.9", "1.1", 9); 54 | AnnotatedTag onePointTen = AnnotatedTag.create("whatever-1.1.10", "1.1", 10); 55 | assertThat(Reactor.hasChangedSinceLastRelease(asList(onePointNine, onePointTen), new NeverChanged(), new MavenProject(), "whatever"), is(onePointTen)); 56 | assertThat(Reactor.hasChangedSinceLastRelease(asList(onePointTen, onePointNine), new NeverChanged(), new MavenProject(), "whatever"), is(onePointTen)); 57 | } 58 | 59 | private static class NeverChanged implements DiffDetector { 60 | @Override 61 | public boolean hasChangedSince(String modulePath, List childModules, Collection tags) throws IOException { 62 | return false; 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/test/java/com/github/danielflower/mavenplugins/release/ReleasableModuleTest.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.release; 2 | 3 | import org.apache.maven.project.MavenProject; 4 | import org.junit.Test; 5 | 6 | import static org.hamcrest.CoreMatchers.is; 7 | import static org.hamcrest.MatcherAssert.assertThat; 8 | import static org.hamcrest.core.IsEqual.equalTo; 9 | import static scaffolding.ReleasableModuleBuilder.aModule; 10 | 11 | public class ReleasableModuleTest { 12 | @Test 13 | public void getsTheTagFromTheArtifactAndVersion() throws Exception { 14 | ReleasableModule module = aModule() 15 | .withArtifactId("my-artifact") 16 | .withSnapshotVersion("1.0-SNAPSHOT") 17 | .withBuildNumber(123) 18 | .build(); 19 | assertThat(module.getTagName(), equalTo("my-artifact-1.0.123")); 20 | } 21 | 22 | @Test 23 | public void aReleaseableModuleCanBeCreatedFromAnUnreleasableOne() { 24 | MavenProject project = new MavenProject(); 25 | project.setArtifactId("some-arty"); 26 | project.setGroupId("some-group"); 27 | ReleasableModule first = new ReleasableModule( 28 | project, new VersionName("1.2.3-SNAPSHOT", "1.2.3", 12), "1.2.3.11", "somewhere", null, null 29 | ); 30 | assertThat(first.willBeReleased(), is(false)); 31 | 32 | ReleasableModule changed = first.createReleasableVersion(null); 33 | assertThat(changed.getArtifactId(), equalTo("some-arty")); 34 | assertThat(changed.getBuildNumber(), equalTo(12L)); 35 | assertThat(changed.getGroupId(), equalTo("some-group")); 36 | assertThat(changed.getNewVersion(), equalTo("1.2.3.12")); 37 | assertThat(changed.getProject(), is(project)); 38 | assertThat(changed.getRelativePathToModule(), equalTo("somewhere")); 39 | assertThat(changed.willBeReleased(), is(true)); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/test/java/com/github/danielflower/mavenplugins/release/SshAgentSessionFactoryTest.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.release; 2 | 3 | import com.jcraft.jsch.HostKey; 4 | import com.jcraft.jsch.JSch; 5 | import org.apache.maven.plugin.logging.Log; 6 | import org.eclipse.jgit.util.FS; 7 | import org.junit.Test; 8 | 9 | import java.io.File; 10 | import java.net.URL; 11 | 12 | import static java.lang.String.format; 13 | import static org.junit.Assert.assertEquals; 14 | import static org.junit.Assert.assertNotNull; 15 | import static org.mockito.Mockito.mock; 16 | 17 | /** 18 | * @author Roland Hauser sourcepond@gmail.com 19 | * 20 | */ 21 | public class SshAgentSessionFactoryTest { 22 | private static final String KNOWN_HOSTS = "known_hosts"; 23 | private final Log log = mock(Log.class); 24 | private final FS fs = mock(FS.class); 25 | 26 | private String getFile(final String name) throws Exception { 27 | final URL url = getClass().getResource("/" + name); 28 | assertNotNull(format("File {} not found", name), url); 29 | return new File(url.toURI()).getAbsolutePath(); 30 | } 31 | 32 | @Test 33 | public void createDefaultJSch_WithKnownHosts() throws Exception { 34 | final SshAgentSessionFactory factory = new SshAgentSessionFactory(log, KNOWN_HOSTS, null, null); 35 | factory.setKnownHosts(getFile(KNOWN_HOSTS)); 36 | final JSch jsch = factory.createDefaultJSch(fs); 37 | final HostKey[] keys = jsch.getHostKeyRepository().getHostKey("github.com", "ssh-rsa"); 38 | assertEquals(1, keys.length); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/test/java/com/github/danielflower/mavenplugins/release/VersionNamerTest.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.release; 2 | 3 | import org.junit.Test; 4 | 5 | import java.util.ArrayList; 6 | import java.util.List; 7 | 8 | import static java.util.Arrays.asList; 9 | import static org.hamcrest.CoreMatchers.hasItems; 10 | import static org.hamcrest.CoreMatchers.is; 11 | import static org.hamcrest.MatcherAssert.assertThat; 12 | import static org.hamcrest.core.IsEqual.equalTo; 13 | 14 | public class VersionNamerTest { 15 | 16 | private final VersionNamer namer = new VersionNamer(); 17 | 18 | @Test 19 | public void removesTheSnapshotAndSticksTheBuildNumberOnTheEnd() throws Exception { 20 | assertThat(namer.name("1.0-SNAPSHOT", 123L, null).releaseVersion(), is(equalTo("1.0.123"))); 21 | } 22 | 23 | @Test 24 | public void ifTheBuildNumberIsNullAndThePreviousBuildNumbersIsEmptyListThenZeroIsUsed() throws Exception { 25 | assertThat(namer.name("1.0-SNAPSHOT", null, new ArrayList()).releaseVersion(), is(equalTo("1.0.0"))); 26 | } 27 | 28 | @Test 29 | public void ifTheBuildNumberIsNullButThereIsAPreviousBuildNumbersThenThatValueIsIncremented() throws Exception { 30 | assertThat(namer.name("1.0-SNAPSHOT", null, asList(9L, 10L, 8L)).releaseVersion(), is(equalTo("1.0.11"))); 31 | } 32 | 33 | @Test 34 | public void throwsIfTheVersionWouldNotBeAValidGitTag() { 35 | assertThat(errorMessageOf("1.0-A : yeah /-SNAPSHOT", 0), 36 | hasItems( 37 | "Sorry, '1.0-A : yeah /.0' is not a valid version.", 38 | "Please see https://www.kernel.org/pub/software/scm/git/docs/git-check-ref-format.html for tag naming rules." 39 | ) 40 | ); 41 | } 42 | 43 | @Test 44 | public void addsTheBuildWithADash() throws Exception { 45 | assertThat(new VersionNamer("-").name("1.0.0-SNAPSHOT", 123L, null).releaseVersion(), is(equalTo("1.0.0-123"))); 46 | } 47 | 48 | @Test 49 | public void getterReturnsDefinedOrDefaultDelimiter() { 50 | assertThat(new VersionNamer("-").getDelimiter(), is("-")); 51 | assertThat(new VersionNamer("@").getDelimiter(), is("@")); 52 | assertThat(new VersionNamer().getDelimiter(), is(".")); 53 | } 54 | 55 | private List errorMessageOf(String pomVersion, long buildNumber) { 56 | try { 57 | namer.name(pomVersion, buildNumber, null); 58 | throw new AssertionError("Did not throw an error"); 59 | } catch (ValidationException ex) { 60 | return ex.getMessages(); 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/test/java/e2e/DifferentDelimiterTest.java: -------------------------------------------------------------------------------- 1 | package e2e; 2 | 3 | import org.apache.maven.shared.invoker.MavenInvocationException; 4 | import org.junit.BeforeClass; 5 | import org.junit.Ignore; 6 | import org.junit.Test; 7 | import scaffolding.MvnRunner; 8 | import scaffolding.TestProject; 9 | 10 | import java.io.File; 11 | import java.util.List; 12 | 13 | import static org.hamcrest.CoreMatchers.containsString; 14 | import static org.hamcrest.CoreMatchers.is; 15 | import static org.hamcrest.MatcherAssert.assertThat; 16 | import static scaffolding.ExactCountMatcher.oneOf; 17 | 18 | public class DifferentDelimiterTest { 19 | 20 | final String buildNumber = String.valueOf(System.currentTimeMillis()); 21 | final String expected = "1.0.0-" + buildNumber; 22 | final TestProject testProject = TestProject.differentDelimiterProject(); 23 | 24 | @BeforeClass 25 | public static void installPluginToLocalRepo() throws MavenInvocationException { 26 | MvnRunner.installReleasePluginToLocalRepo(); 27 | } 28 | 29 | @Test 30 | public void canUpdateSnapshotVersionToReleaseVersionAndInstallToLocalRepo() throws Exception { 31 | List outputLines = testProject.mvnRelease(buildNumber); 32 | assertThat(outputLines, oneOf(containsString("Hello from version " + expected + "!"))); 33 | 34 | MvnRunner.assertArtifactInLocalRepo("com.github.danielflower.mavenplugins.testprojects", "different-delimiter", expected); 35 | 36 | assertThat(new File(testProject.localDir, "target/different-delimiter-" + expected + "-package.jar").exists(), is(true)); 37 | } 38 | 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/test/java/e2e/ExecutionTest.java: -------------------------------------------------------------------------------- 1 | package e2e; 2 | 3 | import org.apache.maven.shared.invoker.MavenInvocationException; 4 | import org.junit.BeforeClass; 5 | import org.junit.Ignore; 6 | import org.junit.Test; 7 | import scaffolding.MvnRunner; 8 | import scaffolding.TestProject; 9 | 10 | import java.io.File; 11 | import java.util.List; 12 | 13 | import static org.hamcrest.CoreMatchers.containsString; 14 | import static org.hamcrest.MatcherAssert.assertThat; 15 | import static scaffolding.ExactCountMatcher.noneOf; 16 | import static scaffolding.ExactCountMatcher.oneOf; 17 | 18 | public class ExecutionTest { 19 | 20 | final TestProject testProject = TestProject.moduleWithProfilesProject(); 21 | final String echoPluginOutput = "echo-maven-plugin running because profileActivatedByReleasePlugin is activated"; 22 | 23 | @BeforeClass 24 | public static void installPluginToLocalRepo() throws MavenInvocationException { 25 | MvnRunner.installReleasePluginToLocalRepo(); 26 | } 27 | 28 | @Test 29 | public void profilesNotPassedToTheReleaseExecutionAreNotPassedOnToTheDeploymentButConfiguredProfilesAre() throws Exception { 30 | List consoleOutput = testProject.mvnRelease("1"); 31 | assertThat(consoleOutput, noneOf(containsString("The module-with-profiles test has run"))); 32 | assertThat(consoleOutput, oneOf(containsString(echoPluginOutput))); 33 | } 34 | 35 | @Test 36 | public void profilesPassedToTheReleaseExecutionArePassedOnToTheDeployment() throws Exception { 37 | List consoleOutput = testProject.mvn("-DbuildNumber=1", "releaser:release", "-P runTestsProfile"); 38 | assertThat(consoleOutput, oneOf(containsString("The module-with-profiles test has run"))); 39 | assertThat(consoleOutput, oneOf(containsString(echoPluginOutput))); 40 | } 41 | 42 | @Test 43 | public void argumentsCanBePassed() throws Exception { 44 | List consoleOutput = testProject.mvn("releaser:release", "-P runTestsProfile"); 45 | assertThat(consoleOutput, oneOf(containsString("this is a system property: prop 1 value and prop2value"))); 46 | } 47 | 48 | @Test 49 | public void envVarsAreInherited() throws Exception { 50 | List consoleOutput = testProject.mvn("releaser:release", "-P runTestsProfile"); 51 | assertThat(consoleOutput, oneOf(containsString("this is an env var: whatever"))); 52 | } 53 | 54 | @Test 55 | public void mvn_optionsEnvVarIsPassedToExecution() throws Exception { 56 | testProject.setMvnOpts("-Dmvnopt=a-maven-option"); 57 | List consoleOutput = testProject.mvn("releaser:release", "-P runTestsProfile"); 58 | assertThat(consoleOutput, oneOf(containsString("this is a property set via MAVEN_OPTS: a-maven-option"))); 59 | } 60 | 61 | @Test 62 | public void userAndGlobalSettingsCanBeOverwrittenWithStandardMavenCommandLineParameters() throws Exception { 63 | File globalSettings = new File("test-projects/module-with-profiles/custom-settings.xml"); 64 | List consoleOutput = testProject.mvn("-DbuildNumber=1", 65 | "releaser:release", "-gs", globalSettings.getCanonicalPath()); 66 | assertThat(consoleOutput, oneOf(containsString(echoPluginOutput))); 67 | assertThat(consoleOutput, oneOf(containsString("value-from-settings-file"))); 68 | } 69 | 70 | 71 | } 72 | -------------------------------------------------------------------------------- /src/test/java/e2e/GitRelatedTest.java: -------------------------------------------------------------------------------- 1 | package e2e; 2 | 3 | import org.apache.commons.io.FileUtils; 4 | import org.apache.maven.shared.invoker.MavenInvocationException; 5 | import org.eclipse.jgit.api.errors.GitAPIException; 6 | import org.eclipse.jgit.lib.StoredConfig; 7 | import org.junit.Assert; 8 | import org.junit.BeforeClass; 9 | import org.junit.Ignore; 10 | import org.junit.Test; 11 | import scaffolding.MavenExecutionException; 12 | import scaffolding.MvnRunner; 13 | import scaffolding.Photocopier; 14 | import scaffolding.TestProject; 15 | 16 | import java.io.File; 17 | import java.io.IOException; 18 | 19 | import static org.hamcrest.CoreMatchers.containsString; 20 | import static org.hamcrest.MatcherAssert.assertThat; 21 | import static scaffolding.ExactCountMatcher.oneOf; 22 | import static scaffolding.ExactCountMatcher.twoOf; 23 | 24 | public class GitRelatedTest { 25 | 26 | @BeforeClass 27 | public static void installPluginToLocalRepo() throws MavenInvocationException, IOException, GitAPIException { 28 | MvnRunner.installReleasePluginToLocalRepo(); 29 | 30 | } 31 | 32 | @Test 33 | public void ifTheReleaseIsRunFromANonGitRepoThenAnErrorIsClearlyDisplayed() throws IOException { 34 | File projectRoot = Photocopier.copyTestProjectToTemporaryLocation("single-module"); 35 | TestProject.performPomSubstitution(projectRoot); 36 | try { 37 | new MvnRunner().runMaven(projectRoot, "releaser:release"); 38 | Assert.fail("Should have failed"); 39 | } catch (MavenExecutionException e) { 40 | assertThat(e.output, twoOf(containsString("Releases can only be performed from Git repositories."))); 41 | assertThat(e.output, oneOf(containsString(projectRoot.getCanonicalPath() + " is not a Git repository."))); 42 | } 43 | } 44 | 45 | @Test 46 | public void ifThereIsNoScmInfoAndNoRemoteBranchThenAnErrorIsThrown() throws GitAPIException, IOException, InterruptedException { 47 | TestProject testProject = TestProject.singleModuleProject(); 48 | 49 | StoredConfig config = testProject.local.getRepository().getConfig(); 50 | config.unsetSection("remote", "origin"); 51 | config.save(); 52 | 53 | try { 54 | testProject.mvnRelease("1"); 55 | Assert.fail("Should have failed"); 56 | } catch (MavenExecutionException e) { 57 | assertThat(e.output, oneOf(containsString("[ERROR] origin: not found."))); 58 | } 59 | } 60 | 61 | @Test 62 | public void ifTheScmIsSpecifiedButIsNotGitThenThisIsThrown() throws GitAPIException, IOException, InterruptedException { 63 | TestProject testProject = TestProject.moduleWithScmTag(); 64 | File pom = new File(testProject.localDir, "pom.xml"); 65 | String xml = FileUtils.readFileToString(pom, "UTF-8"); 66 | xml = xml.replace("scm:git:", "scm:svn:"); 67 | FileUtils.writeStringToFile(pom, xml, "UTF-8"); 68 | testProject.local.add().addFilepattern("pom.xml").call(); 69 | testProject.local.commit().setMessage("Changing pom for test").call(); 70 | 71 | try { 72 | testProject.mvnRelease("1"); 73 | Assert.fail("Should have failed"); 74 | } catch (MavenExecutionException e) { 75 | assertThat(e.output, twoOf(containsString("Cannot run the release plugin with a non-Git version control system"))); 76 | assertThat(e.output, oneOf(containsString("The value in your scm tag is scm:svn:"))); 77 | } 78 | } 79 | 80 | @Test 81 | public void ifThereIsNoRemoteButTheScmDetailsArePresentThenThisIsUsed() throws GitAPIException, IOException, InterruptedException { 82 | TestProject testProject = TestProject.moduleWithScmTag(); 83 | 84 | StoredConfig config = testProject.local.getRepository().getConfig(); 85 | config.unsetSection("remote", "origin"); 86 | config.save(); 87 | 88 | testProject.mvnRelease("1"); 89 | } 90 | 91 | } 92 | -------------------------------------------------------------------------------- /src/test/java/e2e/HelpTest.java: -------------------------------------------------------------------------------- 1 | package e2e; 2 | 3 | import org.apache.maven.shared.invoker.MavenInvocationException; 4 | import org.eclipse.jgit.api.errors.GitAPIException; 5 | import org.hamcrest.CoreMatchers; 6 | import org.hamcrest.Matcher; 7 | import org.junit.BeforeClass; 8 | import org.junit.Test; 9 | import scaffolding.MvnRunner; 10 | import scaffolding.TestProject; 11 | 12 | import java.io.IOException; 13 | import java.util.ArrayList; 14 | import java.util.List; 15 | 16 | import static org.hamcrest.CoreMatchers.allOf; 17 | import static org.hamcrest.CoreMatchers.containsString; 18 | import static org.hamcrest.MatcherAssert.assertThat; 19 | 20 | public class HelpTest { 21 | 22 | private static final String multi_module_release_help = "releaser:help"; 23 | private static TestProject someProject; 24 | 25 | @BeforeClass 26 | public static void installPluginToLocalRepo() throws MavenInvocationException, IOException, GitAPIException { 27 | MvnRunner.installReleasePluginToLocalRepo(); 28 | someProject = TestProject.singleModuleProject(); 29 | } 30 | 31 | @Test 32 | public void runningTheHelpMojoTellsYouAboutThePlugin() throws IOException { 33 | assertThat( 34 | mvn(multi_module_release_help), 35 | containsStrings( 36 | "This plugin has 3 goals:", 37 | "releaser:release", 38 | "releaser:help", 39 | multi_module_release_help)); 40 | } 41 | 42 | private List mvn(String... commands) throws IOException { 43 | return new MvnRunner().runMaven(someProject.localDir, commands); 44 | } 45 | 46 | @Test 47 | public void canShowInformationAboutTheReleaseGoal() throws IOException { 48 | assertThat( 49 | mvn(multi_module_release_help, "-Dgoal=release", "-Ddetail=true"), 50 | containsStrings( 51 | "The goals to run against the project during a release", 52 | "The build number to use in the release version")); 53 | } 54 | 55 | private static Matcher> containsStrings(String... strings) { 56 | List>> matchers = new ArrayList<>(); 57 | for (String s : strings) 58 | matchers.add(CoreMatchers.hasItem(containsString(s))); 59 | 60 | return allOf((Iterable) matchers); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/test/java/e2e/JGitDiscoveryTest.java: -------------------------------------------------------------------------------- 1 | package e2e; 2 | 3 | import org.apache.maven.project.MavenProject; 4 | import org.apache.maven.project.ProjectSorter; 5 | import org.apache.maven.shared.invoker.MavenInvocationException; 6 | import org.eclipse.jgit.api.Git; 7 | import org.eclipse.jgit.api.errors.GitAPIException; 8 | import org.eclipse.jgit.diff.DiffEntry; 9 | import org.eclipse.jgit.internal.storage.file.FileRepository; 10 | import org.eclipse.jgit.lib.ObjectId; 11 | import org.eclipse.jgit.lib.ObjectReader; 12 | import org.eclipse.jgit.lib.Repository; 13 | import org.eclipse.jgit.revwalk.RevCommit; 14 | import org.eclipse.jgit.treewalk.CanonicalTreeParser; 15 | import org.hamcrest.Matchers; 16 | import org.junit.*; 17 | 18 | import java.io.File; 19 | import java.io.IOException; 20 | import java.util.ArrayList; 21 | import java.util.List; 22 | 23 | public class JGitDiscoveryTest { 24 | @BeforeClass 25 | public static void installPluginToLocalRepo() throws MavenInvocationException { 26 | Assume.assumeThat(System.getenv("CI"), Matchers.nullValue()); 27 | } 28 | 29 | Repository repo; 30 | 31 | @Before public void locateRepo() throws IOException { 32 | repo = new FileRepository(findSubFolder(".git")); 33 | } 34 | 35 | @After public void closeRepo() { 36 | repo.close(); 37 | } 38 | 39 | @Test public void showMeTheLog() throws IOException, GitAPIException { 40 | Git git = new Git(repo); 41 | Iterable log = git.log().call(); 42 | for (RevCommit revCommit : log) 43 | System.out.println(revCommit.getFullMessage().trim()); 44 | } 45 | 46 | @Test public void blah() throws Exception { 47 | ArrayList projects = new ArrayList(); 48 | projects.add(new MavenProject()); 49 | new ProjectSorter(projects); 50 | } 51 | 52 | @Test public void name() throws IOException, GitAPIException { 53 | ObjectId head = repo.resolve("HEAD^{tree}"); 54 | ObjectId oldHead = repo.resolve("HEAD^^{tree}"); 55 | 56 | 57 | ObjectReader reader = repo.newObjectReader(); 58 | 59 | CanonicalTreeParser prevParser = new CanonicalTreeParser(); 60 | prevParser.reset(reader, oldHead); 61 | 62 | CanonicalTreeParser headParser = new CanonicalTreeParser(); 63 | headParser.reset(reader, head); 64 | 65 | List diffs = new Git(repo).diff() 66 | .setNewTree(headParser) 67 | .setOldTree(prevParser) 68 | .call(); 69 | 70 | for (DiffEntry entry : diffs) 71 | System.out.println(entry); 72 | } 73 | 74 | private File findSubFolder(String subFolder) { 75 | return findFolder(new File(".").getAbsoluteFile(), subFolder); 76 | } 77 | 78 | private File findFolder(File folder, String subFolder) { 79 | File candidateFolder = new File(folder, subFolder); 80 | return candidateFolder.exists() && candidateFolder.isDirectory() ? candidateFolder : findFolder(folder.getParentFile(), subFolder); 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /src/test/java/e2e/LocalPluginTest.java: -------------------------------------------------------------------------------- 1 | package e2e; 2 | 3 | import org.junit.BeforeClass; 4 | import org.junit.Ignore; 5 | import org.junit.Test; 6 | import scaffolding.MavenExecutionException; 7 | import scaffolding.MvnRunner; 8 | import scaffolding.TestProject; 9 | 10 | import java.util.List; 11 | 12 | import static org.hamcrest.CoreMatchers.containsString; 13 | import static org.hamcrest.MatcherAssert.assertThat; 14 | import static scaffolding.ExactCountMatcher.oneOf; 15 | import static scaffolding.ExactCountMatcher.twoOf; 16 | import static scaffolding.GitMatchers.hasTag; 17 | 18 | public class LocalPluginTest { 19 | 20 | final TestProject testProject = TestProject.localPluginProject(); 21 | 22 | final String buildNumber = String.valueOf(System.currentTimeMillis()); 23 | final String expected = "1.0." + buildNumber; 24 | 25 | @BeforeClass 26 | public static void installPluginToLocalRepo() { 27 | MvnRunner.installReleasePluginToLocalRepo(); 28 | } 29 | 30 | @Test 31 | public void runWithLocalPluginSnapshotDependencyShouldSucceed() throws Exception { 32 | List outputLines = testProject.mvn("releaser:release", "-DbuildNumber=" + buildNumber); 33 | 34 | for (String line : outputLines) 35 | System.out.println(line); 36 | 37 | //Validate released artifacts 38 | assertThat(testProject.local, hasTag("local-plugin-" + expected)); 39 | assertThat(testProject.local, hasTag("local-maven-plugin-" + expected)); 40 | assertThat(testProject.local, hasTag("simple-project-" + expected)); 41 | 42 | //Validate plugin dependencies updated (once for plugin itself, once for pluginManagement) 43 | assertThat( 44 | outputLines, 45 | twoOf(containsString("Plugin dependency on local-maven-plugin rewritten to version " + expected))); 46 | } 47 | 48 | @Test 49 | public void runWithSnapshotPluginDependencyShouldFail() throws Exception { 50 | try { 51 | testProject.mvn("releaser:release", "-P snapshot-version"); 52 | } catch (MavenExecutionException mee) { 53 | assertThat(mee.output, oneOf(containsString("[ERROR] * simple-project references plugin commons-io 2.7-SNAPSHOT"))); 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/test/java/e2e/MavenCompatibilityTest.java: -------------------------------------------------------------------------------- 1 | package e2e; 2 | 3 | import org.apache.maven.shared.invoker.MavenInvocationException; 4 | import org.hamcrest.Matchers; 5 | import org.junit.Assume; 6 | import org.junit.BeforeClass; 7 | import org.junit.Ignore; 8 | import org.junit.Test; 9 | import scaffolding.MvnRunner; 10 | import scaffolding.TestProject; 11 | 12 | import java.io.File; 13 | import java.io.IOException; 14 | 15 | import static org.hamcrest.CoreMatchers.is; 16 | import static org.hamcrest.MatcherAssert.assertThat; 17 | 18 | /** 19 | * This test actually downloads multiple versions of maven and runs the plugin against them. 20 | */ 21 | public class MavenCompatibilityTest { 22 | 23 | final TestProject testProject = TestProject.singleModuleProject(); 24 | 25 | @BeforeClass 26 | public static void installPluginToLocalRepo() throws MavenInvocationException { 27 | Assume.assumeThat(System.getenv("CI"), Matchers.nullValue()); 28 | MvnRunner.installReleasePluginToLocalRepo(); 29 | } 30 | 31 | @Test 32 | public void maven_3_0_1() throws Exception { 33 | buildProjectWithMavenVersion("3.0.1"); 34 | } 35 | 36 | @Test 37 | public void maven_3_0_4() throws Exception { 38 | buildProjectWithMavenVersion("3.0.4"); 39 | } 40 | 41 | @Test 42 | public void maven_3_2_1() throws Exception { 43 | buildProjectWithMavenVersion("3.2.1"); 44 | } 45 | 46 | @Test 47 | public void maven_3_3_9() throws Exception { 48 | buildProjectWithMavenVersion("3.3.9"); 49 | } 50 | 51 | @Test 52 | public void maven_3_8_4() throws Exception { 53 | buildProjectWithMavenVersion("3.8.4"); 54 | } 55 | 56 | private void buildProjectWithMavenVersion(String mavenVersionToTest) throws IOException, InterruptedException, MavenInvocationException { 57 | String buildNumber = mavenVersionToTest.replace(".", "") + System.currentTimeMillis(); 58 | String expected = "1.0." + buildNumber; 59 | testProject.setMvnRunner(MvnRunner.mvn(mavenVersionToTest)); 60 | testProject.mvnRelease(buildNumber); 61 | MvnRunner.assertArtifactInLocalRepo("com.github.danielflower.mavenplugins.testprojects", "single-module", expected); 62 | assertThat(new File(testProject.localDir, "target/single-module-" + expected + "-package.jar").exists(), is(true)); 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /src/test/java/e2e/TestRunningTest.java: -------------------------------------------------------------------------------- 1 | package e2e; 2 | 3 | import org.apache.maven.shared.invoker.MavenInvocationException; 4 | import org.junit.Assert; 5 | import org.junit.BeforeClass; 6 | import org.junit.Ignore; 7 | import org.junit.Test; 8 | import scaffolding.MavenExecutionException; 9 | import scaffolding.MvnRunner; 10 | import scaffolding.TestProject; 11 | 12 | import java.io.IOException; 13 | 14 | import static org.hamcrest.CoreMatchers.is; 15 | import static org.hamcrest.MatcherAssert.assertThat; 16 | import static scaffolding.GitMatchers.hasCleanWorkingDirectory; 17 | 18 | public class TestRunningTest { 19 | final TestProject projectWithTestsThatFail = TestProject.moduleWithTestFailure(); 20 | 21 | @BeforeClass 22 | public static void installPluginToLocalRepo() throws MavenInvocationException { 23 | MvnRunner.installReleasePluginToLocalRepo(); 24 | } 25 | 26 | @Test 27 | public void doesNotReleaseIfThereAreTestFailuresButTagsAreStillWritten() throws Exception { 28 | try { 29 | projectWithTestsThatFail.mvnRelease("1"); 30 | Assert.fail("Should have failed"); 31 | } catch (MavenExecutionException e) { 32 | 33 | } 34 | assertThat(projectWithTestsThatFail.local, hasCleanWorkingDirectory()); 35 | assertThat(projectWithTestsThatFail.local.tagList().call().get(0).getName(), is("refs/tags/module-with-test-failure-1.0.1")); 36 | assertThat(projectWithTestsThatFail.origin.tagList().call().get(0).getName(), is("refs/tags/module-with-test-failure-1.0.1")); 37 | } 38 | 39 | @Test 40 | public void ifTestsAreSkippedYouCanReleaseWithoutRunningThem() throws IOException { 41 | projectWithTestsThatFail.mvn( 42 | "-DbuildNumber=1", "-DskipTests", 43 | "releaser:release"); 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/test/java/e2e/VersionsReportTest.java: -------------------------------------------------------------------------------- 1 | package e2e; 2 | 3 | import org.apache.maven.shared.invoker.MavenInvocationException; 4 | import org.junit.BeforeClass; 5 | import org.junit.Ignore; 6 | import org.junit.Test; 7 | 8 | import java.io.File; 9 | import java.io.IOException; 10 | import java.nio.charset.Charset; 11 | import java.nio.file.Files; 12 | import java.util.Arrays; 13 | import java.util.List; 14 | 15 | import scaffolding.MvnRunner; 16 | import scaffolding.TestProject; 17 | 18 | import static org.hamcrest.CoreMatchers.allOf; 19 | import static org.hamcrest.CoreMatchers.containsString; 20 | import static org.hamcrest.MatcherAssert.assertThat; 21 | import static org.junit.Assert.assertTrue; 22 | import static scaffolding.ExactCountMatcher.oneOf; 23 | import static scaffolding.ExactCountMatcher.twoOf; 24 | 25 | public class VersionsReportTest { 26 | 27 | final String buildNumber = String.valueOf(System.currentTimeMillis()); 28 | final String expectedParentVersion = "1.0." + buildNumber; 29 | final String expectedCoreVersion = "2.0." + buildNumber; 30 | final String expectedAppVersion = "3.2." + buildNumber; 31 | final String releasedVersionsReportFlatFileName = "released-report.txt"; 32 | final String releasedVersionsReportJsonFileName = "released-report.json"; 33 | final String allVersionsReportJsonFileName = "version-report.json"; 34 | final List reportedVersions = Arrays.asList( 35 | "independent-versions:" + expectedParentVersion, 36 | "core-utils:" + expectedCoreVersion, 37 | "console-app:" + expectedAppVersion); 38 | final TestProject testProject = TestProject.versionReportProject(); 39 | 40 | @BeforeClass 41 | public static void installPluginToLocalRepo() throws MavenInvocationException { 42 | MvnRunner.installReleasePluginToLocalRepo(); 43 | } 44 | 45 | @Test 46 | public void buildsAndInstallsAndTagsAllModules() throws Exception { 47 | buildsEachProjectOnceAndOnlyOnce(testProject.mvnRelease(buildNumber)); 48 | reportsFilesGeneratedWithCorrectVersionsAndFormat(); 49 | } 50 | 51 | private void reportsFilesGeneratedWithCorrectVersionsAndFormat() throws IOException { 52 | List fileLines = Files.readAllLines(new File(testProject.localDir, releasedVersionsReportFlatFileName).toPath(), Charset.defaultCharset()); 53 | assertTrue(fileLines.size() == reportedVersions.size() && fileLines.containsAll(reportedVersions) && reportedVersions.containsAll(fileLines)); 54 | } 55 | 56 | private void buildsEachProjectOnceAndOnlyOnce(List commandOutput) { 57 | assertThat( 58 | commandOutput, 59 | allOf( 60 | oneOf(containsString("Going to release independent-versions " + expectedParentVersion)), 61 | twoOf(containsString("Building independent-versions")), // once for initial build; once for release build 62 | oneOf(containsString("Building core-utils")), 63 | oneOf(containsString("Building console-app")), 64 | oneOf(containsString("The Calculator Test has run")), 65 | oneOf(containsString("Successfully written report file - " + releasedVersionsReportFlatFileName)), 66 | oneOf(containsString("Successfully written report file - " + releasedVersionsReportJsonFileName)), 67 | oneOf(containsString("Successfully written report file - " + allVersionsReportJsonFileName)) 68 | ) 69 | ); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/test/java/scaffolding/CollectingLogOutputStream.java: -------------------------------------------------------------------------------- 1 | package scaffolding; 2 | 3 | import org.apache.commons.exec.LogOutputStream; 4 | 5 | import java.util.LinkedList; 6 | import java.util.List; 7 | 8 | public class CollectingLogOutputStream extends LogOutputStream { 9 | private final List lines = new LinkedList(); 10 | private final boolean logToStandardOut; 11 | 12 | public CollectingLogOutputStream(boolean logToStandardOut) { 13 | this.logToStandardOut = logToStandardOut; 14 | } 15 | 16 | @Override 17 | protected void processLine(String line, int level) { 18 | if (logToStandardOut) { 19 | System.out.println(" " + line); 20 | } 21 | lines.add(line); 22 | } 23 | 24 | public List getLines() { 25 | return lines; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/test/java/scaffolding/ExactCountMatcher.java: -------------------------------------------------------------------------------- 1 | package scaffolding; 2 | 3 | import org.hamcrest.Description; 4 | import org.hamcrest.Matcher; 5 | import org.hamcrest.TypeSafeDiagnosingMatcher; 6 | 7 | import java.util.List; 8 | 9 | public class ExactCountMatcher extends TypeSafeDiagnosingMatcher> { 10 | private final Matcher stringMatcher; 11 | private int expectedCount; 12 | 13 | private ExactCountMatcher(Matcher stringMatcher, int expectedCount) { 14 | this.stringMatcher = stringMatcher; 15 | this.expectedCount = expectedCount; 16 | } 17 | 18 | @Override 19 | protected boolean matchesSafely(List items, Description mismatchDescriptor) { 20 | int count = 0; 21 | for (String item : items) { 22 | if (stringMatcher.matches(item)) { 23 | count++; 24 | } 25 | } 26 | boolean okay = count == expectedCount; 27 | if (!okay) { 28 | mismatchDescriptor.appendText("was matched " + count + " times in the following list:"); 29 | String separator = String.format("%n") + " "; 30 | mismatchDescriptor.appendValueList(separator, separator, "", items); 31 | 32 | } 33 | return okay; 34 | } 35 | 36 | @Override 37 | public void describeTo(Description description) { 38 | description.appendDescriptionOf(stringMatcher).appendText(" " + expectedCount + " times"); 39 | } 40 | 41 | public static Matcher> noneOf(Matcher stringMatcher) { 42 | return new ExactCountMatcher(stringMatcher, 0); 43 | } 44 | 45 | public static Matcher> oneOf(Matcher stringMatcher) { 46 | return new ExactCountMatcher(stringMatcher, 1); 47 | } 48 | 49 | public static Matcher> twoOf(Matcher stringMatcher) { 50 | return new ExactCountMatcher(stringMatcher, 2); 51 | } 52 | 53 | public static Matcher> threeOf(Matcher stringMatcher) { 54 | return new ExactCountMatcher(stringMatcher, 3); 55 | } 56 | 57 | public static Matcher> fourOf(Matcher stringMatcher) { 58 | return new ExactCountMatcher(stringMatcher, 4); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/test/java/scaffolding/GitMatchers.java: -------------------------------------------------------------------------------- 1 | package scaffolding; 2 | 3 | import com.github.danielflower.mavenplugins.release.GitHelper; 4 | import org.eclipse.jgit.api.Git; 5 | import org.eclipse.jgit.api.Status; 6 | import org.eclipse.jgit.api.errors.GitAPIException; 7 | import org.eclipse.jgit.lib.Ref; 8 | import org.hamcrest.Description; 9 | import org.hamcrest.Matcher; 10 | import org.hamcrest.TypeSafeDiagnosingMatcher; 11 | 12 | import java.util.List; 13 | 14 | import static org.eclipse.jgit.lib.Constants.R_TAGS; 15 | 16 | public class GitMatchers { 17 | 18 | public static Matcher hasTag(final String tag) { 19 | return new TypeSafeDiagnosingMatcher() { 20 | @Override 21 | protected boolean matchesSafely(Git repo, Description mismatchDescription) { 22 | try { 23 | mismatchDescription.appendValueList("a git repo with tags: ", ", ", "", repo.getRepository().getTags().keySet()); 24 | return GitHelper.hasLocalTag(repo, tag); 25 | } catch (Exception e) { 26 | throw new RuntimeException("Couldn't access repo", e); 27 | } 28 | } 29 | 30 | @Override 31 | public void describeTo(Description description) { 32 | description.appendText("a git repo with the tag " + tag); 33 | } 34 | }; 35 | } 36 | 37 | public static Matcher hasCleanWorkingDirectory() { 38 | return new TypeSafeDiagnosingMatcher() { 39 | @Override 40 | protected boolean matchesSafely(Git git, Description mismatchDescription) { 41 | try { 42 | Status status = git.status().call(); 43 | if (!status.isClean()) { 44 | String start = "Uncommitted changes in "; 45 | String end = " at " + git.getRepository().getWorkTree().getAbsolutePath(); 46 | mismatchDescription.appendValueList(start, ", ", end, status.getUncommittedChanges()); 47 | } 48 | return status.isClean(); 49 | } catch (GitAPIException e) { 50 | throw new RuntimeException("Error checking git status", e); 51 | } 52 | } 53 | 54 | @Override 55 | public void describeTo(Description description) { 56 | description.appendText("A git directory with no staged or unstaged changes"); 57 | } 58 | }; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/test/java/scaffolding/MavenExecutionException.java: -------------------------------------------------------------------------------- 1 | package scaffolding; 2 | 3 | import org.apache.commons.lang.StringUtils; 4 | import org.apache.commons.lang.SystemUtils; 5 | 6 | import java.util.List; 7 | 8 | public class MavenExecutionException extends RuntimeException { 9 | public final int exitCode; 10 | public final List output; 11 | 12 | public MavenExecutionException(int exitCode, List output) { 13 | super("Error from mvn: " + output); 14 | this.exitCode = exitCode; 15 | this.output = output; 16 | } 17 | 18 | @Override 19 | public String toString() { 20 | return "MavenExecutionException{" + 21 | "exitCode=" + exitCode + 22 | ", output=" + StringUtils.join(output.toArray(), SystemUtils.LINE_SEPARATOR); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/test/java/scaffolding/Photocopier.java: -------------------------------------------------------------------------------- 1 | package scaffolding; 2 | 3 | import org.apache.commons.io.FileUtils; 4 | import org.apache.commons.io.FilenameUtils; 5 | 6 | import java.io.File; 7 | import java.io.IOException; 8 | import java.util.UUID; 9 | 10 | public class Photocopier { 11 | public static File copyTestProjectToTemporaryLocation(String moduleName) throws IOException { 12 | File source = new File("test-projects", moduleName); 13 | if (!source.isDirectory()) { 14 | source = new File(FilenameUtils.separatorsToSystem("../test-projects/" + moduleName)); 15 | } 16 | if (!source.isDirectory()) { 17 | throw new RuntimeException("Could not find module " + moduleName); 18 | } 19 | 20 | File target = folderForSampleProject(moduleName); 21 | FileUtils.copyDirectory(source, target); 22 | return target; 23 | } 24 | 25 | public static File folderForSampleProject(String moduleName) { 26 | return new File(FilenameUtils.separatorsToSystem("target/samples/" + moduleName + "/" + UUID.randomUUID())); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/test/java/scaffolding/ReleasableModuleBuilder.java: -------------------------------------------------------------------------------- 1 | package scaffolding; 2 | 3 | import com.github.danielflower.mavenplugins.release.ReleasableModule; 4 | import com.github.danielflower.mavenplugins.release.ValidationException; 5 | import com.github.danielflower.mavenplugins.release.VersionNamer; 6 | import org.apache.maven.project.MavenProject; 7 | 8 | public class ReleasableModuleBuilder { 9 | 10 | private final VersionNamer versionNamer = new VersionNamer(); 11 | MavenProject project = new MavenProject(); 12 | private long buildNumber = 123; 13 | private String equivalentVersion = null; 14 | private String relativePathToModule = "."; 15 | 16 | public ReleasableModuleBuilder withBuildNumber(long buildNumber) { 17 | this.buildNumber = buildNumber; 18 | return this; 19 | } 20 | 21 | public ReleasableModuleBuilder withEquivalentVersion(String equivalentVersion) { 22 | this.equivalentVersion = equivalentVersion; 23 | return this; 24 | } 25 | 26 | public ReleasableModuleBuilder withRelativePathToModule(String relativePathToModule) { 27 | this.relativePathToModule = relativePathToModule; 28 | return this; 29 | } 30 | 31 | public ReleasableModuleBuilder withGroupId(String groupId) { 32 | project.setGroupId(groupId); 33 | return this; 34 | } 35 | 36 | public ReleasableModuleBuilder withArtifactId(String artifactId) { 37 | project.setArtifactId(artifactId); 38 | return this; 39 | } 40 | 41 | public ReleasableModuleBuilder withSnapshotVersion(String snapshotVersion) { 42 | project.setVersion(snapshotVersion); 43 | return this; 44 | } 45 | 46 | public ReleasableModule build() throws ValidationException { 47 | return new ReleasableModule(project, versionNamer.name(project.getVersion(), buildNumber, null), equivalentVersion, relativePathToModule, null, null); 48 | } 49 | 50 | public static ReleasableModuleBuilder aModule() { 51 | return new ReleasableModuleBuilder() 52 | .withGroupId("com.github.danielflower.somegroup") 53 | .withArtifactId("some-artifact"); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/test/resources/known_hosts: -------------------------------------------------------------------------------- 1 | github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ== 2 | -------------------------------------------------------------------------------- /src/test/resources/testid_rsa: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIIJKQIBAAKCAgEA09LbbZmjWMVLMs3hdyUi10H9R9LyWNqKMx0JCpCq41A8XR8r 3 | D+y+NHf2ssS9bs+J4RswxnxE8IsW79gTQOafHrFKjI3e8/jLMVGI7hDVMlnAx55y 4 | ZDkraCh61pFrlQT1EChH9/54IjgTPtOaDurcFvaVj4vvewyQmrtM5MKr5xiGMGgf 5 | exttSDcCSlAFP0JrCCIxC4C4Vb9icJrTf6cM/aV201OqvpZte/afdixf3Sy5tuOD 6 | ctBM3n4PeKGRhra975cYVwDKtHE6RcvbbE1Xq0M14ZeWaalQvLnlKfWQGieLT1bJ 7 | gzOjK7PUok75JaYANjyCtwkicxaWi6+UZ0F/KzdaYeYLYVaq+CaVs13zPYXdW7Fm 8 | DcZUwCbg2k2BE5fpBl0zriHEIHC8S68Pwmcvb/T1myJfJDpPOoPbiiZsiGQtQ9rV 9 | KTOTolpkOe907V53RD6aILTP0ZYofdCXmyn1IJWHve1V4BJPttQAcNBKcn8GMFq0 10 | HSABWYV13WDlwEBIUuPfRltwxUBNg4bJwTrvz8DudpmiNASUvV+/lJNQerfG6S2a 11 | blbEBQVGFoxPzUkE7NQCQy2obILVl9zAlgKJD2AaSeJaKFvQ96o2TBiNr0e3byOp 12 | 58zQJX87IdBB+HCfw4ZClU64wE5+fOmJX3oZAmuukqPPfG5msRX39BD9uZcCAwEA 13 | AQKCAgEAl8IElVQydEH9ayuXcg34FTJg7NlT6ZbA1nfh52DYHb15UdontuQNLXgZ 14 | FeDgOwiTpuQdIMcdeRydVT6AJMpVi97HI0XtSuufX/kjWjRTGhy1gg6hs+5Fi/0c 15 | bKeI5R3FGUtSrHjyxslX+HYPdMqM3iLR6iL+czEAVOsF3wsdr5ahZQLkMwXmWIuY 16 | p3cHG1hRaGVer/gLmNtiAnzaNCWRqBOouyTBOoR5cguyGS8Xi1UkxMPhhBt6RxkX 17 | qnxOz64TDBk7RfH6SCaq8iBoVwJeYgPoEXTSPWchweSJK3OURzi3lSL/gnE3YPMY 18 | zyQ3WeLBWhomKE5yEPRI7VDgyM1i9lt6LmgOcp0a26IBx93j7a5Or/D7Iw78eZUk 19 | D1UUhx0/nUn7lpXxi0b1ci0nnbIW0ZvL3bJXF3hcVFqfGulkJ94Y01HS3BGWVTbP 20 | 7mXQek8NocZl0xgQ1CU2wGr5WzO1A1wTHMHB3h8irI6t3PRJMcT+sD6ooN0v6yKe 21 | 5L8rRhvBHbreJLYmv5Yv7EzrD/Ga+KdzQptIRgNXYCQuFhliDg6f7twc85Lpdd9i 22 | FNgooYoO8L9xH8LNxgyeNl+coHcRamg9HQjD0gIDPCH1NoJQIT+9OgHd0zQjTXkU 23 | vN49xuFlI0GUTE0JnbSnQUjdyaRqtHatSy1NL5wG6ieFfNaXdIkCggEBAP1PDwn4 24 | nC8SNkLM7vir6sdqeHP3xbQtuW2BNo+ydemOk5k6m9nGUi7d/8e8+AOQTkr9kOlO 25 | 1Cv4UA5hYsxPNISHIo8XMzBurJkRD7NHJ2GElU2JhVDVB44YGs/Jt8ucY05vECU4 26 | b12EGaRoE6iPiA6YNBhjV0lmqsEji07tSr5+gWCHh+ulLmLprL7bO7qszuUUUqnl 27 | Ti3OHNJmTP1ykC4Crplzmfr2484E7AMrpkvmci3hzfZFmmb9kkGEn5DuObsxYhJK 28 | Q5VrwnU5PU6mJJIce/WMRA9h5oQsA1ueytdCapXFMoaD6rIbCYPAzs5X+0n2sn/R 29 | ko+Fmvo0MBgUExsCggEBANYS9+dcPFaMi7YeivaasjIEsjRCeO7zIk3CQe1XNdrZ 30 | xwhLvxOqVfjkLyfwdFUPryWRrpSGy/0ns2nDYU/yGyyXydD2Kz7nh8sObVv3Vlxt 31 | pMiwB0ZoMW7y4CqvLhjNR/SbSIBPjt+iiGv6Btsizu0Q2TtZJQZeAhdBeJnaB0dK 32 | Mdf7/XaWFnQZPnN9lu2icZqSmdgXkp+K2I9okPWaLioOvgK64cWbkH3r6zegmKok 33 | 2TBllgMYjmlO4ZhcYwhcSJtjJi/w3bcYUFYdU8BgOXzfNUnNo2Fca1PJunNK6pAG 34 | WmFe0NFYRof8gGPBPAjLgfxEnC+SCoMcAKP5nC5onzUCggEBAIwIlqHGhGEpSkHn 35 | lPx33dTcMTa69NrEpEu7MPSDjdfN8B63Xc0oa+po46wB9YHS1tVyFBhGcdjU7zzj 36 | 7YBRERFqu1orUyslI9mCqxFK9qRcbUVuDvs+qWyOOtRACZFQJT4I+/33kuk5zAst 37 | ViDLKEYZMkOBN5HmZeNbyPmbCMUCnndEtYk5ycj4sXzZKc3rFn1hnMk7cNq1pQ1T 38 | bKB4IuispuVCGQ+6SPltkyO1j7tJ7DkdKYVJuS/SYnZB4Qx4BgZMKJE/6NjDt76i 39 | JBhElNcJVCXMoxt13b+XrUuLH0uc9dtSJrpiVu6bL8lcX3eG/+5FqSwsKT+adrB3 40 | BVdqUZ0CggEAWDUgqNg8lHz85GHZaJt9aVa+BwKMygiszdWJTL5ulmq9tBFh/jxl 41 | iFSdiZtuk84OoTBR+yk/zGQbbSzwX/ymbc1tfwiv8Q99yJF9RjO4BgW3rGm71asB 42 | E3JII85i9B1B1OxXB2fAuy1BgRxYztqc4NncaLPmqaT6v5JemyZXcWyE9TYDzmUx 43 | g00TiorpMamJneNiOMQdyldvvEed01VgSDwi1wUiGkZrVzdqiFVIEnN0epihI01v 44 | AL1b/2ex9rPvxvcnuQFKmjMOhy02YUJE7csbLfnppChsoO2yQedQl1/GxfBHorr4 45 | 9Pd5/6CTmBwix0uN/5vxcOyM5wPm8shxMQKCAQA9gXMQ8QzjcmvpR/FSavq9Ueip 46 | kzLqpD3eg1ifokPDMHx8DmOaMLSUdvCFJCLPlG95k5Z2p4F5r11KpSxwU+uHOvv9 47 | nFMi+cwrWfglHP+2mBytWqv4OUsaT+HZc4vzMIeUdrIiEz8Z5ybKfYUBevkS5lTa 48 | LaYHHSspWFJyi/oiPRR3cyziUJRiy3hy3ZwQBnXEnXhVLMDBYI4cMjvBJ0PQzwV9 49 | gnGkqM8jEJNaJKSZyNrqnVjSrdBYWSsdZJdgZKe38UYX5o7oM1FSULD+3P3G5rEg 50 | HUkfpg/E3bHa+wSdK641IXTQ3V8fYZFBCuxSaZ6vq4spuwoFJZk84nCOVrHI 51 | -----END RSA PRIVATE KEY----- 52 | -------------------------------------------------------------------------------- /src/test/resources/testid_rsa.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDT0tttmaNYxUsyzeF3JSLXQf1H0vJY2oozHQkKkKrjUDxdHysP7L40d/ayxL1uz4nhGzDGfETwixbv2BNA5p8esUqMjd7z+MsxUYjuENUyWcDHnnJkOStoKHrWkWuVBPUQKEf3/ngiOBM+05oO6twW9pWPi+97DJCau0zkwqvnGIYwaB97G21INwJKUAU/QmsIIjELgLhVv2JwmtN/pwz9pXbTU6q+lm179p92LF/dLLm244Ny0Ezefg94oZGGtr3vlxhXAMq0cTpFy9tsTVerQzXhl5ZpqVC8ueUp9ZAaJ4tPVsmDM6Mrs9SiTvklpgA2PIK3CSJzFpaLr5RnQX8rN1ph5gthVqr4JpWzXfM9hd1bsWYNxlTAJuDaTYETl+kGXTOuIcQgcLxLrw/CZy9v9PWbIl8kOk86g9uKJmyIZC1D2tUpM5OiWmQ573TtXndEPpogtM/Rlih90JebKfUglYe97VXgEk+21ABw0EpyfwYwWrQdIAFZhXXdYOXAQEhS499GW3DFQE2DhsnBOu/PwO52maI0BJS9X7+Uk1B6t8bpLZpuVsQFBUYWjE/NSQTs1AJDLahsgtWX3MCWAokPYBpJ4looW9D3qjZMGI2vR7dvI6nnzNAlfzsh0EH4cJ/DhkKVTrjATn586YlfehkCa66So898bmaxFff0EP25lw== testid_rsa 2 | -------------------------------------------------------------------------------- /src/test/resources/testid_with_password_rsa: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | Proc-Type: 4,ENCRYPTED 3 | DEK-Info: AES-128-CBC,C59CED47B891168720B30211AA662941 4 | 5 | IjXCupDFEeQnXcqAD4PVmfyc794mOZlyBNFxVRKJb0T7JH2jc0qQkvzeertM9In+ 6 | Qn8LwCnWjk5fyZqQYRfCkuJM+DFIDQG3bcm8onRSuPzG+VMI0iJktRphCl9fujq5 7 | XqWo4fuABVUFDYZwaDy7fQhP54rytUqOOegzGwUP/GGfbFmpx68OHd3ZP+l6Rugj 8 | 8HXYodnRFpe/zSM0xPxuZsjPsZt7MaWm9NY+Rx08zEpR/BSTBbG95OGhetBgJ/R+ 9 | 6n60ktQn32ozYweHjEVdACVPPwq5luXZqGoZ++hn8legQSeidMHHFa1O0+tC8bf4 10 | XXO+H+pm9iLonIoq8X8Z25HWdHZ0Sp3b17J4zPMIWnF2r2XXwj/5QmR6QOzLQd58 11 | nzEbCKXk6m3UG6VPTgBkO/jBX2wLwEqqtmqg+jLTuIx+NFF221SvYz1wMegOVmQZ 12 | 4Kbhcb3HugnYhnXYU3WqZXKDd5OVT0xe7aU4kD2nIiWoSiR3qSujv72XfP4vmCP/ 13 | G0wbB/DFPu8Xe/o6/Qoow1z/T++GMboQ9SQSqr1YVdSaj+iPxG2KVj7AwA33Zdwv 14 | MaMMwHO8ecmzNDKbGTOhsmUVAU7Hb9iMXriksthGYruiZn1vQTu1eNUr56jK2cPi 15 | 1ASnIOJYmKcaDgk8vAI5NpEvwkAgUMHNTz5710Sb39tzuqm5CpNVqa0hwD8tr0/7 16 | RiHrHlTt747dK2H/1hNhM5gwLexGN4+HRnUCbrOPvAyrqTP70PPttKerfQzhrTtP 17 | ivXpSguV8ZeFstwVeo9a3XVnglnyjJDZE5iFMefbAve/mtDoV7HHI9tCeq4bCTbM 18 | jnZp+7BJQX2DRa0yw0oOhXHhPkvEphy9s9l13l/oF5qj2642kHeukAEvM0S9t0fW 19 | PpuTvbC/Jw5u8PVFxHrStLUBvD8yfyQyOMHc5RPgw+/QdBN9myf2f9VM2qIGMqAO 20 | bxL6ioBbeZsNsSlzBz3iPIKom3VfmgHN6J5QM9MY6ZjKAQUKbnYxYE6q+T+IPsnr 21 | WmHH324APdHXN0zbPjPIiMOUPxIz653FplWs4wJ8Gk0xvJK3kvW3zWS3a0hNeHA3 22 | m+0bQxJa7SuM2yp5cYhsVmKNXCu1RZOoW8DojWyhWBo3WdcUXXtgb9JKUs9wBO53 23 | 9sE3ikVlEHA8HCnHWWegmnuiOR0Tn/p+uvlnivvZO7ME+NSkUlyDUvP+axMbsd9I 24 | PjcydmLfpaqO1yHgnB5NIWlZpDZn7E3d004IArNMavOzcdpmQLOcVGho0MRMkH1h 25 | A3ZlHeD7W9voa7A+OrhLN1ivw2XGnETkDeJQsy/eghU+nw3CHSdbIJQClQqBEKXd 26 | IxXgJH5cjTt1DJdktnAMqGDGkGe31ZaOjxex5Hb7fU/ur0DdU2IlM1Ut5FwY1ynu 27 | RI+YWgXnlrVCV31Z6x2lGt2DcCgLMXCdaVtjFtNXNvMZWYXJwf+bvevMJvBiX2tQ 28 | cpDhCYENspEHw0xeDX08beNQzS7LmGAtSL+MI3vXjgbv0jBp2g1ogw61BDoll1IS 29 | FBKbscqLRgqSZ2p3Vpqb0m+CMlOiwexX3Q+9RkD/aGTrVQuH7EIePx1Q/FSaTRB+ 30 | n3psM7jyMDLsIEyxFA8+NULcfqqiNPUDYZoQKyfYaGVQ/ThTvvOMCWAtc0rpkfg6 31 | W21JkxWWqFZVg6w36SKYxAX5o0DuJ3cP13dIkylX+tCxxwH6QV76eVWOCqb20LfV 32 | C3aZSm8wPMdDdtCsA0JRdGvi+FZFUVYSkdFqh+NSHA9qTf9gSXrN8odldpKFRxMs 33 | wZO0SzHpMIPA9r08Rozr50kGI9C95AL43ijQchUtXxFRUT+wdQhMuQRRwiRUIw2R 34 | HUCeTsSntgXoLQwvU/s8bn2YNesH/SmSPjaLIyq9dePoPiFHY/U5wlXtjsnJx6xr 35 | y6gShd9Zwg2nERK3ob3iTttLDZvYRy+t33mWldIzf0SFOwL/C0lAW09MKS4Gkppg 36 | K9lpHYKZQlMw1Pd4IsOMDvH/eLd48Yt5VSczutmfPPsT09EyxIEUkS5z+3iY6AWy 37 | 6bsrNv9GKoP7KuIXgxrLST1uZgj/GfPJzf3o8663wni1poMbkFbuDpDBEnztcV2n 38 | 6Bp75r2ZScYvNldHjJx1/1AenqUv2bXvZiI7jzhA2S+3uwxUGFhXUzRs5snzEzvu 39 | 1rcy8jPPCnRW0CdZK5r/Wh2NZreEoFazf3azCQLWOO6nxktKQtP4ggxRRfmu6Va6 40 | WHks7FSNE3Bm4T0OLOlbj2oFcu3HNvyN8o43NXKoiaFZ6epo90d4PdJD6js6yVOE 41 | ZOG/x6agDSzzFpF/SejNmlksnewHtKc1vhoKtzbdCdE59CrBTrnMuzElxk1p/OcJ 42 | DhfDzp6WzutlCXjffZn/GP9eHXy7u7tZSayL3jCrjr0V6V9WMST5gWzUbk7g1w+D 43 | DcpXV+HqT7jg+Cc35VZGe/f5VaNCPu0mZXDFmKOM/ewVNZnUnqn8T+jXhvN3zDQq 44 | J5uUEY5Jgk1syBH9Sa6xEPtk96onE3N7MCDjhbnVy/MhRqLn/GOqTCsdd/sLOcJ3 45 | t21RAeOIz5uWmfsW0oFaHFoCcZx9c1pyIfK+u6gaLEg5uEfUsAGznvkIcAEZgdNA 46 | BmdVLqqCmrG+NpFqhx0LT7Ac5NVeiMfHEddXsLli2zpAQc/UBqeAZEverZAUNoWz 47 | 8hV1oIHQwAspLzbkLfsUlQlBVgk3K3t26PhFOqOQw1fv5BVFTKNC3gBNL8eRBxdm 48 | 8txJyIZ6EuvpfR6VTDFnqKcg5nKNzwm2qFtzRTNTXH02yf9Jf3hV2mTXPs9meSfI 49 | eT6pUT4CqsIAWtwSxbNRnDaY1RIlU9b6poZs41cnXZtbIrSwRgO2V0Et/DKFhm5a 50 | AdtfyAB12HVUxx5yDq1Z+utWG0hkeeTvLuj8i1Y8qtLNQxxvPfK4WhzqD3qLTJ3O 51 | DPayGgqr8Og6RSC/os+zBK9HRW+IWvAnmLCjnJMSxbl9fBT3/MqemSs5TgtVJ5Ct 52 | gIZXnvJ6jwpD7W3zQvwVGtJBemN3CMjNnsjzmBXa2qpR1Spl3veS6KwH1rRsA5jA 53 | Uh6FbJHtgAJTlGAogKze30vmV0G1SqL6xEmj/y4GDKEcaOXjzBeGQzmRBMyxmfRr 54 | -----END RSA PRIVATE KEY----- 55 | -------------------------------------------------------------------------------- /src/test/resources/testid_with_password_rsa.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDiMMEE2a5pjEQh2IhiHceOxgZYI03Caflb+olPWh7b64KxvX4W5t6fN57Z8JBtkxMFEAGcKzLIkLJUypGCk/dKx2fRZuKcmX21IIATdSnR0cyXK+PceDQeg611YJE8PBVtCiDZB1W+g3X39S0gM2lZujlgHAHJACl/5RNeHIZzMofrrmo6dtpxPi7GK7jV+eDUqvMhnfSmIVyMRnnBraIWls9VuJxwhk8STlySmBis50FIwvzJes3o22X0OoW6skUdNUiPp9FwH4cm1zWZSPvxIKSE6J+3aSVxK5KUHpEQClkP0oKyv2MIIuB0XPwgU810miDvfIgIZGLXOS/GnM3oAdG7pJchMl3vNmwZB86IdqNiTNXqUL3ki33RmKV87evPGuM1Uckuoig8+7FaUbfhNzWcRtaVYnAgKd+86axjFlUKK1UkeoDA8yQaaocjyv1u4Y0+QqFnHwHZPX8YoAXMat15bEjSKL2Oy7A6quVMOYeougzy8ALdGOAtUsUEAmDk+ETcikNr1ccv05C5vHdr7Rp8e4ShusvPC+34Nw7TKWGRNYRXhcQUIx7nlfBhH1B4DflqUiW/9+dam6C/r12zpQeocQ+xYisem529A+n9AR6bHol54uKuDaJ1328m8H3CUgfrgI893BjlVBonZO57W24MxXQo2Ea6FF/dJPG1zw== testid_with_password_rsa 2 | -------------------------------------------------------------------------------- /test-projects/deep-dependencies/.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | .idea/ 3 | *.iml 4 | .classpath 5 | .settings 6 | .project 7 | -------------------------------------------------------------------------------- /test-projects/deep-dependencies/README.md: -------------------------------------------------------------------------------- 1 | In this project the aggregator pom is separate from the parent pom of the modules in this project. 2 | 3 | Other modules reference the parent pom using a relative path. -------------------------------------------------------------------------------- /test-projects/deep-dependencies/console-app/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | parent-module 7 | com.github.danielflower.mavenplugins.testprojects.deepdependencies 8 | 1.2.3-SNAPSHOT 9 | ../parent-module/pom.xml 10 | 11 | 4.0.0 12 | 13 | console-app 14 | 3.2-SNAPSHOT 15 | 16 | 17 | 18 | com.github.danielflower.mavenplugins.testprojects.deepdependencies 19 | core-utils 20 | 2.0-SNAPSHOT 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /test-projects/deep-dependencies/console-app/src/main/java/com/github/danielflower/mavenplugins/testprojects/versioninheritor/App.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.testprojects.versioninheritor; 2 | 3 | public class App { 4 | public static void main(String[] args) { 5 | Calculator calculator = new Calculator(); 6 | System.out.println("1 + 2 = " + calculator.add(1, 2)); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /test-projects/deep-dependencies/more-utilities/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | parent-module 7 | com.github.danielflower.mavenplugins.testprojects.deepdependencies 8 | 1.2.3-SNAPSHOT 9 | ../parent-module/pom.xml 10 | 11 | 4.0.0 12 | 13 | more-utils 14 | 10.0-SNAPSHOT 15 | 16 | 17 | 18 | junit 19 | junit 20 | 4.13.2 21 | test 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /test-projects/deep-dependencies/more-utilities/src/main/java/com/github/danielflower/mavenplugins/testprojects/versioninheritor/Calculator.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.testprojects.versioninheritor; 2 | 3 | public class Calculator { 4 | 5 | public int add(int a, int b) { 6 | return a + b; 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /test-projects/deep-dependencies/more-utilities/src/test/java/com/github/danielflower/mavenplugins/testprojects/versioninheritor/CalculatorTest.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.testprojects.versioninheritor; 2 | 3 | 4 | import org.junit.Assert; 5 | import org.junit.Test; 6 | 7 | public class CalculatorTest { 8 | 9 | @Test 10 | public void testAdd() throws Exception { 11 | Assert.assertEquals(3, new Calculator().add(1, 2)); 12 | System.out.println("The Calculator Test has run"); // used in a test to assert this has run 13 | } 14 | } -------------------------------------------------------------------------------- /test-projects/deep-dependencies/parent-module/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 4.0.0 7 | 8 | com.github.danielflower.mavenplugins.testprojects.deepdependencies 9 | parent-module 10 | 1.2.3-SNAPSHOT 11 | pom 12 | 13 | 1.8 14 | 1.8 15 | 16 | UTF-8 17 | 1.8 18 | 1.8 19 | 20 | 21 | 22 | 23 | 24 | com.github.danielflower.mavenplugins 25 | multi-module-maven-release-plugin 26 | ${current.plugin.version} 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /test-projects/deep-dependencies/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 4.0.0 7 | 8 | com.github.danielflower.mavenplugins.testprojects.deepdependencies 9 | deep-dependencies-aggregator 10 | 1.0-SNAPSHOT 11 | 12 | 1.8 13 | 1.8 14 | 15 | 16 | the-core-utilities 17 | console-app 18 | parent-module 19 | more-utilities 20 | 21 | pom 22 | 23 | 24 | 25 | 26 | com.github.danielflower.mavenplugins 27 | multi-module-maven-release-plugin 28 | ${current.plugin.version} 29 | 30 | 31 | install 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /test-projects/deep-dependencies/the-core-utilities/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | parent-module 7 | com.github.danielflower.mavenplugins.testprojects.deepdependencies 8 | 1.2.3-SNAPSHOT 9 | ../parent-module/pom.xml 10 | 11 | 4.0.0 12 | 13 | core-utils 14 | The Core Utilities 15 | 2.0-SNAPSHOT 16 | 17 | 18 | 19 | com.github.danielflower.mavenplugins.testprojects.deepdependencies 20 | more-utils 21 | 10.0-SNAPSHOT 22 | 23 | 24 | junit 25 | junit 26 | 4.13.2 27 | test 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /test-projects/deep-dependencies/the-core-utilities/src/main/java/com/github/danielflower/mavenplugins/testprojects/versioninheritor/Calculator.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.testprojects.versioninheritor; 2 | 3 | public class Calculator { 4 | 5 | public int add(int a, int b) { 6 | return a + b; 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /test-projects/deep-dependencies/the-core-utilities/src/test/java/com/github/danielflower/mavenplugins/testprojects/versioninheritor/CalculatorTest.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.testprojects.versioninheritor; 2 | 3 | 4 | import org.junit.Assert; 5 | import org.junit.Test; 6 | 7 | public class CalculatorTest { 8 | 9 | @Test 10 | public void testAdd() throws Exception { 11 | Assert.assertEquals(3, new Calculator().add(1, 2)); 12 | System.out.println("The Calculator Test has run"); // used in a test to assert this has run 13 | } 14 | } -------------------------------------------------------------------------------- /test-projects/dependencymanagement-using-parent-module-version-property/.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | .idea/ 3 | *.iml 4 | .classpath 5 | .settings 6 | .project 7 | -------------------------------------------------------------------------------- /test-projects/dependencymanagement-using-parent-module-version-property/README.md: -------------------------------------------------------------------------------- 1 | In this project the aggregator pom is separate from the parent pom of the modules in this project. 2 | 3 | Other modules reference the parent pom using a relative path, version is set by ${parent-module.version}. 4 | 5 | This is a malformed maven project, as parent version should not be set by a property. 6 | Build even reports a warning saying that such malformed project may not compile any more in future. 7 | 8 | But in a scenario with a huge multi module project being developed on many branches with different versions, this significantly simplifies merging, as there is not module version related merge conflicts in pom files. -------------------------------------------------------------------------------- /test-projects/dependencymanagement-using-parent-module-version-property/console-app/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 4.0.0 7 | 8 | 9 | parent-module 10 | com.github.danielflower.mavenplugins.testprojects.dependencymanagement-using-parent-module-version-property 11 | ${parent-module.version} 12 | ../parent-module/pom.xml 13 | 14 | 15 | console-app 16 | ${parent-module.version} 17 | 18 | 19 | 20 | com.github.danielflower.mavenplugins.testprojects.dependencymanagement-using-parent-module-version-property 21 | core-utils 22 | ${parent-module.version} 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /test-projects/dependencymanagement-using-parent-module-version-property/console-app/src/main/java/com/github/danielflower/mavenplugins/testprojects/versioninheritor/App.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.testprojects.versioninheritor; 2 | 3 | public class App { 4 | public static void main(String[] args) { 5 | Calculator calculator = new Calculator(); 6 | System.out.println("1 + 2 = " + calculator.add(1, 2)); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /test-projects/dependencymanagement-using-parent-module-version-property/more-utilities/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 4.0.0 7 | 8 | 9 | parent-module 10 | com.github.danielflower.mavenplugins.testprojects.dependencymanagement-using-parent-module-version-property 11 | ${parent-module.version} 12 | ../parent-module/pom.xml 13 | 14 | 15 | more-utils 16 | ${parent-module.version} 17 | 18 | 19 | 20 | junit 21 | junit 22 | test 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /test-projects/dependencymanagement-using-parent-module-version-property/more-utilities/src/main/java/com/github/danielflower/mavenplugins/testprojects/versioninheritor/Calculator.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.testprojects.versioninheritor; 2 | 3 | public class Calculator { 4 | 5 | public int add(int a, int b) { 6 | return a + b; 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /test-projects/dependencymanagement-using-parent-module-version-property/more-utilities/src/test/java/com/github/danielflower/mavenplugins/testprojects/versioninheritor/CalculatorTest.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.testprojects.versioninheritor; 2 | 3 | 4 | import org.junit.Assert; 5 | import org.junit.Test; 6 | 7 | public class CalculatorTest { 8 | 9 | @Test 10 | public void testAdd() throws Exception { 11 | Assert.assertEquals(3, new Calculator().add(1, 2)); 12 | System.out.println("The Calculator Test has run"); // used in a test to assert this has run 13 | } 14 | } -------------------------------------------------------------------------------- /test-projects/dependencymanagement-using-parent-module-version-property/parent-module/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 4.0.0 7 | 8 | com.github.danielflower.mavenplugins.testprojects.dependencymanagement-using-parent-module-version-property 9 | parent-module 10 | ${parent-module.version} 11 | pom 12 | 13 | 1.8 14 | 1.8 15 | 16 | UTF-8 17 | 1.2.3-SNAPSHOT 18 | 1.8 19 | 1.8 20 | 21 | 22 | 23 | 24 | 25 | com.github.danielflower.mavenplugins.testprojects.dependencymanagement-using-parent-module-version-property 26 | root-bom 27 | 1.0-SNAPSHOT 28 | pom 29 | import 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | com.github.danielflower.mavenplugins 38 | multi-module-maven-release-plugin 39 | ${current.plugin.version} 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /test-projects/dependencymanagement-using-parent-module-version-property/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 4.0.0 7 | 8 | com.github.danielflower.mavenplugins.testprojects.dependencymanagement-using-parent-module-version-property 9 | dependencymanagement-aggregator 10 | 1.0-SNAPSHOT 11 | pom 12 | 13 | 1.8 14 | 1.8 15 | 16 | 17 | 18 | 19 | 20 | com.github.danielflower.mavenplugins 21 | multi-module-maven-release-plugin 22 | ${current.plugin.version} 23 | 24 | 25 | install 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | root-bom 34 | parent-module 35 | more-utilities 36 | the-core-utilities 37 | console-app 38 | 39 | 40 | -------------------------------------------------------------------------------- /test-projects/dependencymanagement-using-parent-module-version-property/root-bom/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 4.0.0 7 | 8 | com.github.danielflower.mavenplugins.testprojects.dependencymanagement-using-parent-module-version-property 9 | root-bom 10 | 1.0-SNAPSHOT 11 | pom 12 | 13 | 14 | 1.8 15 | 1.8 16 | 4.0 17 | 18 | 19 | 20 | 21 | 22 | junit 23 | junit 24 | ${junit.version} 25 | test 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | com.github.danielflower.mavenplugins 34 | multi-module-maven-release-plugin 35 | ${current.plugin.version} 36 | 37 | 38 | install 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /test-projects/dependencymanagement-using-parent-module-version-property/the-core-utilities/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 4.0.0 7 | 8 | 9 | parent-module 10 | com.github.danielflower.mavenplugins.testprojects.dependencymanagement-using-parent-module-version-property 11 | ${parent-module.version} 12 | ../parent-module/pom.xml 13 | 14 | 15 | core-utils 16 | The Core Utilities 17 | ${parent-module.version} 18 | 19 | 20 | 21 | com.github.danielflower.mavenplugins.testprojects.dependencymanagement-using-parent-module-version-property 22 | more-utils 23 | ${parent-module.version} 24 | 25 | 26 | junit 27 | junit 28 | test 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /test-projects/dependencymanagement-using-parent-module-version-property/the-core-utilities/src/main/java/com/github/danielflower/mavenplugins/testprojects/versioninheritor/Calculator.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.testprojects.versioninheritor; 2 | 3 | public class Calculator { 4 | 5 | public int add(int a, int b) { 6 | return a + b; 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /test-projects/dependencymanagement-using-parent-module-version-property/the-core-utilities/src/test/java/com/github/danielflower/mavenplugins/testprojects/versioninheritor/CalculatorTest.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.testprojects.versioninheritor; 2 | 3 | 4 | import org.junit.Assert; 5 | import org.junit.Test; 6 | 7 | public class CalculatorTest { 8 | 9 | @Test 10 | public void testAdd() throws Exception { 11 | Assert.assertEquals(3, new Calculator().add(1, 2)); 12 | System.out.println("The Calculator Test has run"); // used in a test to assert this has run 13 | } 14 | } -------------------------------------------------------------------------------- /test-projects/dependencymanagement/.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | .idea/ 3 | *.iml 4 | .classpath 5 | .settings 6 | .project 7 | -------------------------------------------------------------------------------- /test-projects/dependencymanagement/README.md: -------------------------------------------------------------------------------- 1 | In this project the aggregator pom is separate from the parent pom of the modules in this project. 2 | 3 | Other modules reference the parent pom using a relative path. -------------------------------------------------------------------------------- /test-projects/dependencymanagement/console-app/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 4.0.0 7 | 8 | 9 | parent-module 10 | com.github.danielflower.mavenplugins.testprojects.dependecymanagement 11 | 1.2.3-SNAPSHOT 12 | ../parent-module/pom.xml 13 | 14 | 15 | console-app 16 | 3.2-SNAPSHOT 17 | 18 | 19 | 20 | com.github.danielflower.mavenplugins.testprojects.dependecymanagement 21 | core-utils 22 | 2.0-SNAPSHOT 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /test-projects/dependencymanagement/console-app/src/main/java/com/github/danielflower/mavenplugins/testprojects/versioninheritor/App.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.testprojects.versioninheritor; 2 | 3 | public class App { 4 | public static void main(String[] args) { 5 | Calculator calculator = new Calculator(); 6 | System.out.println("1 + 2 = " + calculator.add(1, 2)); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /test-projects/dependencymanagement/more-utilities/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 4.0.0 7 | 8 | 9 | parent-module 10 | com.github.danielflower.mavenplugins.testprojects.dependecymanagement 11 | 1.2.3-SNAPSHOT 12 | ../parent-module/pom.xml 13 | 14 | 15 | more-utils 16 | 10.0-SNAPSHOT 17 | 18 | 19 | 20 | junit 21 | junit 22 | test 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /test-projects/dependencymanagement/more-utilities/src/main/java/com/github/danielflower/mavenplugins/testprojects/versioninheritor/Calculator.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.testprojects.versioninheritor; 2 | 3 | public class Calculator { 4 | 5 | public int add(int a, int b) { 6 | return a + b; 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /test-projects/dependencymanagement/more-utilities/src/test/java/com/github/danielflower/mavenplugins/testprojects/versioninheritor/CalculatorTest.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.testprojects.versioninheritor; 2 | 3 | 4 | import org.junit.Assert; 5 | import org.junit.Test; 6 | 7 | public class CalculatorTest { 8 | 9 | @Test 10 | public void testAdd() throws Exception { 11 | Assert.assertEquals(3, new Calculator().add(1, 2)); 12 | System.out.println("The Calculator Test has run"); // used in a test to assert this has run 13 | } 14 | } -------------------------------------------------------------------------------- /test-projects/dependencymanagement/parent-module/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 4.0.0 7 | 8 | com.github.danielflower.mavenplugins.testprojects.dependecymanagement 9 | parent-module 10 | 1.2.3-SNAPSHOT 11 | pom 12 | 13 | 14 | 1.8 15 | 1.8 16 | UTF-8 17 | 1.8 18 | 1.8 19 | 20 | 21 | 22 | 23 | 24 | com.github.danielflower.mavenplugins.testprojects.dependecymanagement 25 | root-bom 26 | 1.0-SNAPSHOT 27 | pom 28 | import 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | com.github.danielflower.mavenplugins 37 | multi-module-maven-release-plugin 38 | ${current.plugin.version} 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /test-projects/dependencymanagement/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 4.0.0 7 | 8 | com.github.danielflower.mavenplugins.testprojects.dependecymanagement 9 | dependencymanagement-aggregator 10 | 1.0-SNAPSHOT 11 | pom 12 | 13 | 14 | 1.8 15 | 1.8 16 | 17 | 18 | 19 | 20 | 21 | com.github.danielflower.mavenplugins 22 | multi-module-maven-release-plugin 23 | ${current.plugin.version} 24 | 25 | 26 | install 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | root-bom 35 | the-core-utilities 36 | console-app 37 | parent-module 38 | more-utilities 39 | 40 | 41 | -------------------------------------------------------------------------------- /test-projects/dependencymanagement/root-bom/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 4.0.0 7 | 8 | com.github.danielflower.mavenplugins.testprojects.dependecymanagement 9 | root-bom 10 | 1.0-SNAPSHOT 11 | 12 | pom 13 | 14 | 15 | 1.8 16 | 1.8 17 | 4.0 18 | 19 | 20 | 21 | 22 | 23 | junit 24 | junit 25 | ${junit.version} 26 | test 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | com.github.danielflower.mavenplugins 35 | multi-module-maven-release-plugin 36 | ${current.plugin.version} 37 | 38 | 39 | install 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /test-projects/dependencymanagement/the-core-utilities/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 4.0.0 7 | 8 | 9 | parent-module 10 | com.github.danielflower.mavenplugins.testprojects.dependecymanagement 11 | 1.2.3-SNAPSHOT 12 | ../parent-module/pom.xml 13 | 14 | 15 | core-utils 16 | The Core Utilities 17 | 2.0-SNAPSHOT 18 | 19 | 20 | 21 | com.github.danielflower.mavenplugins.testprojects.dependecymanagement 22 | more-utils 23 | 10.0-SNAPSHOT 24 | 25 | 26 | junit 27 | junit 28 | test 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /test-projects/dependencymanagement/the-core-utilities/src/main/java/com/github/danielflower/mavenplugins/testprojects/versioninheritor/Calculator.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.testprojects.versioninheritor; 2 | 3 | public class Calculator { 4 | 5 | public int add(int a, int b) { 6 | return a + b; 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /test-projects/dependencymanagement/the-core-utilities/src/test/java/com/github/danielflower/mavenplugins/testprojects/versioninheritor/CalculatorTest.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.testprojects.versioninheritor; 2 | 3 | 4 | import org.junit.Assert; 5 | import org.junit.Test; 6 | 7 | public class CalculatorTest { 8 | 9 | @Test 10 | public void testAdd() throws Exception { 11 | Assert.assertEquals(3, new Calculator().add(1, 2)); 12 | System.out.println("The Calculator Test has run"); // used in a test to assert this has run 13 | } 14 | } -------------------------------------------------------------------------------- /test-projects/different-delimiter/.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | .idea/ 3 | *.iml 4 | .classpath 5 | .settings 6 | .project 7 | -------------------------------------------------------------------------------- /test-projects/different-delimiter/assembly-descriptor.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | package 6 | 7 | jar 8 | 9 | 10 | false 11 | 12 | 13 | / 14 | true 15 | true 16 | runtime 17 | 18 | 19 | -------------------------------------------------------------------------------- /test-projects/different-delimiter/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 4.0.0 7 | 8 | com.github.danielflower.mavenplugins.testprojects 9 | different-delimiter 10 | 1.0.0-SNAPSHOT 11 | jar 12 | 13 | 14 | 1.8 15 | 1.8 16 | UTF-8 17 | 1.8 18 | 1.8 19 | 20 | 21 | 22 | 23 | 24 | 25 | com.github.danielflower.mavenplugins 26 | multi-module-maven-release-plugin 27 | ${current.plugin.version} 28 | 29 | 30 | install 31 | 32 | 33 | - 34 | 35 | 36 | 37 | 38 | 39 | com.google.code.echo-maven-plugin 40 | echo-maven-plugin 41 | 1.0.0 42 | false 43 | 44 | Hello from version ${project.version}! 45 | 46 | 47 | 48 | 49 | echo 50 | 51 | 52 | 53 | 54 | 55 | 56 | maven-assembly-plugin 57 | 2.5.3 58 | 59 | 60 | assembly-descriptor.xml 61 | 62 | 63 | 64 | 65 | make-assembly 66 | package 67 | 68 | single 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /test-projects/different-delimiter/src/main/java/com/github/danielflower/mavenplugins/testproject/singlepom/Main.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.testproject.singlepom; 2 | 3 | public class Main { 4 | public static void main(String[] args) { 5 | System.out.println("Hello world"); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /test-projects/independent-versions/.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | .idea/ 3 | *.iml 4 | .classpath 5 | .settings 6 | .project 7 | -------------------------------------------------------------------------------- /test-projects/independent-versions/console-app/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | independent-versions 7 | com.github.danielflower.mavenplugins.testprojects.independentversions 8 | 1.0-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | console-app 13 | 3.2-SNAPSHOT 14 | 15 | 16 | 17 | com.github.danielflower.mavenplugins.testprojects.independentversions 18 | core-utils 19 | 2.0-SNAPSHOT 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /test-projects/independent-versions/console-app/src/main/java/com/github/danielflower/mavenplugins/testprojects/versioninheritor/App.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.testprojects.versioninheritor; 2 | 3 | public class App { 4 | public static void main(String[] args) { 5 | Calculator calculator = new Calculator(); 6 | System.out.println("1 + 2 = " + calculator.add(1, 2)); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /test-projects/independent-versions/core-utils/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | independent-versions 7 | com.github.danielflower.mavenplugins.testprojects.independentversions 8 | 1.0-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | core-utils 13 | 2.0-SNAPSHOT 14 | 15 | 16 | 17 | junit 18 | junit 19 | 4.13.2 20 | test 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /test-projects/independent-versions/core-utils/src/main/java/com/github/danielflower/mavenplugins/testprojects/versioninheritor/Calculator.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.testprojects.versioninheritor; 2 | 3 | public class Calculator { 4 | 5 | public int add(int a, int b) { 6 | return a + b; 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /test-projects/independent-versions/core-utils/src/test/java/com/github/danielflower/mavenplugins/testprojects/versioninheritor/CalculatorTest.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.testprojects.versioninheritor; 2 | 3 | 4 | import org.junit.Assert; 5 | import org.junit.Test; 6 | 7 | public class CalculatorTest { 8 | 9 | @Test 10 | public void testAdd() throws Exception { 11 | Assert.assertEquals(3, new Calculator().add(1, 2)); 12 | System.out.println("The Calculator Test has run"); // used in a test to assert this has run 13 | } 14 | } -------------------------------------------------------------------------------- /test-projects/independent-versions/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 4.0.0 7 | 8 | com.github.danielflower.mavenplugins.testprojects.independentversions 9 | independent-versions 10 | 1.0-SNAPSHOT 11 | 12 | core-utils 13 | console-app 14 | 15 | pom 16 | 17 | 18 | 1.8 19 | 1.8 20 | UTF-8 21 | 1.8 22 | 1.8 23 | 24 | 25 | 26 | 27 | 28 | com.github.danielflower.mavenplugins 29 | multi-module-maven-release-plugin 30 | ${current.plugin.version} 31 | 32 | 33 | install 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /test-projects/inherited-versions-from-parent/.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | .idea/ 3 | *.iml 4 | .classpath 5 | .settings 6 | .project 7 | -------------------------------------------------------------------------------- /test-projects/inherited-versions-from-parent/console-app/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | inherited-versions-from-parent 7 | com.github.danielflower.mavenplugins.testprojects.versioninheritor 8 | 1.0-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | console-app 13 | 14 | 15 | 16 | com.github.danielflower.mavenplugins.testprojects.versioninheritor 17 | core-utils 18 | 1.0-SNAPSHOT 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /test-projects/inherited-versions-from-parent/console-app/src/main/java/com/github/danielflower/mavenplugins/testprojects/versioninheritor/App.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.testprojects.versioninheritor; 2 | 3 | public class App { 4 | public static void main(String[] args) { 5 | Calculator calculator = new Calculator(); 6 | System.out.println("1 + 2 = " + calculator.add(1, 2)); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /test-projects/inherited-versions-from-parent/core-utils/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | inherited-versions-from-parent 7 | com.github.danielflower.mavenplugins.testprojects.versioninheritor 8 | 1.0-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | core-utils 13 | 14 | 15 | 16 | junit 17 | junit 18 | 4.13.2 19 | test 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /test-projects/inherited-versions-from-parent/core-utils/src/main/java/com/github/danielflower/mavenplugins/testprojects/versioninheritor/Calculator.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.testprojects.versioninheritor; 2 | 3 | public class Calculator { 4 | 5 | public int add(int a, int b) { 6 | return a + b; 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /test-projects/inherited-versions-from-parent/core-utils/src/test/java/com/github/danielflower/mavenplugins/testprojects/versioninheritor/CalculatorTest.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.testprojects.versioninheritor; 2 | 3 | 4 | import org.junit.Assert; 5 | import org.junit.Test; 6 | 7 | public class CalculatorTest { 8 | 9 | @Test 10 | public void testAdd() throws Exception { 11 | Assert.assertEquals(3, new Calculator().add(1, 2)); 12 | System.out.println("The Calculator Test has run"); // used in a test to assert this has run 13 | } 14 | } -------------------------------------------------------------------------------- /test-projects/inherited-versions-from-parent/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 4.0.0 7 | 8 | com.github.danielflower.mavenplugins.testprojects.versioninheritor 9 | inherited-versions-from-parent 10 | 1.0-SNAPSHOT 11 | 12 | core-utils 13 | console-app 14 | 15 | pom 16 | 17 | 18 | 1.8 19 | 1.8 20 | UTF-8 21 | 1.8 22 | 1.8 23 | 24 | 25 | 26 | 27 | 28 | com.github.danielflower.mavenplugins 29 | multi-module-maven-release-plugin 30 | ${current.plugin.version} 31 | 32 | 33 | install 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /test-projects/local-plugin/common/local-maven-plugin/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | common 7 | com.github.danielflower.mavenplugins.testprojects 8 | ${my.version} 9 | 10 | 4.0.0 11 | 12 | local-maven-plugin 13 | maven-plugin 14 | 15 | 16 | 17 | org.apache.maven 18 | maven-plugin-api 19 | 3.0 20 | 21 | 22 | 23 | 24 | org.apache.maven.plugin-tools 25 | maven-plugin-annotations 26 | 3.4 27 | provided 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /test-projects/local-plugin/common/local-maven-plugin/src/main/java/com/github/danielflower/mavenplugins/testproject/localplugin/pluginproject/MyMojo.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.testproject.localplugin.pluginproject; 2 | 3 | import org.apache.maven.plugin.AbstractMojo; 4 | import org.apache.maven.plugin.MojoExecutionException; 5 | import org.apache.maven.plugin.MojoFailureException; 6 | import org.apache.maven.plugins.annotations.Mojo; 7 | 8 | @Mojo( name = "helloworld") 9 | public class MyMojo extends AbstractMojo { 10 | public void execute() throws MojoExecutionException, MojoFailureException { 11 | 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /test-projects/local-plugin/common/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | local-plugin 7 | com.github.danielflower.mavenplugins.testprojects 8 | ${my.version} 9 | 10 | 4.0.0 11 | 12 | common 13 | pom 14 | 15 | 16 | local-maven-plugin 17 | 18 | 19 | -------------------------------------------------------------------------------- /test-projects/local-plugin/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | com.github.danielflower.mavenplugins.testprojects 8 | local-plugin 9 | pom 10 | ${my.version} 11 | 12 | 13 | 1.8 14 | 1.8 15 | 1.0-SNAPSHOT 16 | 1.8 17 | 1.8 18 | 19 | 20 | 21 | common 22 | services 23 | 24 | 25 | 26 | 27 | 28 | com.github.danielflower.mavenplugins 29 | multi-module-maven-release-plugin 30 | ${current.plugin.version} 31 | 32 | 33 | install 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | com.github.danielflower.mavenplugins.testprojects 43 | local-maven-plugin 44 | ${my.version} 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /test-projects/local-plugin/services/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | local-plugin 7 | com.github.danielflower.mavenplugins.testprojects 8 | ${my.version} 9 | 10 | 4.0.0 11 | 12 | services 13 | pom 14 | 15 | 16 | simple-project 17 | 18 | -------------------------------------------------------------------------------- /test-projects/local-plugin/services/simple-project/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | services 7 | com.github.danielflower.mavenplugins.testprojects 8 | ${my.version} 9 | 10 | 4.0.0 11 | 12 | simple-project 13 | 14 | 15 | 16 | 17 | com.github.danielflower.mavenplugins.testprojects 18 | local-maven-plugin 19 | ${my.version} 20 | 21 | 22 | install 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | snapshot-version 32 | 33 | 34 | apache.snapshots 35 | https://repository.apache.org/snapshots/ 36 | 37 | 38 | 39 | 40 | 41 | commons-io 42 | commons-io 43 | 2.7-SNAPSHOT 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /test-projects/local-plugin/services/simple-project/src/main/java/com/github/danielflower/mavenplugins/testprojects/simpleproject/Main.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.testprojects.simpleproject; 2 | 3 | public class Main { 4 | public static void main() { 5 | 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /test-projects/module-with-profiles/.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | .idea/ 3 | *.iml 4 | .classpath 5 | .settings 6 | .project 7 | -------------------------------------------------------------------------------- /test-projects/module-with-profiles/custom-settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | settingsFileStuff 7 | 8 | true 9 | 10 | 11 | value-from-settings-file 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /test-projects/module-with-profiles/src/main/java/com/github/danielflower/mavenplugins/testproject/singlepom/Main.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.testproject.singlepom; 2 | 3 | public class Main { 4 | public static void main(String[] args) { 5 | System.out.println("Hello world"); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /test-projects/module-with-profiles/src/test/java/com/github/danielflower/mavenplugins/testproject/singlepom/MainTest.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.testproject.singlepom; 2 | 3 | import org.junit.Test; 4 | 5 | public class MainTest { 6 | @Test 7 | public void aTestThatFails() throws Exception { 8 | System.out.println("The module-with-profiles test has run"); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /test-projects/module-with-scm-tag/.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | .idea/ 3 | *.iml 4 | .classpath 5 | .settings 6 | .project 7 | -------------------------------------------------------------------------------- /test-projects/module-with-scm-tag/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 4.0.0 7 | 8 | com.github.danielflower.mavenplugins.testprojects 9 | scmtag 10 | 1.0-SNAPSHOT 11 | pom 12 | 13 | 14 | 1.8 15 | 1.8 16 | UTF-8 17 | 1.8 18 | 1.8 19 | 20 | 21 | 22 | 23 | ${scm.url} 24 | ${scm.url} 25 | 26 | 27 | 28 | 29 | 30 | com.github.danielflower.mavenplugins 31 | multi-module-maven-release-plugin 32 | ${current.plugin.version} 33 | 34 | 35 | install 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /test-projects/module-with-test-failure/.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | .idea/ 3 | *.iml 4 | .classpath 5 | .settings 6 | .project 7 | -------------------------------------------------------------------------------- /test-projects/module-with-test-failure/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 4.0.0 7 | 8 | com.github.danielflower.mavenplugins.testprojects 9 | module-with-test-failure 10 | 1.0-SNAPSHOT 11 | jar 12 | 13 | 14 | 1.8 15 | 1.8 16 | UTF-8 17 | 1.8 18 | 1.8 19 | 20 | 21 | 22 | 23 | junit 24 | junit 25 | 4.13.2 26 | test 27 | 28 | 29 | 30 | 31 | 32 | 33 | com.github.danielflower.mavenplugins 34 | multi-module-maven-release-plugin 35 | ${current.plugin.version} 36 | 37 | 38 | install 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /test-projects/module-with-test-failure/src/main/java/com/github/danielflower/mavenplugins/testproject/singlepom/Main.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.testproject.singlepom; 2 | 3 | public class Main { 4 | public static void main(String[] args) { 5 | System.out.println("Hello world"); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /test-projects/module-with-test-failure/src/test/java/com/github/danielflower/mavenplugins/testproject/singlepom/MainTest.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.testproject.singlepom; 2 | 3 | import org.junit.Assert; 4 | 5 | public class MainTest { 6 | @org.junit.Test 7 | public void aTestThatFails() throws Exception { 8 | Assert.assertEquals("wave", "particle"); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /test-projects/nested-project/.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | .idea/ 3 | *.iml 4 | .classpath 5 | .settings 6 | .project 7 | -------------------------------------------------------------------------------- /test-projects/nested-project/console-app/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | parent-module 7 | com.github.danielflower.mavenplugins.testprojects.nested 8 | 1.2.3-SNAPSHOT 9 | ../parent-module/pom.xml 10 | 11 | 4.0.0 12 | 13 | console-app 14 | 3.2-SNAPSHOT 15 | 16 | 17 | 18 | com.github.danielflower.mavenplugins.testprojects.nested 19 | core-utils 20 | 2.0-SNAPSHOT 21 | 22 | 23 | com.github.danielflower.mavenplugins.testprojects.nested.misnamed 24 | server-module-c 25 | 3.2-SNAPSHOT 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /test-projects/nested-project/console-app/src/main/java/com/github/danielflower/mavenplugins/testprojects/versioninheritor/App.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.testprojects.versioninheritor; 2 | 3 | public class App { 4 | public static void main(String[] args) { 5 | Calculator calculator = new Calculator(); 6 | System.out.println("1 + 2 = " + calculator.add(1, 2)); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /test-projects/nested-project/core-utils/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | parent-module 7 | com.github.danielflower.mavenplugins.testprojects.nested 8 | 1.2.3-SNAPSHOT 9 | ../parent-module/pom.xml 10 | 11 | 4.0.0 12 | 13 | core-utils 14 | 2.0-SNAPSHOT 15 | 16 | 17 | 18 | junit 19 | junit 20 | 4.13.2 21 | test 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /test-projects/nested-project/core-utils/src/main/java/com/github/danielflower/mavenplugins/testprojects/versioninheritor/Calculator.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.testprojects.versioninheritor; 2 | 3 | public class Calculator { 4 | 5 | public int add(int a, int b) { 6 | return a + b; 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /test-projects/nested-project/core-utils/src/test/java/com/github/danielflower/mavenplugins/testprojects/versioninheritor/CalculatorTest.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.testprojects.versioninheritor; 2 | 3 | 4 | import org.junit.Assert; 5 | import org.junit.Test; 6 | 7 | public class CalculatorTest { 8 | 9 | @Test 10 | public void testAdd() throws Exception { 11 | Assert.assertEquals(3, new Calculator().add(1, 2)); 12 | System.out.println("The Calculator Test has run"); // used in a test to assert this has run 13 | } 14 | } -------------------------------------------------------------------------------- /test-projects/nested-project/parent-module/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 4.0.0 7 | 8 | com.github.danielflower.mavenplugins.testprojects.nested 9 | parent-module 10 | 1.2.3-SNAPSHOT 11 | pom 12 | 13 | 14 | 1.8 15 | 1.8 16 | UTF-8 17 | 1.8 18 | 1.8 19 | 20 | 21 | 22 | 23 | 24 | com.github.danielflower.mavenplugins 25 | multi-module-maven-release-plugin 26 | ${current.plugin.version} 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /test-projects/nested-project/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 4.0.0 7 | 8 | com.github.danielflower.mavenplugins.testprojects.nested 9 | nested-project 10 | 0.0-SNAPSHOT 11 | 12 | core-utils 13 | console-app 14 | parent-module 15 | server-modules 16 | 17 | pom 18 | 19 | 20 | 1.8 21 | 1.8 22 | 23 | 24 | 25 | 26 | 27 | com.github.danielflower.mavenplugins 28 | multi-module-maven-release-plugin 29 | ${current.plugin.version} 30 | 31 | 32 | install 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /test-projects/nested-project/server-modules/a-misnamed-one/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | parent-module 7 | com.github.danielflower.mavenplugins.testprojects.nested 8 | 1.2.3-SNAPSHOT 9 | ../../parent-module/pom.xml 10 | 11 | 4.0.0 12 | 13 | com.github.danielflower.mavenplugins.testprojects.nested.misnamed 14 | server-module-c 15 | 3.2-SNAPSHOT 16 | 17 | 18 | 19 | junit 20 | junit 21 | 4.13.2 22 | test 23 | 24 | 25 | com.github.danielflower.mavenplugins.testprojects.nested 26 | server-module-b 27 | 3.1-SNAPSHOT 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /test-projects/nested-project/server-modules/a-misnamed-one/src/main/java/com/github/danielflower/mavenplugins/testprojects/versioninheritor/Calculator.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.testprojects.versioninheritor; 2 | 3 | public class Calculator { 4 | 5 | public int add(int a, int b) { 6 | return a + b; 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /test-projects/nested-project/server-modules/a-misnamed-one/src/test/java/com/github/danielflower/mavenplugins/testprojects/versioninheritor/CalculatorTest.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.testprojects.versioninheritor; 2 | 3 | 4 | import org.junit.Assert; 5 | import org.junit.Test; 6 | 7 | public class CalculatorTest { 8 | 9 | @Test 10 | public void testAdd() throws Exception { 11 | Assert.assertEquals(3, new Calculator().add(1, 2)); 12 | System.out.println("The Calculator Test has run"); // used in a test to assert this has run 13 | } 14 | } -------------------------------------------------------------------------------- /test-projects/nested-project/server-modules/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 4.0.0 7 | 8 | com.github.danielflower.mavenplugins.testprojects.nested 9 | server-modules 10 | 1.0.2.4-SNAPSHOT 11 | 12 | server-module-a 13 | server-module-b 14 | a-misnamed-one 15 | 16 | pom 17 | 18 | 19 | 1.8 20 | 1.8 21 | 22 | 23 | 24 | 25 | 26 | com.github.danielflower.mavenplugins 27 | multi-module-maven-release-plugin 28 | ${current.plugin.version} 29 | 30 | 31 | install 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /test-projects/nested-project/server-modules/server-module-a/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | parent-module 7 | com.github.danielflower.mavenplugins.testprojects.nested 8 | 1.2.3-SNAPSHOT 9 | ../../parent-module/pom.xml 10 | 11 | 4.0.0 12 | 13 | server-module-a 14 | 3.0-SNAPSHOT 15 | 16 | 17 | 18 | junit 19 | junit 20 | 4.13.2 21 | test 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /test-projects/nested-project/server-modules/server-module-a/src/main/java/com/github/danielflower/mavenplugins/testprojects/versioninheritor/Calculator.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.testprojects.versioninheritor; 2 | 3 | public class Calculator { 4 | 5 | public int add(int a, int b) { 6 | return a + b; 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /test-projects/nested-project/server-modules/server-module-a/src/test/java/com/github/danielflower/mavenplugins/testprojects/versioninheritor/CalculatorTest.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.testprojects.versioninheritor; 2 | 3 | 4 | import org.junit.Assert; 5 | import org.junit.Test; 6 | 7 | public class CalculatorTest { 8 | 9 | @Test 10 | public void testAdd() throws Exception { 11 | Assert.assertEquals(3, new Calculator().add(1, 2)); 12 | System.out.println("The Calculator Test has run"); // used in a test to assert this has run 13 | } 14 | } -------------------------------------------------------------------------------- /test-projects/nested-project/server-modules/server-module-b/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | parent-module 7 | com.github.danielflower.mavenplugins.testprojects.nested 8 | 1.2.3-SNAPSHOT 9 | ../../parent-module/pom.xml 10 | 11 | 4.0.0 12 | 13 | server-module-b 14 | 3.1-SNAPSHOT 15 | 16 | 17 | 18 | junit 19 | junit 20 | 4.13.2 21 | test 22 | 23 | 24 | com.github.danielflower.mavenplugins.testprojects.nested 25 | server-module-a 26 | 3.0-SNAPSHOT 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /test-projects/nested-project/server-modules/server-module-b/src/main/java/com/github/danielflower/mavenplugins/testprojects/versioninheritor/Calculator.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.testprojects.versioninheritor; 2 | 3 | public class Calculator { 4 | 5 | public int add(int a, int b) { 6 | return a + b; 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /test-projects/nested-project/server-modules/server-module-b/src/test/java/com/github/danielflower/mavenplugins/testprojects/versioninheritor/CalculatorTest.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.testprojects.versioninheritor; 2 | 3 | 4 | import org.junit.Assert; 5 | import org.junit.Test; 6 | 7 | public class CalculatorTest { 8 | 9 | @Test 10 | public void testAdd() throws Exception { 11 | Assert.assertEquals(3, new Calculator().add(1, 2)); 12 | System.out.println("The Calculator Test has run"); // used in a test to assert this has run 13 | } 14 | } -------------------------------------------------------------------------------- /test-projects/parent-as-sibling/.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | .idea/ 3 | *.iml 4 | .classpath 5 | .settings 6 | .project 7 | -------------------------------------------------------------------------------- /test-projects/parent-as-sibling/README.md: -------------------------------------------------------------------------------- 1 | In this project the aggregator pom is separate from the parent pom of the modules in this project. 2 | 3 | Other modules reference the parent pom using a relative path. -------------------------------------------------------------------------------- /test-projects/parent-as-sibling/console-app/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | parent-module 7 | com.github.danielflower.mavenplugins.testprojects.parentassibling 8 | 1.2.3-SNAPSHOT 9 | ../parent-module/pom.xml 10 | 11 | 4.0.0 12 | 13 | console-app 14 | 3.2-SNAPSHOT 15 | 16 | 17 | 18 | com.github.danielflower.mavenplugins.testprojects.parentassibling 19 | core-utils 20 | 2.0-SNAPSHOT 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /test-projects/parent-as-sibling/console-app/src/main/java/com/github/danielflower/mavenplugins/testprojects/versioninheritor/App.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.testprojects.versioninheritor; 2 | 3 | public class App { 4 | public static void main(String[] args) { 5 | Calculator calculator = new Calculator(); 6 | System.out.println("1 + 2 = " + calculator.add(1, 2)); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /test-projects/parent-as-sibling/core-utils/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | parent-module 7 | com.github.danielflower.mavenplugins.testprojects.parentassibling 8 | 1.2.3-SNAPSHOT 9 | ../parent-module/pom.xml 10 | 11 | 4.0.0 12 | 13 | core-utils 14 | 2.0-SNAPSHOT 15 | 16 | 17 | 18 | junit 19 | junit 20 | 4.13.2 21 | test 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /test-projects/parent-as-sibling/core-utils/src/main/java/com/github/danielflower/mavenplugins/testprojects/versioninheritor/Calculator.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.testprojects.versioninheritor; 2 | 3 | public class Calculator { 4 | 5 | public int add(int a, int b) { 6 | return a + b; 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /test-projects/parent-as-sibling/core-utils/src/test/java/com/github/danielflower/mavenplugins/testprojects/versioninheritor/CalculatorTest.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.testprojects.versioninheritor; 2 | 3 | 4 | import org.junit.Assert; 5 | import org.junit.Test; 6 | 7 | public class CalculatorTest { 8 | 9 | @Test 10 | public void testAdd() throws Exception { 11 | Assert.assertEquals(3, new Calculator().add(1, 2)); 12 | System.out.println("The Calculator Test has run"); // used in a test to assert this has run 13 | } 14 | } -------------------------------------------------------------------------------- /test-projects/parent-as-sibling/parent-module/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 4.0.0 7 | 8 | com.github.danielflower.mavenplugins.testprojects.parentassibling 9 | parent-module 10 | 1.2.3-SNAPSHOT 11 | pom 12 | 13 | 14 | 1.8 15 | 1.8 16 | UTF-8 17 | 1.8 18 | 1.8 19 | 20 | 21 | 22 | 23 | 24 | com.github.danielflower.mavenplugins 25 | multi-module-maven-release-plugin 26 | ${current.plugin.version} 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /test-projects/parent-as-sibling/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 4.0.0 7 | 8 | com.github.danielflower.mavenplugins.testprojects.parentassibling 9 | parent-as-sibling 10 | 1.0-SNAPSHOT 11 | 12 | core-utils 13 | console-app 14 | parent-module 15 | 16 | pom 17 | 18 | 19 | 1.8 20 | 1.8 21 | 22 | 23 | 24 | 25 | 26 | com.github.danielflower.mavenplugins 27 | multi-module-maven-release-plugin 28 | ${current.plugin.version} 29 | 30 | 31 | install 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /test-projects/single-module/.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | .idea/ 3 | *.iml 4 | .classpath 5 | .settings 6 | .project 7 | -------------------------------------------------------------------------------- /test-projects/single-module/assembly-descriptor.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | package 6 | 7 | jar 8 | 9 | 10 | false 11 | 12 | 13 | / 14 | true 15 | true 16 | runtime 17 | 18 | 19 | -------------------------------------------------------------------------------- /test-projects/single-module/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 4.0.0 7 | 8 | com.github.danielflower.mavenplugins.testprojects 9 | single-module 10 | 1.0-SNAPSHOT 11 | jar 12 | 13 | 14 | 1.8 15 | 1.8 16 | UTF-8 17 | 1.8 18 | 1.8 19 | 20 | 21 | 22 | 23 | 24 | 25 | com.github.danielflower.mavenplugins 26 | multi-module-maven-release-plugin 27 | ${current.plugin.version} 28 | 29 | 30 | install 31 | 32 | 33 | 34 | 35 | 36 | com.google.code.echo-maven-plugin 37 | echo-maven-plugin 38 | 1.0.0 39 | false 40 | 41 | Hello from version ${project.version}! 42 | 43 | 44 | 45 | 46 | echo 47 | 48 | 49 | 50 | 51 | 52 | 53 | maven-assembly-plugin 54 | 2.5.3 55 | 56 | 57 | assembly-descriptor.xml 58 | 59 | 60 | 61 | 62 | make-assembly 63 | package 64 | 65 | single 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 77 | 78 | 79 | Central Maven repository 80 | Central Maven repository https 81 | https://repo.maven.apache.org/maven2 82 | 83 | 84 | 85 | 86 | Central Maven repository 87 | Central Maven repository https 88 | https://repo.maven.apache.org/maven2 89 | 90 | 91 | -------------------------------------------------------------------------------- /test-projects/single-module/src/main/java/com/github/danielflower/mavenplugins/testproject/singlepom/Main.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.testproject.singlepom; 2 | 3 | public class Main { 4 | public static void main(String[] args) { 5 | System.out.println("Hello world"); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /test-projects/snapshot-dependencies-with-version-properties/.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | .idea/ 3 | *.iml 4 | .classpath 5 | .settings 6 | .project 7 | -------------------------------------------------------------------------------- /test-projects/snapshot-dependencies-with-version-properties/assembly-descriptor.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | package 6 | 7 | jar 8 | 9 | 10 | false 11 | 12 | 13 | / 14 | true 15 | true 16 | runtime 17 | 18 | 19 | -------------------------------------------------------------------------------- /test-projects/snapshot-dependencies-with-version-properties/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 4.0.0 7 | 8 | com.github.danielflower.mavenplugins.testprojects.snapshotdependencies 9 | snapshot-dependencies-with-version-properties 10 | 1.0-SNAPSHOT 11 | jar 12 | Project with snapshot dependencies 13 | 14 | 15 | 1.8 16 | 1.8 17 | UTF-8 18 | 1.8 19 | 1.8 20 | 2.0-SNAPSHOT 21 | 22 | 23 | 24 | 25 | com.github.danielflower.mavenplugins.testprojects.independentversions 26 | core-utils 27 | ${core-utils.version} 28 | 29 | 30 | 31 | 32 | 33 | 34 | com.github.danielflower.mavenplugins 35 | multi-module-maven-release-plugin 36 | ${current.plugin.version} 37 | 38 | 39 | install 40 | 41 | 42 | 43 | 44 | 45 | com.google.code.echo-maven-plugin 46 | echo-maven-plugin 47 | 1.0.0 48 | false 49 | 50 | Hello from version ${project.version}! 51 | 52 | 53 | 54 | 55 | echo 56 | 57 | 58 | 59 | 60 | 61 | 62 | maven-assembly-plugin 63 | 2.5.3 64 | 65 | 66 | assembly-descriptor.xml 67 | 68 | 69 | 70 | 71 | make-assembly 72 | package 73 | 74 | single 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /test-projects/snapshot-dependencies-with-version-properties/src/main/java/com/github/danielflower/mavenplugins/testproject/snapshotdependencies/Main.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.testproject.snapshotdependencies; 2 | 3 | public class Main { 4 | public static void main(String[] args) { 5 | System.out.println("Hello world"); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /test-projects/snapshot-dependencies/.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | .idea/ 3 | *.iml 4 | .classpath 5 | .settings 6 | .project 7 | -------------------------------------------------------------------------------- /test-projects/snapshot-dependencies/assembly-descriptor.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | package 6 | 7 | jar 8 | 9 | 10 | false 11 | 12 | 13 | / 14 | true 15 | true 16 | runtime 17 | 18 | 19 | -------------------------------------------------------------------------------- /test-projects/snapshot-dependencies/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 4.0.0 7 | 8 | com.github.danielflower.mavenplugins.testprojects.snapshotdependencies 9 | snapshot-dependencies 10 | 1.0-SNAPSHOT 11 | jar 12 | Project with snapshot dependencies 13 | 14 | 15 | com.github.danielflower.mavenplugins.testprojects.independentversions 16 | independent-versions 17 | 1.0-SNAPSHOT 18 | 19 | 20 | 21 | UTF-8 22 | 23 | 24 | 25 | 26 | com.github.danielflower.mavenplugins.testprojects.independentversions 27 | core-utils 28 | 2.0-SNAPSHOT 29 | 30 | 31 | 32 | 33 | 34 | 35 | com.github.danielflower.mavenplugins 36 | multi-module-maven-release-plugin 37 | ${current.plugin.version} 38 | 39 | 40 | install 41 | 42 | 43 | 44 | 45 | 46 | com.google.code.echo-maven-plugin 47 | echo-maven-plugin 48 | 1.0.0 49 | false 50 | 51 | Hello from version ${project.version}! 52 | 53 | 54 | 55 | 56 | echo 57 | 58 | 59 | 60 | 61 | 62 | 63 | maven-assembly-plugin 64 | 2.5.3 65 | 66 | 67 | assembly-descriptor.xml 68 | 69 | 70 | 71 | 72 | make-assembly 73 | package 74 | 75 | single 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /test-projects/snapshot-dependencies/src/main/java/com/github/danielflower/mavenplugins/testproject/snapshotdependencies/Main.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.testproject.snapshotdependencies; 2 | 3 | public class Main { 4 | public static void main(String[] args) { 5 | System.out.println("Hello world"); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /test-projects/version-only-tag/.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | .idea/ 3 | *.iml 4 | .classpath 5 | .settings 6 | .project 7 | -------------------------------------------------------------------------------- /test-projects/version-only-tag/assembly-descriptor.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | package 6 | 7 | jar 8 | 9 | 10 | false 11 | 12 | 13 | / 14 | true 15 | true 16 | runtime 17 | 18 | 19 | -------------------------------------------------------------------------------- /test-projects/version-only-tag/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 4.0.0 7 | 8 | com.github.danielflower.mavenplugins.testprojects 9 | version-only-tag 10 | 2.0-SNAPSHOT 11 | jar 12 | 13 | 14 | 1.8 15 | 1.8 16 | UTF-8 17 | 1.8 18 | 1.8 19 | 20 | 21 | 22 | 23 | 24 | 25 | com.github.danielflower.mavenplugins 26 | multi-module-maven-release-plugin 27 | ${current.plugin.version} 28 | 29 | 30 | install 31 | 32 | @{version} 33 | 34 | 35 | 36 | 37 | com.google.code.echo-maven-plugin 38 | echo-maven-plugin 39 | 1.0.0 40 | false 41 | 42 | Hello from version ${project.version}! 43 | 44 | 45 | 46 | 47 | echo 48 | 49 | 50 | 51 | 52 | 53 | 54 | maven-assembly-plugin 55 | 2.5.3 56 | 57 | 58 | assembly-descriptor.xml 59 | 60 | 61 | 62 | 63 | make-assembly 64 | package 65 | 66 | single 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 78 | 79 | 80 | Central Maven repository 81 | Central Maven repository https 82 | https://repo.maven.apache.org/maven2 83 | 84 | 85 | 86 | 87 | Central Maven repository 88 | Central Maven repository https 89 | https://repo.maven.apache.org/maven2 90 | 91 | 92 | -------------------------------------------------------------------------------- /test-projects/version-only-tag/src/main/java/com/github/danielflower/mavenplugins/testproject/singlepom/Main.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.testproject.singlepom; 2 | 3 | public class Main { 4 | public static void main(String[] args) { 5 | System.out.println("Hello world"); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /test-projects/version-report/.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | .idea/ 3 | *.iml 4 | .classpath 5 | .settings 6 | .project 7 | -------------------------------------------------------------------------------- /test-projects/version-report/console-app/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | independent-versions 7 | com.github.danielflower.mavenplugins.testprojects.independentversions 8 | 1.0-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | console-app 13 | 3.2-SNAPSHOT 14 | 15 | 16 | 17 | com.github.danielflower.mavenplugins.testprojects.independentversions 18 | core-utils 19 | 2.0-SNAPSHOT 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /test-projects/version-report/console-app/src/main/java/com/github/danielflower/mavenplugins/testprojects/versioninheritor/App.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.testprojects.versioninheritor; 2 | 3 | public class App { 4 | public static void main(String[] args) { 5 | Calculator calculator = new Calculator(); 6 | System.out.println("1 + 2 = " + calculator.add(1, 2)); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /test-projects/version-report/core-utils/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | independent-versions 7 | com.github.danielflower.mavenplugins.testprojects.independentversions 8 | 1.0-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | core-utils 13 | 2.0-SNAPSHOT 14 | 15 | 16 | 17 | junit 18 | junit 19 | 4.13.2 20 | test 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /test-projects/version-report/core-utils/src/main/java/com/github/danielflower/mavenplugins/testprojects/versioninheritor/Calculator.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.testprojects.versioninheritor; 2 | 3 | public class Calculator { 4 | 5 | public int add(int a, int b) { 6 | return a + b; 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /test-projects/version-report/core-utils/src/test/java/com/github/danielflower/mavenplugins/testprojects/versioninheritor/CalculatorTest.java: -------------------------------------------------------------------------------- 1 | package com.github.danielflower.mavenplugins.testprojects.versioninheritor; 2 | 3 | 4 | import org.junit.Assert; 5 | import org.junit.Test; 6 | 7 | public class CalculatorTest { 8 | 9 | @Test 10 | public void testAdd() throws Exception { 11 | Assert.assertEquals(3, new Calculator().add(1, 2)); 12 | System.out.println("The Calculator Test has run"); // used in a test to assert this has run 13 | } 14 | } -------------------------------------------------------------------------------- /test-projects/version-report/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 4.0.0 7 | 8 | com.github.danielflower.mavenplugins.testprojects.independentversions 9 | independent-versions 10 | 1.0-SNAPSHOT 11 | 12 | core-utils 13 | console-app 14 | 15 | pom 16 | 17 | 18 | UTF-8 19 | 1.8 20 | 1.8 21 | 22 | 23 | 24 | 25 | 26 | com.github.danielflower.mavenplugins 27 | multi-module-maven-release-plugin 28 | ${current.plugin.version} 29 | 30 | 31 | 32 | released-report.txt 33 | FLAT 34 | true 35 | 36 | 37 | released-report.json 38 | JSON 39 | true 40 | 41 | 42 | version-report.json 43 | JSON 44 | false 45 | 46 | 47 | 48 | install 49 | 50 | 51 | 52 | 53 | 54 | --------------------------------------------------------------------------------