├── .gitattributes ├── .github ├── FUNDING.yml ├── ISSUE_TEMPLATE.md ├── PULL_REQUEST_TEMPLATE.md └── workflows │ └── maven.yml ├── .gitignore ├── .lgtm.yml ├── .mvn ├── extensions.xml ├── jgitver.config.xml ├── jvm.config └── wrapper │ ├── MavenWrapperDownloader.java │ ├── maven-wrapper.jar │ └── maven-wrapper.properties ├── .travis.yml ├── AUTHORS.md ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── changelog.mustache ├── mvnw ├── mvnw.cmd ├── pom.xml ├── src ├── ci │ └── build-with-external-it-fallback.sh ├── doc │ ├── changelog.mustache │ ├── images │ │ ├── black_email_16.png │ │ ├── jgitver-maven-like.gif │ │ ├── jgitver-maven-plugin-homepage.png │ │ ├── jgitver-maven-plugin-homepage.xml │ │ └── s7_linear_with_SNAPSHOT_tags_and_branch.gif │ └── scripts │ │ └── install.sh ├── it │ ├── branch-policy-uppercase-en │ │ ├── .gitignore │ │ ├── .mvn │ │ │ ├── extensions.xml │ │ │ └── jgitver.config.xml │ │ ├── pom.xml │ │ ├── prebuild.groovy │ │ └── verify.groovy │ ├── failIfDirty │ │ ├── failing │ │ │ ├── .gitignore │ │ │ ├── .mvn │ │ │ │ ├── extensions.xml │ │ │ │ └── jgitver.config.xml │ │ │ ├── invoker.properties │ │ │ ├── pom.xml │ │ │ ├── prebuild.groovy │ │ │ └── verify.groovy │ │ └── working │ │ │ ├── .gitignore │ │ │ ├── .mvn │ │ │ ├── extensions.xml │ │ │ └── jgitver.config.xml │ │ │ ├── pom.xml │ │ │ ├── prebuild.groovy │ │ │ └── verify.groovy │ ├── issues │ │ ├── issue-111-LATEST │ │ │ ├── .gitignore │ │ │ ├── .mvn │ │ │ │ ├── extensions.xml │ │ │ │ └── jgitver.config.xml │ │ │ ├── pom.xml │ │ │ ├── prebuild.groovy │ │ │ └── verify.groovy │ │ ├── issue-111-MAX │ │ │ ├── .gitignore │ │ │ ├── .mvn │ │ │ │ ├── extensions.xml │ │ │ │ └── jgitver.config.xml │ │ │ ├── pom.xml │ │ │ ├── prebuild.groovy │ │ │ └── verify.groovy │ │ ├── issue-111-NEAREST │ │ │ ├── .gitignore │ │ │ ├── .mvn │ │ │ │ ├── extensions.xml │ │ │ │ └── jgitver.config.xml │ │ │ ├── pom.xml │ │ │ ├── prebuild.groovy │ │ │ └── verify.groovy │ │ ├── issue-26 │ │ │ ├── .gitignore │ │ │ ├── .mvn │ │ │ │ └── extensions.xml │ │ │ ├── invoker.properties │ │ │ ├── module │ │ │ │ └── pom.xml │ │ │ ├── pom.xml │ │ │ ├── prebuild.groovy │ │ │ └── verify.groovy │ │ ├── issue-30-pre │ │ │ ├── pom.xml │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── java │ │ │ │ └── outside │ │ │ │ └── IntSetBuilder.java │ │ ├── issue-30 │ │ │ ├── .gitignore │ │ │ ├── .mvn │ │ │ │ └── extensions.xml │ │ │ ├── invoker.properties │ │ │ ├── pom.xml │ │ │ ├── prebuild.groovy │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ └── java │ │ │ │ │ └── inside │ │ │ │ │ └── Main.java │ │ │ └── verify.groovy │ │ ├── issue-35.1 │ │ │ ├── .gitignore │ │ │ ├── .mvn │ │ │ │ └── extensions.xml │ │ │ ├── invoker.properties │ │ │ ├── pom.xml │ │ │ ├── prebuild.groovy │ │ │ └── verify.groovy │ │ ├── issue-35.2 │ │ │ ├── .gitignore │ │ │ ├── .mvn │ │ │ │ └── extensions.xml │ │ │ ├── invoker.properties │ │ │ ├── pom.xml │ │ │ ├── prebuild.groovy │ │ │ └── verify.groovy │ │ ├── issue-36.1 │ │ │ ├── .gitignore │ │ │ ├── .mvn │ │ │ │ ├── extensions.xml │ │ │ │ └── jgitver.config.xml │ │ │ ├── pom.xml │ │ │ ├── prebuild.groovy │ │ │ └── verify.groovy │ │ ├── issue-36.2 │ │ │ ├── .gitignore │ │ │ ├── .mvn │ │ │ │ ├── extensions.xml │ │ │ │ └── jgitver.config.xml │ │ │ ├── pom.xml │ │ │ ├── prebuild.groovy │ │ │ └── verify.groovy │ │ ├── issue-50-validate │ │ │ ├── .gitignore │ │ │ ├── .mvn │ │ │ │ └── extensions.xml │ │ │ ├── invoker.properties │ │ │ ├── pom.xml │ │ │ ├── prebuild.groovy │ │ │ └── verify.groovy │ │ ├── issue-50 │ │ │ ├── .gitignore │ │ │ ├── .mvn │ │ │ │ └── extensions.xml │ │ │ ├── pom.xml │ │ │ ├── prebuild.groovy │ │ │ └── verify.groovy │ │ ├── issue-51 │ │ │ ├── .gitignore │ │ │ ├── .mvn │ │ │ │ ├── extensions.xml │ │ │ │ └── jgitver.config.xml │ │ │ ├── invoker.properties │ │ │ ├── pom.xml │ │ │ ├── prebuild.groovy │ │ │ └── verify.groovy │ │ ├── issue-62.1 │ │ │ ├── .gitignore │ │ │ ├── .mvn │ │ │ │ └── extensions.xml │ │ │ ├── invoker.properties │ │ │ ├── pom.xml │ │ │ ├── prebuild.groovy │ │ │ └── verify.groovy │ │ ├── issue-62.2 │ │ │ ├── .gitignore │ │ │ ├── .mvn │ │ │ │ └── extensions.xml │ │ │ ├── invoker.properties │ │ │ ├── pom.xml │ │ │ ├── prebuild.groovy │ │ │ └── verify.groovy │ │ ├── issue-65 │ │ │ ├── .gitignore │ │ │ ├── .mvn │ │ │ │ ├── extensions.xml │ │ │ │ └── jgitver.config.xml │ │ │ ├── invoker.properties │ │ │ ├── pom.xml │ │ │ ├── prebuild.groovy │ │ │ └── verify.groovy │ │ ├── issue-69 │ │ │ ├── .gitignore │ │ │ ├── .mvn │ │ │ │ ├── extensions.xml │ │ │ │ └── jgitver.config.xml │ │ │ ├── invoker.properties │ │ │ ├── pom.xml │ │ │ ├── prebuild.groovy │ │ │ └── verify.groovy │ │ ├── issue-75 │ │ │ ├── .gitignore │ │ │ ├── .mvn │ │ │ │ ├── extensions.xml │ │ │ │ └── jgitver.config.xml │ │ │ ├── invoker.properties │ │ │ ├── other-conf │ │ │ │ └── jgitver.config.xml │ │ │ ├── pom.xml │ │ │ ├── prebuild.groovy │ │ │ └── verify.groovy │ │ ├── issue-79.1 │ │ │ ├── .gitignore │ │ │ ├── .mvn │ │ │ │ ├── extensions.xml │ │ │ │ └── jgitver.config.xml │ │ │ ├── invoker.properties │ │ │ ├── pom.xml │ │ │ ├── prebuild.groovy │ │ │ └── verify.groovy │ │ ├── issue-79.2 │ │ │ ├── .gitignore │ │ │ ├── .mvn │ │ │ │ ├── extensions.xml │ │ │ │ └── jgitver.config.xml │ │ │ ├── invoker.properties │ │ │ ├── pom.xml │ │ │ ├── prebuild.groovy │ │ │ └── verify.groovy │ │ ├── issue-93-pattern-override │ │ │ ├── .gitignore │ │ │ ├── .mvn │ │ │ │ ├── extensions.xml │ │ │ │ └── jgitver.config.xml │ │ │ ├── pom.xml │ │ │ ├── prebuild.groovy │ │ │ └── verify.groovy │ │ ├── issue-93-pattern-usage │ │ │ ├── .gitignore │ │ │ ├── .mvn │ │ │ │ ├── extensions.xml │ │ │ │ └── jgitver.config.xml │ │ │ ├── pom.xml │ │ │ ├── prebuild.groovy │ │ │ └── verify.groovy │ │ └── issue-98-merges │ │ │ ├── .gitignore │ │ │ ├── .mvn │ │ │ ├── extensions.xml │ │ │ └── jgitver.config.xml │ │ │ ├── pom.xml │ │ │ ├── prebuild.groovy │ │ │ └── verify.groovy │ ├── java-plugin-extension-it │ │ ├── .gitignore │ │ ├── .mvn │ │ │ └── extensions.xml │ │ ├── invoker.properties │ │ ├── pom.xml │ │ ├── prebuild.groovy │ │ ├── src │ │ │ └── main │ │ │ │ └── java │ │ │ │ └── fr │ │ │ │ └── brouillard │ │ │ │ └── oss │ │ │ │ └── demo │ │ │ │ └── App.java │ │ └── verify.groovy │ ├── multi-external-parent │ │ ├── .gitignore │ │ ├── .mvn │ │ │ └── extensions.xml │ │ ├── invoker.properties │ │ ├── module-1 │ │ │ └── pom.xml │ │ ├── module-ext-parent │ │ │ └── pom.xml │ │ ├── pom.xml │ │ ├── prebuild.groovy │ │ └── verify.groovy │ ├── multi-pure-extension-it │ │ ├── .gitignore │ │ ├── .mvn │ │ │ └── extensions.xml │ │ ├── module │ │ │ ├── pom.xml │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── java │ │ │ │ └── fr │ │ │ │ └── brouillard │ │ │ │ └── oss │ │ │ │ └── demo │ │ │ │ └── App.java │ │ ├── pom.xml │ │ ├── prebuild.groovy │ │ ├── verify.groovy │ │ └── war │ │ │ └── pom.xml │ ├── multi-pure-extension-resolve-version-variable-it │ │ ├── .gitignore │ │ ├── .mvn │ │ │ └── extensions.xml │ │ ├── module │ │ │ ├── pom.xml │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── java │ │ │ │ └── fr │ │ │ │ └── brouillard │ │ │ │ └── oss │ │ │ │ └── demo │ │ │ │ └── App.java │ │ ├── pom.xml │ │ ├── prebuild.groovy │ │ ├── verify.groovy │ │ └── war │ │ │ └── pom.xml │ ├── pom-non-qualifier-branches-list-on-develop-it │ │ ├── .gitignore │ │ ├── .mvn │ │ │ └── extensions.xml │ │ ├── pom.xml │ │ ├── prebuild.groovy │ │ └── verify.groovy │ ├── pom-non-qualifier-branches-list-on-feature-it │ │ ├── .gitignore │ │ ├── .mvn │ │ │ └── extensions.xml │ │ ├── pom.xml │ │ ├── prebuild.groovy │ │ └── verify.groovy │ ├── pom-non-qualifier-branches-single-on-develop-it │ │ ├── .gitignore │ │ ├── .mvn │ │ │ └── extensions.xml │ │ ├── pom.xml │ │ ├── prebuild.groovy │ │ └── verify.groovy │ ├── pom-non-qualifier-branches-single-on-feature-it │ │ ├── .gitignore │ │ ├── .mvn │ │ │ └── extensions.xml │ │ ├── pom.xml │ │ ├── prebuild.groovy │ │ └── verify.groovy │ ├── pom-plugin-extension-with-basic-configuration-it │ │ ├── .gitignore │ │ ├── .mvn │ │ │ ├── extensions.xml │ │ │ └── jgitver.config.xml │ │ ├── pom.xml │ │ ├── prebuild.groovy │ │ └── verify.groovy │ ├── pom-plugin-extension-with-basic-configuration-oldname-it │ │ ├── .gitignore │ │ ├── .mvn │ │ │ ├── extensions.xml │ │ │ └── jgtiver.config.xml │ │ ├── pom.xml │ │ ├── prebuild.groovy │ │ └── verify.groovy │ ├── pom-single-plugin-extension-it │ │ ├── .gitignore │ │ ├── .mvn │ │ │ └── extensions.xml │ │ ├── pom.xml │ │ ├── prebuild.groovy │ │ └── verify.groovy │ ├── pom-with-old-extension-system │ │ ├── .gitignore │ │ ├── invoker.properties │ │ ├── pom.xml │ │ ├── prebuild.groovy │ │ └── verify.groovy │ ├── pom-with-old-plugin-system │ │ ├── .gitignore │ │ ├── invoker.properties │ │ ├── pom.xml │ │ ├── prebuild.groovy │ │ └── verify.groovy │ ├── settings.xml │ ├── user-defined-tag-version-pattern │ │ ├── .gitignore │ │ ├── .mvn │ │ │ ├── extensions.xml │ │ │ └── jgitver.config.xml │ │ ├── pom.xml │ │ ├── prebuild.groovy │ │ └── verify.groovy │ ├── verify-export-properties │ │ ├── .gitignore │ │ ├── .mvn │ │ │ ├── extensions.xml │ │ │ └── jgitver.config.xml │ │ ├── invoker.properties │ │ ├── pom.xml │ │ ├── prebuild.groovy │ │ └── verify.groovy │ ├── verify_skip │ │ ├── .gitignore │ │ ├── .mvn │ │ │ ├── extensions.xml │ │ │ └── jgitver.config.xml │ │ ├── invoker.properties │ │ ├── pom.xml │ │ ├── prebuild.groovy │ │ └── verify.groovy │ └── xml-schemas │ │ └── invalid-schema-1.0.0 │ │ ├── .gitignore │ │ ├── .mvn │ │ ├── extensions.xml │ │ └── jgitver.config.xml │ │ ├── invoker.properties │ │ ├── pom.xml │ │ ├── prebuild.groovy │ │ └── verify.groovy ├── main │ ├── java │ │ └── fr │ │ │ └── brouillard │ │ │ └── oss │ │ │ └── jgitver │ │ │ ├── GAV.java │ │ │ ├── JGitverConfiguration.java │ │ │ ├── JGitverConfigurationComponent.java │ │ │ ├── JGitverExtension.java │ │ │ ├── JGitverGuiceModule.java │ │ │ ├── JGitverInformationProvider.java │ │ │ ├── JGitverMavenPluginProperties.java │ │ │ ├── JGitverModelProcessor.java │ │ │ ├── JGitverSession.java │ │ │ ├── JGitverSessionHolder.java │ │ │ ├── JGitverUtils.java │ │ │ ├── Providers.java │ │ │ ├── cfg │ │ │ ├── BranchPolicy.java │ │ │ ├── Configuration.java │ │ │ ├── ConfigurationLoader.java │ │ │ ├── InMemoryLogger.java │ │ │ └── SimpleBranchPolicyConverter.java │ │ │ └── mojos │ │ │ ├── JGitverAttachModifiedPomsMojo.java │ │ │ └── JGitverMojo.java │ ├── resources-filtered │ │ └── META-INF │ │ │ └── jgitver-maven-plugin-project.properties │ └── resources │ │ └── schemas │ │ ├── jgitver-configuration-v1_0_0-beta.xsd │ │ └── jgitver-configuration-v1_0_0.xsd ├── quality │ └── checkstyle │ │ ├── checks.xml │ │ └── suppressions.xml └── test │ ├── java │ └── fr │ │ └── brouillard │ │ └── oss │ │ └── jgitver │ │ ├── GitVersionCalculatorProxyTest.java │ │ ├── JGitverUtilsTest.java │ │ └── cfg │ │ ├── ConfigurationLoaderTest.java │ │ ├── Issue51Test.java │ │ └── ResourceConfigurationProvider.java │ └── resources │ └── config │ ├── complex-branch.cfg.xml │ ├── invalid-with-schema.xml │ ├── issue-51-cfg.xml │ ├── simple.cfg.with.schema.xml │ └── simple.cfg.xml └── travis-set-branch.sh /.gitattributes: -------------------------------------------------------------------------------- 1 | # see https://gist.github.com/ArminVieweg/c0fe55fe2fb25cd44772 2 | 3 | # Autodetect text files 4 | * text=auto eol=lf 5 | 6 | # Force the following filetypes to have unix eols, so Windows does not break them 7 | *.bat text eol=crlf 8 | *.cmd text eol=crlf 9 | *.sh text eol=lf 10 | mvnw text eol=lf 11 | 12 | # Force images/fonts to be handled as binaries 13 | *.jpg binary 14 | *.jpeg binary 15 | *.gif binary 16 | *.png binary 17 | *.t3x binary 18 | *.t3d binary 19 | *.exe binary 20 | *.data binary 21 | *.ttf binary 22 | *.eof binary 23 | *.eot binary 24 | *.swf binary 25 | *.mov binary 26 | *.mp4 binary 27 | *.mp3 binary 28 | *.ogg binary 29 | *.flv binary -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2016 Matthieu Brouillard [http://oss.brouillard.fr/jgitver-maven-plugin] (matthieu@brouillard.fr) 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | github: [McFoggy] -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ### Before submitting an issue I have first: 2 | 3 | - [ ] searched for similar already existing issue 4 | - [ ] read the documentation and [wiki](https://github.com/jgitver/jgitver-maven-plugin/wiki) 5 | 6 | *(if you have performed all the above, remove the paragraph and continue describing the issue with template below)* 7 | 8 | ## Issue 9 | 10 | We know that your time is precious, we are thankful that you take time to report us an issue, to make it easier for you please use the following prefilled paragraphs 11 | 12 | **version**: _replace with the version of the jgtiver-maven-plugin you have the issue with_ 13 | 14 | **usage context**: 15 | 16 | - [ ] maven command line: _replace with version_ 17 | - [ ] eclipse: _replace with version_ 18 | - [ ] netbeans: _replace with version_ 19 | - [ ] Intellij IDEA: _replace with version_ 20 | 21 | **Problem description**: 22 | 23 | - *be as explicit has you can* 24 | - *describe the problem and its symptoms* 25 | - *explain how to reproduce* 26 | - *attach whatever information that can help understanding the context (screen capture, log files)* 27 | - *do your best to use a correct english (re-read yourself)* 28 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | Thank you so much to take time to contribute to the project. 2 | 3 | Before submitting the pull-request please ensure that you have first: 4 | 5 | - [ ] read the [contribution guidelines](https://github.com/jgitver/jgitver-maven-plugin/blob/master/.github/CONTRIBUTING.md) 6 | - [ ] rebased your branch over master 7 | - [ ] verified that project is compiling and that tests pass: `mvn -Prun-its clean install` 8 | - [ ] marked as closed (in the commit comments) all issues ID that this PR should correct -------------------------------------------------------------------------------- /.github/workflows/maven.yml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2016 Matthieu Brouillard [http://oss.brouillard.fr/jgitver-maven-plugin] (matthieu@brouillard.fr) 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | name: Java CI with Maven 18 | 19 | on: [push, pull_request] 20 | 21 | jobs: 22 | build: 23 | 24 | runs-on: ubuntu-latest 25 | 26 | steps: 27 | - name: Set git to use LF 28 | run: | 29 | git config --global core.autocrlf false 30 | git config --global core.eol lf 31 | - name: Checkout 32 | uses: actions/checkout@v2 33 | with: 34 | fetch-depth: 0 35 | - name: Set up JDK 11 36 | uses: actions/setup-java@v1 37 | with: 38 | java-version: 11 39 | - name: Cache Maven packages 40 | uses: actions/cache@v1 41 | with: 42 | path: ~/.m2 43 | key: ${{ runner.os }}-m2-${{ hashFiles('pom.xml') }} 44 | restore-keys: ${{ runner.os }}-m2 45 | - name: Build with Maven 46 | run: mvn -B --show-version -Psonatype -Prun-its clean install -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .settings/ 2 | target/ 3 | .classpath 4 | .project 5 | .checkstyle 6 | .idea/ 7 | .okhttpcache/ 8 | *.iml 9 | **/.flattened-pom.xml 10 | .factorypath 11 | -------------------------------------------------------------------------------- /.lgtm.yml: -------------------------------------------------------------------------------- 1 | extraction: 2 | java: 3 | index: 4 | java_version: "11" -------------------------------------------------------------------------------- /.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 18 | 20 | 21 | fr.brouillard.oss 22 | jgitver-maven-plugin 23 | 1.8.0 24 | 25 | -------------------------------------------------------------------------------- /.mvn/jgitver.config.xml: -------------------------------------------------------------------------------- 1 | 18 | 21 | true 22 | 23 | .repository 24 | target/local-repo 25 | target/it/issues/issue-30-pre 26 | target/it/pom-with-old-extension-system 27 | target/it/pom-with-old-plugin-system 28 | 29 | -------------------------------------------------------------------------------- /.mvn/jvm.config: -------------------------------------------------------------------------------- 1 | -Duser.language=en -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jgitver/jgitver-maven-plugin/c14645a1900b47ac92c516319a987e6173e93006/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: java 2 | 3 | jdk: openjdk8 4 | 5 | install: 6 | - "./mvnw --show-version -Psonatype install -DskipTests=true -Dmaven.javadoc.skip=true -B -V" 7 | before_script: 8 | # reset correct branch information 9 | - "./travis-set-branch.sh" 10 | script: 11 | - "./mvnw --show-version -Psonatype -Prun-its clean install" 12 | 13 | cache: 14 | directories: 15 | - $HOME/.m2 16 | 17 | branches: 18 | except: 19 | - gh-pages 20 | 21 | notifications: 22 | email: 23 | - matthieu@brouillard.fr 24 | -------------------------------------------------------------------------------- /AUTHORS.md: -------------------------------------------------------------------------------- 1 | [jgitver-maven-plugin](https://github.com/jgitver/jgitver-maven-plugin) is written and maintained by [Matthieu Brouillard](http://oss.brouillard.fr) [![Email](src/doc/images/black_email_16.png?raw=true "Email")](mailto://matthieu@brouillard.fr) [![Twitt](https://img.shields.io/twitter/url/http/alightinthefog.svg?style=social)](https://twitter.com/alightinthefog)[![Github follow](https://img.shields.io/github/followers/McFoggy.svg?style=social&label=Follow)](https://github.com/McFoggy) 2 | 3 | ## Contributors 4 | All the following people have contributed to the project. 5 | 6 | > Special thanks to Yuriy for his contribution that moved the project from a single plugin to a maven core plugin. 7 | 8 | - [Matthieu Brouillard](http://oss.brouillard.fr) [![Email](src/doc/images/black_email_16.png?raw=true "Email")](mailto://matthieu@brouillard.fr) [![Twitt](https://img.shields.io/twitter/url/http/alightinthefog.svg?style=social)](https://twitter.com/alightinthefog)[![Github follow](https://img.shields.io/github/followers/McFoggy.svg?style=social&label=Follow)](https://github.com/McFoggy) 9 | - [Yuriy Zaplavnov](https://github.com/xeagle2) [![Github follow](https://img.shields.io/github/followers/xeagle2.svg?style=social&label=Follow)](https://github.com/xeagle2) 10 | - [Johannes Schneider](https://github.com/jschneider) [![Github follow](https://img.shields.io/github/followers/jschneider.svg?style=social&label=Follow)](https://github.com/jschneider) 11 | - [Jeremy Heiner](https://github.com/jeremy-im) [![Github follow](https://img.shields.io/github/followers/jeremy-im.svg?style=social&label=Follow)](https://github.com/jeremy-im) 12 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2016 Matthieu Brouillard [http://oss.brouillard.fr/jgitver-maven-plugin] (matthieu@brouillard.fr) 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /changelog.mustache: -------------------------------------------------------------------------------- 1 | # Git Changelog Maven plugin changelog 2 | 3 | Changelog of Git Changelog Maven plugin. 4 | 5 | {{#tags}} 6 | ## {{name}} 7 | {{#issues}} 8 | {{#hasIssue}} 9 | {{#hasLink}} 10 | ### {{name}} [{{issue}}]({{link}}) {{title}} 11 | {{/hasLink}} 12 | {{^hasLink}} 13 | ### {{name}} {{issue}} {{title}} 14 | {{/hasLink}} 15 | {{/hasIssue}} 16 | {{^hasIssue}} 17 | ### {{name}} 18 | {{/hasIssue}} 19 | 20 | {{#commits}} 21 | **{{{messageTitle}}}** 22 | 23 | {{#messageBodyItems}} 24 | * {{.}} 25 | {{/messageBodyItems}} 26 | 27 | [{{hash}}](https://github.com/jgitver/jgitver-maven-plugin/commit/{{hash}}) {{authorName}} *{{commitTime}}* 28 | 29 | {{/commits}} 30 | 31 | {{/issues}} 32 | {{/tags}} -------------------------------------------------------------------------------- /src/ci/build-with-external-it-fallback.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (C) 2016 Matthieu Brouillard [http://oss.brouillard.fr/jgitver-maven-plugin] (matthieu@brouillard.fr) 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | # # # # # # # # # # # # # # # # # # # # 19 | # this build: 20 | # - first run the IT tests in place in a sub directory of current project 21 | # meaning that a .mvn/extensions.xml file will always be found, testing the default ignore settings of current project 22 | # when there are refactoring in the way exclusions are handled and as a build run on CI 23 | # - if the first run has failed, relaunch a build by externalizing the integration test directory in a safe place 24 | # without any interference of the jgitver-maven-plugin version referenced by the current .mvn/extensions.xml file 25 | # # # # # # # # # # # # # # # # # # # # 26 | mvn -Prun-its clean install || mvn -Prun-its clean install -Dit.directory=/tmp/jgitver-it -------------------------------------------------------------------------------- /src/doc/changelog.mustache: -------------------------------------------------------------------------------- 1 | # jgitver-maven-plugin changelog 2 | 3 | Changelog of [jgitver-maven-plugin](https://github.com/jgitver/jgitver-maven-plugin) project. 4 | 5 | {{#tags}} 6 | ## {{name}} 7 | {{#issues}} 8 | {{#hasIssue}} 9 | {{#hasLink}} 10 | ### {{name}} [{{issue}}]({{link}}) {{title}} 11 | {{/hasLink}} 12 | {{^hasLink}} 13 | ### {{name}} {{issue}} {{title}} 14 | {{/hasLink}} 15 | {{/hasIssue}} 16 | {{^hasIssue}} 17 | ### {{name}} 18 | {{/hasIssue}} 19 | 20 | {{#commits}} 21 | **{{{messageTitle}}}** 22 | 23 | {{#messageBodyItems}} 24 | * {{.}} 25 | {{/messageBodyItems}} 26 | 27 | [{{hash}}](https://github.com/jgitver/jgitver-maven-plugin/commit/{{hash}}) {{authorName}} *{{commitTime}}* 28 | 29 | {{/commits}} 30 | 31 | {{/issues}} 32 | {{/tags}} -------------------------------------------------------------------------------- /src/doc/images/black_email_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jgitver/jgitver-maven-plugin/c14645a1900b47ac92c516319a987e6173e93006/src/doc/images/black_email_16.png -------------------------------------------------------------------------------- /src/doc/images/jgitver-maven-like.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jgitver/jgitver-maven-plugin/c14645a1900b47ac92c516319a987e6173e93006/src/doc/images/jgitver-maven-like.gif -------------------------------------------------------------------------------- /src/doc/images/jgitver-maven-plugin-homepage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jgitver/jgitver-maven-plugin/c14645a1900b47ac92c516319a987e6173e93006/src/doc/images/jgitver-maven-plugin-homepage.png -------------------------------------------------------------------------------- /src/doc/images/s7_linear_with_SNAPSHOT_tags_and_branch.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jgitver/jgitver-maven-plugin/c14645a1900b47ac92c516319a987e6173e93006/src/doc/images/s7_linear_with_SNAPSHOT_tags_and_branch.gif -------------------------------------------------------------------------------- /src/it/branch-policy-uppercase-en/.gitignore: -------------------------------------------------------------------------------- 1 | prebuild.log 2 | build.log -------------------------------------------------------------------------------- /src/it/branch-policy-uppercase-en/.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 18 | 20 | 21 | @project.groupId@ 22 | @project.artifactId@ 23 | @project.version@ 24 | 25 | -------------------------------------------------------------------------------- /src/it/branch-policy-uppercase-en/.mvn/jgitver.config.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | 20 | 21 | (.*) 22 | 23 | UPPERCASE_EN 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/it/branch-policy-uppercase-en/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 4.0.0 21 | 22 | fr.brouillard.oss.it 23 | branch-policy-uppercase-en 24 | 0 25 | pom 26 | 27 | Demo usage of simple branch policy. 28 | 29 | 30 | UTF-8 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/it/failIfDirty/failing/.gitignore: -------------------------------------------------------------------------------- 1 | prebuild.log 2 | build.log -------------------------------------------------------------------------------- /src/it/failIfDirty/failing/.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 18 | 20 | 21 | @project.groupId@ 22 | @project.artifactId@ 23 | @project.version@ 24 | 25 | -------------------------------------------------------------------------------- /src/it/failIfDirty/failing/.mvn/jgitver.config.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | true 20 | -------------------------------------------------------------------------------- /src/it/failIfDirty/failing/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.buildResult = failure 2 | -------------------------------------------------------------------------------- /src/it/failIfDirty/failing/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 4.0.0 21 | 22 | fr.brouillard.oss.it 23 | fail-if-dirty 24 | 0 25 | pom 26 | 27 | Verify build fails when dirty state is detected 28 | 29 | 30 | UTF-8 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/it/failIfDirty/failing/verify.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2016 Matthieu Brouillard [http://oss.brouillard.fr/jgitver-maven-plugin] (matthieu@brouillard.fr) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | def log = new PrintWriter( new File(basedir, "verify.log").newWriter("UTF-8"), true ) 17 | log.println( "Verify started at: " + new Date() + " in: " + basedir ) 18 | 19 | [ 20 | "chmod -R 755 .git", 21 | "rm -rf .git" 22 | ].each{ command -> 23 | 24 | def proc = command.execute(null, basedir) 25 | def sout = new StringBuilder(), serr = new StringBuilder() 26 | proc.waitForProcessOutput(sout, serr) 27 | 28 | log.println( "cmd: " + command ) 29 | log.println( "out:" ) ; log.println( sout.toString().trim() ) 30 | log.println( "err:" ) ; log.println( serr.toString().trim() ) 31 | log.println( "ret: " + proc.exitValue() ) 32 | 33 | assert proc.exitValue() == 0 34 | 35 | } 36 | 37 | def buildLog = new File(basedir, "build.log").readLines() 38 | 39 | // Check the dirty state lead to an Exception 40 | def exceptionDetected = buildLog.findAll { it =~ /java.lang.IllegalStateException: repository is dirty/ } 41 | assert 0 < exceptionDetected.size() 42 | 43 | log.println( "Verify completed at: " + new Date() ) 44 | log.close() 45 | return true 46 | -------------------------------------------------------------------------------- /src/it/failIfDirty/working/.gitignore: -------------------------------------------------------------------------------- 1 | prebuild.log 2 | build.log -------------------------------------------------------------------------------- /src/it/failIfDirty/working/.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 18 | 20 | 21 | @project.groupId@ 22 | @project.artifactId@ 23 | @project.version@ 24 | 25 | -------------------------------------------------------------------------------- /src/it/failIfDirty/working/.mvn/jgitver.config.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | false 20 | -------------------------------------------------------------------------------- /src/it/failIfDirty/working/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 4.0.0 21 | 22 | fr.brouillard.oss.it 23 | dirty-no-fail-no-report 24 | 0 25 | pom 26 | 27 | A simple IT verifying the basic use case. 28 | 29 | 30 | UTF-8 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/it/failIfDirty/working/verify.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2016 Matthieu Brouillard [http://oss.brouillard.fr/jgitver-maven-plugin] (matthieu@brouillard.fr) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | def baseDir = new File("$basedir") 17 | 18 | File actions = new File(baseDir, "verify-actions.log") 19 | actions.write 'Actions started at: ' + new Date() + '\n' 20 | 21 | actions << 'rm -rf .git'.execute(null, baseDir).text 22 | 23 | // Check the version was used by the plugin execution 24 | def foundLines = new File("$basedir", "build.log").readLines().findAll { it =~ /fr.brouillard.oss.it::dirty-no-fail-no-report::0 -> 1.0.1-SNAPSHOT/ } 25 | assert 0 < foundLines.size 26 | 27 | // And check that the produced artifact was installed with the good version 28 | File installedPomFile = new File("$basedir" + "/../../../local-repo/fr/brouillard/oss/it/dirty-no-fail-no-report/1.0.1-SNAPSHOT/", "dirty-no-fail-no-report-1.0.1-SNAPSHOT.pom") 29 | assert installedPomFile.isFile() 30 | assert 1 == installedPomFile.readLines().findAll { it =~ /1.0.1-SNAPSHOT<\/version>/ }.size() 31 | 32 | return true 33 | -------------------------------------------------------------------------------- /src/it/issues/issue-111-LATEST/.gitignore: -------------------------------------------------------------------------------- 1 | prebuild.log 2 | build.log -------------------------------------------------------------------------------- /src/it/issues/issue-111-LATEST/.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 18 | 20 | 21 | @project.groupId@ 22 | @project.artifactId@ 23 | @project.version@ 24 | 25 | -------------------------------------------------------------------------------- /src/it/issues/issue-111-LATEST/.mvn/jgitver.config.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | CONFIGURABLE 20 | LATEST 21 | true 22 | true 23 | -------------------------------------------------------------------------------- /src/it/issues/issue-111-LATEST/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 4.0.0 21 | 22 | fr.brouillard.oss.it 23 | issue-98-merges 24 | 0 25 | pom 26 | 27 | Verify merges works correctly by finding max version between merged branches 28 | 29 | 30 | UTF-8 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/it/issues/issue-111-MAX/.gitignore: -------------------------------------------------------------------------------- 1 | prebuild.log 2 | build.log -------------------------------------------------------------------------------- /src/it/issues/issue-111-MAX/.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 18 | 20 | 21 | @project.groupId@ 22 | @project.artifactId@ 23 | @project.version@ 24 | 25 | -------------------------------------------------------------------------------- /src/it/issues/issue-111-MAX/.mvn/jgitver.config.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | CONFIGURABLE 20 | MAX 21 | true 22 | true 23 | -------------------------------------------------------------------------------- /src/it/issues/issue-111-MAX/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 4.0.0 21 | 22 | fr.brouillard.oss.it 23 | issue-98-merges 24 | 0 25 | pom 26 | 27 | Verify merges works correctly by finding max version between merged branches 28 | 29 | 30 | UTF-8 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/it/issues/issue-111-NEAREST/.gitignore: -------------------------------------------------------------------------------- 1 | prebuild.log 2 | build.log -------------------------------------------------------------------------------- /src/it/issues/issue-111-NEAREST/.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 18 | 20 | 21 | @project.groupId@ 22 | @project.artifactId@ 23 | @project.version@ 24 | 25 | -------------------------------------------------------------------------------- /src/it/issues/issue-111-NEAREST/.mvn/jgitver.config.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | CONFIGURABLE 20 | NEAREST 21 | true 22 | true 23 | -------------------------------------------------------------------------------- /src/it/issues/issue-111-NEAREST/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 4.0.0 21 | 22 | fr.brouillard.oss.it 23 | issue-98-merges 24 | 0 25 | pom 26 | 27 | Verify merges works correctly by finding max version between merged branches 28 | 29 | 30 | UTF-8 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/it/issues/issue-26/.gitignore: -------------------------------------------------------------------------------- 1 | prebuild.log 2 | build.log -------------------------------------------------------------------------------- /src/it/issues/issue-26/.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 18 | 20 | 21 | @project.groupId@ 22 | @project.artifactId@ 23 | @project.version@ 24 | 25 | -------------------------------------------------------------------------------- /src/it/issues/issue-26/invoker.properties: -------------------------------------------------------------------------------- 1 | # invoker.mavenOpts = -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -------------------------------------------------------------------------------- /src/it/issues/issue-26/module/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 4.0.0 21 | 22 | child 23 | pom 24 | 25 | 26 | fr.brouillard.oss.it.multi.with.parents 27 | main 28 | 0 29 | 30 | 31 | child::A simple IT verifying the basic use case. 32 | 33 | -------------------------------------------------------------------------------- /src/it/issues/issue-26/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 4.0.0 21 | 22 | 23 | org.sonatype.oss 24 | oss-parent 25 | 7 26 | 27 | 28 | fr.brouillard.oss.it.multi.with.parents 29 | main 30 | 0 31 | pom 32 | 33 | A simple IT verifying the basic use case. 34 | 35 | 36 | UTF-8 37 | 38 | 39 | 40 | module 41 | 42 | 43 | -------------------------------------------------------------------------------- /src/it/issues/issue-30-pre/src/main/java/outside/IntSetBuilder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Matthieu Brouillard [http://oss.brouillard.fr/jgitver-maven-plugin] (matthieu@brouillard.fr) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package outside; 17 | 18 | public class IntSetBuilder 19 | extends java.util.HashSet 20 | implements java.util.function.IntConsumer 21 | { 22 | public long accepted = 0; 23 | 24 | public void accept( int i ) 25 | { 26 | ++ accepted; 27 | add( i ); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/it/issues/issue-30/.gitignore: -------------------------------------------------------------------------------- 1 | prebuild.log 2 | build.log -------------------------------------------------------------------------------- /src/it/issues/issue-30/.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 18 | 20 | 21 | @project.groupId@ 22 | @project.artifactId@ 23 | @project.version@ 24 | 25 | -------------------------------------------------------------------------------- /src/it/issues/issue-30/invoker.properties: -------------------------------------------------------------------------------- 1 | # invoker.mavenOpts = -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 2 | invoker.goals = -X install project-info-reports:dependencies -------------------------------------------------------------------------------- /src/it/issues/issue-30/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 4.0.0 21 | 22 | fr.brouillard.oss.it 23 | issue-30 24 | 0 25 | 26 | NullPointerException in JGitverModelProcessor.provisionModel when POM unavailable. 27 | 28 | 29 | 1.8 30 | 1.8 31 | UTF-8 32 | 33 | 34 | 35 | 36 | fr.brouillard.oss.it 37 | int-set-builder 38 | 0.4 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /src/it/issues/issue-30/src/main/java/inside/Main.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Matthieu Brouillard [http://oss.brouillard.fr/jgitver-maven-plugin] (matthieu@brouillard.fr) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package inside; 17 | 18 | import outside.IntSetBuilder; 19 | 20 | public class Main 21 | { 22 | public static double codePointsOverLength( String value ) 23 | { 24 | IntSetBuilder isb = new IntSetBuilder(); 25 | value.codePoints().forEach( isb ); 26 | return isb.size() / (double) isb.accepted; 27 | } 28 | 29 | public static void main( String[] args ) 30 | { 31 | String value = args.length > 0 32 | ? String.join( " ", java.util.Arrays.asList(args) ) 33 | : "The quick brown fox jumps over the lazy dog."; 34 | System.out.println( codePointsOverLength(value) + " " + value ); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/it/issues/issue-35.1/.gitignore: -------------------------------------------------------------------------------- 1 | prebuild.log 2 | build.log -------------------------------------------------------------------------------- /src/it/issues/issue-35.1/.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 18 | 20 | 21 | @project.groupId@ 22 | @project.artifactId@ 23 | @project.version@ 24 | 25 | -------------------------------------------------------------------------------- /src/it/issues/issue-35.1/invoker.properties: -------------------------------------------------------------------------------- 1 | # invoker.mavenOpts = -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -------------------------------------------------------------------------------- /src/it/issues/issue-35.1/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 4.0.0 21 | 22 | fr.brouillard.oss.it 23 | issue-35.1 24 | 0 25 | pom 26 | 27 | Verify SCM tag is udpated with SHA1 28 | 29 | 30 | UTF-8 31 | 32 | 33 | 34 | scm:git:https://github.com/jgitver/dummy.git 35 | scm:git:https://github.com/jgitver/dummy.git 36 | HEAD 37 | 38 | 39 | -------------------------------------------------------------------------------- /src/it/issues/issue-35.2/.gitignore: -------------------------------------------------------------------------------- 1 | prebuild.log 2 | build.log -------------------------------------------------------------------------------- /src/it/issues/issue-35.2/.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 18 | 20 | 21 | @project.groupId@ 22 | @project.artifactId@ 23 | @project.version@ 24 | 25 | -------------------------------------------------------------------------------- /src/it/issues/issue-35.2/invoker.properties: -------------------------------------------------------------------------------- 1 | # invoker.mavenOpts = -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -------------------------------------------------------------------------------- /src/it/issues/issue-35.2/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 4.0.0 21 | 22 | fr.brouillard.oss.it 23 | issue-35.2 24 | 0 25 | pom 26 | 27 | Verify SCM tag is udpated with release version 28 | 29 | 30 | UTF-8 31 | 32 | 33 | 34 | scm:git:https://github.com/jgitver/dummy.git 35 | scm:git:https://github.com/jgitver/dummy.git 36 | HEAD 37 | 38 | 39 | -------------------------------------------------------------------------------- /src/it/issues/issue-36.1/.gitignore: -------------------------------------------------------------------------------- 1 | prebuild.log 2 | build.log -------------------------------------------------------------------------------- /src/it/issues/issue-36.1/.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 18 | 20 | 21 | @project.groupId@ 22 | @project.artifactId@ 23 | @project.version@ 24 | 25 | -------------------------------------------------------------------------------- /src/it/issues/issue-36.1/.mvn/jgitver.config.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | true 20 | -------------------------------------------------------------------------------- /src/it/issues/issue-36.1/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 4.0.0 21 | 22 | fr.brouillard.oss.it 23 | issue-36 24 | 0 25 | pom 26 | 27 | Verify dirty state is part of project name 28 | 29 | 30 | UTF-8 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/it/issues/issue-36.2/.gitignore: -------------------------------------------------------------------------------- 1 | prebuild.log 2 | build.log -------------------------------------------------------------------------------- /src/it/issues/issue-36.2/.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 18 | 20 | 21 | @project.groupId@ 22 | @project.artifactId@ 23 | @project.version@ 24 | 25 | -------------------------------------------------------------------------------- /src/it/issues/issue-36.2/.mvn/jgitver.config.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | true 20 | -------------------------------------------------------------------------------- /src/it/issues/issue-36.2/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 4.0.0 21 | 22 | fr.brouillard.oss.it 23 | issue-36 24 | 0 25 | pom 26 | 27 | Verify dirty state is part of project name 28 | 29 | 30 | UTF-8 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/it/issues/issue-50-validate/.gitignore: -------------------------------------------------------------------------------- 1 | prebuild.log 2 | build.log -------------------------------------------------------------------------------- /src/it/issues/issue-50-validate/.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 18 | 20 | 21 | @project.groupId@ 22 | @project.artifactId@ 23 | @project.version@ 24 | 25 | -------------------------------------------------------------------------------- /src/it/issues/issue-50-validate/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.mavenOpts = -Djgitver.pom-replacement-phase=validate -------------------------------------------------------------------------------- /src/it/issues/issue-50-validate/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 4.0.0 21 | 22 | fr.brouillard.oss.it 23 | issue-50-validate 24 | 0 25 | jar 26 | 27 | Verify pom in jar has the good version 28 | 29 | 30 | UTF-8 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/it/issues/issue-50-validate/prebuild.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2016 Matthieu Brouillard [http://oss.brouillard.fr/jgitver-maven-plugin] (matthieu@brouillard.fr) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | def log = new PrintWriter( new File(basedir, "prebuild.log").newWriter("UTF-8"), true ) 17 | log.println( "Prebuild started at: " + new Date() + " in: " + basedir ) 18 | 19 | [ 20 | "git --version", 21 | "rm -rf .git", 22 | "git init", 23 | "git config user.name nobody", 24 | "git config user.email nobody@nowhere.com", 25 | "dd if=/dev/urandom of=content bs=512 count=2", 26 | "git add .", 27 | "git commit --message=initial_commit", 28 | "git tag -a 1.0.0 --message=release_1.0.0", 29 | "git status", 30 | "git log --graph --oneline" 31 | ].each{ command -> 32 | 33 | def proc = command.execute(null, basedir) 34 | def sout = new StringBuilder(), serr = new StringBuilder() 35 | proc.waitForProcessOutput(sout, serr) 36 | 37 | log.println( "cmd: " + command ) 38 | log.println( "out:" ) ; log.println( sout.toString().trim() ) 39 | log.println( "err:" ) ; log.println( serr.toString().trim() ) 40 | log.println( "ret: " + proc.exitValue() ) 41 | 42 | assert proc.exitValue() == 0 43 | 44 | } 45 | 46 | log.println( "Prebuild completed at: " + new Date() ) 47 | log.close() 48 | return true 49 | -------------------------------------------------------------------------------- /src/it/issues/issue-50/.gitignore: -------------------------------------------------------------------------------- 1 | prebuild.log 2 | build.log -------------------------------------------------------------------------------- /src/it/issues/issue-50/.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 18 | 20 | 21 | @project.groupId@ 22 | @project.artifactId@ 23 | @project.version@ 24 | 25 | -------------------------------------------------------------------------------- /src/it/issues/issue-50/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 4.0.0 21 | 22 | fr.brouillard.oss.it 23 | issue-50 24 | 0 25 | jar 26 | 27 | Verify pom in jar has the good version 28 | 29 | 30 | UTF-8 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/it/issues/issue-50/prebuild.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2016 Matthieu Brouillard [http://oss.brouillard.fr/jgitver-maven-plugin] (matthieu@brouillard.fr) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | def log = new PrintWriter( new File(basedir, "prebuild.log").newWriter("UTF-8"), true ) 17 | log.println( "Prebuild started at: " + new Date() + " in: " + basedir ) 18 | 19 | [ 20 | "git --version", 21 | "rm -rf .git", 22 | "git init", 23 | "git config user.name nobody", 24 | "git config user.email nobody@nowhere.com", 25 | "dd if=/dev/urandom of=content bs=512 count=2", 26 | "git add .", 27 | "git commit --message=initial_commit", 28 | "git tag -a 1.0.0 --message=release_1.0.0", 29 | "git status", 30 | "git log --graph --oneline" 31 | ].each{ command -> 32 | 33 | def proc = command.execute(null, basedir) 34 | def sout = new StringBuilder(), serr = new StringBuilder() 35 | proc.waitForProcessOutput(sout, serr) 36 | 37 | log.println( "cmd: " + command ) 38 | log.println( "out:" ) ; log.println( sout.toString().trim() ) 39 | log.println( "err:" ) ; log.println( serr.toString().trim() ) 40 | log.println( "ret: " + proc.exitValue() ) 41 | 42 | assert proc.exitValue() == 0 43 | 44 | } 45 | 46 | log.println( "Prebuild completed at: " + new Date() ) 47 | log.close() 48 | return true 49 | -------------------------------------------------------------------------------- /src/it/issues/issue-51/.gitignore: -------------------------------------------------------------------------------- 1 | prebuild.log 2 | build.log -------------------------------------------------------------------------------- /src/it/issues/issue-51/.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 18 | 20 | 21 | @project.groupId@ 22 | @project.artifactId@ 23 | @project.version@ 24 | 25 | -------------------------------------------------------------------------------- /src/it/issues/issue-51/invoker.properties: -------------------------------------------------------------------------------- 1 | # invoker.mavenOpts = -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -------------------------------------------------------------------------------- /src/it/issues/issue-51/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 4.0.0 21 | 22 | fr.brouillard.oss.it 23 | issue-51 24 | 0 25 | pom 26 | 27 | Verify branch name is kept with identity 28 | 29 | 30 | UTF-8 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/it/issues/issue-62.1/.gitignore: -------------------------------------------------------------------------------- 1 | prebuild.log 2 | build.log -------------------------------------------------------------------------------- /src/it/issues/issue-62.1/.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 18 | 20 | 21 | @project.groupId@ 22 | @project.artifactId@ 23 | @project.version@ 24 | 25 | -------------------------------------------------------------------------------- /src/it/issues/issue-62.1/invoker.properties: -------------------------------------------------------------------------------- 1 | # invoker.mavenOpts = -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -------------------------------------------------------------------------------- /src/it/issues/issue-62.2/.gitignore: -------------------------------------------------------------------------------- 1 | prebuild.log 2 | build.log -------------------------------------------------------------------------------- /src/it/issues/issue-62.2/.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 18 | 20 | 21 | @project.groupId@ 22 | @project.artifactId@ 23 | @project.version@ 24 | 25 | -------------------------------------------------------------------------------- /src/it/issues/issue-62.2/invoker.properties: -------------------------------------------------------------------------------- 1 | # invoker.mavenOpts = -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -------------------------------------------------------------------------------- /src/it/issues/issue-62.2/prebuild.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2016 Matthieu Brouillard [http://oss.brouillard.fr/jgitver-maven-plugin] (matthieu@brouillard.fr) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | def log = new PrintWriter( new File(basedir, "prebuild.log").newWriter("UTF-8"), true ) 17 | log.println( "Prebuild started at: " + new Date() + " in: " + basedir ) 18 | 19 | [ 20 | "git --version", 21 | "rm -rf .git", 22 | "git init", 23 | "git config user.name nobody", 24 | "git config user.email nobody@nowhere.com", 25 | "dd if=/dev/urandom of=content bs=512 count=2", 26 | "git add .", 27 | "git commit --message=initial_commit", 28 | "git status", 29 | "git log --graph --oneline" 30 | ].each{ command -> 31 | 32 | def proc = command.execute(null, basedir) 33 | def sout = new StringBuilder(), serr = new StringBuilder() 34 | proc.waitForProcessOutput(sout, serr) 35 | 36 | log.println( "cmd: " + command ) 37 | log.println( "out:" ) ; log.println( sout.toString().trim() ) 38 | log.println( "err:" ) ; log.println( serr.toString().trim() ) 39 | log.println( "ret: " + proc.exitValue() ) 40 | 41 | assert proc.exitValue() == 0 42 | 43 | } 44 | 45 | log.println( "Prebuild completed at: " + new Date() ) 46 | log.close() 47 | return true 48 | -------------------------------------------------------------------------------- /src/it/issues/issue-65/.gitignore: -------------------------------------------------------------------------------- 1 | prebuild.log 2 | build.log -------------------------------------------------------------------------------- /src/it/issues/issue-65/.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 18 | 20 | 21 | @project.groupId@ 22 | @project.artifactId@ 23 | @project.version@ 24 | 25 | -------------------------------------------------------------------------------- /src/it/issues/issue-65/.mvn/jgitver.config.xml: -------------------------------------------------------------------------------- 1 | 18 | 21 | false 22 | false 23 | false 24 | false 25 | true 26 | -------------------------------------------------------------------------------- /src/it/issues/issue-65/invoker.properties: -------------------------------------------------------------------------------- 1 | # invoker.mavenOpts = -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 2 | invoker.goals = install -------------------------------------------------------------------------------- /src/it/issues/issue-65/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 4.0.0 21 | 22 | fr.brouillard.oss.it 23 | issue-65 24 | 0 25 | pom 26 | 27 | Verify timestamp in qualifier 28 | 29 | 30 | UTF-8 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/it/issues/issue-65/prebuild.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2016 Matthieu Brouillard [http://oss.brouillard.fr/jgitver-maven-plugin] (matthieu@brouillard.fr) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | def log = new PrintWriter( new File(basedir, "prebuild.log").newWriter("UTF-8"), true ) 17 | log.println( "Prebuild started at: " + new Date() + " in: " + basedir ) 18 | 19 | [ 20 | "git --version", 21 | "rm -rf .git", 22 | "git init", 23 | "git config user.name nobody", 24 | "git config user.email nobody@nowhere.com", 25 | "dd if=/dev/urandom of=content bs=512 count=2", 26 | "git add .", 27 | "git commit --message=initial_commit", 28 | "git status", 29 | "git log --graph --oneline" 30 | ].each{ command -> 31 | 32 | def proc = command.execute(null, basedir) 33 | def sout = new StringBuilder(), serr = new StringBuilder() 34 | proc.waitForProcessOutput(sout, serr) 35 | 36 | log.println( "cmd: " + command ) 37 | log.println( "out:" ) ; log.println( sout.toString().trim() ) 38 | log.println( "err:" ) ; log.println( serr.toString().trim() ) 39 | log.println( "ret: " + proc.exitValue() ) 40 | 41 | assert proc.exitValue() == 0 42 | } 43 | 44 | log.println( "Prebuild completed at: " + new Date() ) 45 | log.close() 46 | return true 47 | -------------------------------------------------------------------------------- /src/it/issues/issue-69/.gitignore: -------------------------------------------------------------------------------- 1 | prebuild.log 2 | build.log -------------------------------------------------------------------------------- /src/it/issues/issue-69/.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 18 | 20 | 21 | @project.groupId@ 22 | @project.artifactId@ 23 | @project.version@ 24 | 25 | -------------------------------------------------------------------------------- /src/it/issues/issue-69/.mvn/jgitver.config.xml: -------------------------------------------------------------------------------- 1 | 18 | 21 | false 22 | true 23 | -------------------------------------------------------------------------------- /src/it/issues/issue-69/invoker.properties: -------------------------------------------------------------------------------- 1 | # invoker.mavenOpts = -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 2 | invoker.goals = install -------------------------------------------------------------------------------- /src/it/issues/issue-69/verify.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2016 Matthieu Brouillard [http://oss.brouillard.fr/jgitver-maven-plugin] (matthieu@brouillard.fr) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | def log = new PrintWriter( new File(basedir, "verify.log").newWriter("UTF-8"), true ) 17 | log.println( "Verify started at: " + new Date() + " in: " + basedir ) 18 | 19 | [ 20 | "chmod -R 755 .git", 21 | "rm -rf .git" 22 | ].each{ command -> 23 | 24 | def proc = command.execute(null, basedir) 25 | def sout = new StringBuilder(), serr = new StringBuilder() 26 | proc.waitForProcessOutput(sout, serr) 27 | 28 | log.println( "cmd: " + command ) 29 | log.println( "out:" ) ; log.println( sout.toString().trim() ) 30 | log.println( "err:" ) ; log.println( serr.toString().trim() ) 31 | log.println( "ret: " + proc.exitValue() ) 32 | 33 | assert proc.exitValue() == 0 34 | 35 | } 36 | 37 | def buildLog = new File(basedir, "build.log").readLines() 38 | 39 | def commitDistanceLog = buildLog.findAll { it =~ /commit distance: 2/ } 40 | log.println( "commit distance ok: " + commitDistanceLog ) 41 | assert 0 < commitDistanceLog.size() 42 | 43 | log.println( "Verify completed at: " + new Date() ) 44 | log.close() 45 | return true -------------------------------------------------------------------------------- /src/it/issues/issue-75/.gitignore: -------------------------------------------------------------------------------- 1 | prebuild.log 2 | build.log -------------------------------------------------------------------------------- /src/it/issues/issue-75/.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 18 | 20 | 21 | @project.groupId@ 22 | @project.artifactId@ 23 | @project.version@ 24 | 25 | -------------------------------------------------------------------------------- /src/it/issues/issue-75/.mvn/jgitver.config.xml: -------------------------------------------------------------------------------- 1 | 18 | 21 | true 22 | false 23 | -------------------------------------------------------------------------------- /src/it/issues/issue-75/invoker.properties: -------------------------------------------------------------------------------- 1 | # invoker.mavenOpts = -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 2 | invoker.mavenOpts = -Djgitver.config=other-conf/jgitver.config.xml 3 | invoker.goals = install -------------------------------------------------------------------------------- /src/it/issues/issue-75/other-conf/jgitver.config.xml: -------------------------------------------------------------------------------- 1 | 18 | 21 | false 22 | true 23 | -------------------------------------------------------------------------------- /src/it/issues/issue-75/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 4.0.0 21 | 22 | fr.brouillard.oss.it 23 | issue-75 24 | 0 25 | pom 26 | 27 | External configuration 28 | 29 | 30 | UTF-8 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/it/issues/issue-75/verify.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2016 Matthieu Brouillard [http://oss.brouillard.fr/jgitver-maven-plugin] (matthieu@brouillard.fr) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | def log = new PrintWriter( new File(basedir, "verify.log").newWriter("UTF-8"), true ) 17 | log.println( "Verify started at: " + new Date() + " in: " + basedir ) 18 | 19 | [ 20 | "chmod -R 755 .git", 21 | "rm -rf .git" 22 | ].each{ command -> 23 | 24 | def proc = command.execute(null, basedir) 25 | def sout = new StringBuilder(), serr = new StringBuilder() 26 | proc.waitForProcessOutput(sout, serr) 27 | 28 | log.println( "cmd: " + command ) 29 | log.println( "out:" ) ; log.println( sout.toString().trim() ) 30 | log.println( "err:" ) ; log.println( serr.toString().trim() ) 31 | log.println( "ret: " + proc.exitValue() ) 32 | 33 | assert proc.exitValue() == 0 34 | 35 | } 36 | 37 | def buildLog = new File(basedir, "build.log").readLines() 38 | 39 | // Check the version was used by the plugin execution 40 | def versionChanges = buildLog.findAll { it =~ /fr.brouillard.oss.it::issue-75::0 -> 1.0.1-2/ } 41 | log.println( "versionChanges: " + versionChanges ) 42 | assert 0 < versionChanges.size() 43 | 44 | log.println( "Verify completed at: " + new Date() ) 45 | log.close() 46 | return true -------------------------------------------------------------------------------- /src/it/issues/issue-79.1/.gitignore: -------------------------------------------------------------------------------- 1 | prebuild.log 2 | build.log -------------------------------------------------------------------------------- /src/it/issues/issue-79.1/.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 18 | 20 | 21 | @project.groupId@ 22 | @project.artifactId@ 23 | @project.version@ 24 | 25 | -------------------------------------------------------------------------------- /src/it/issues/issue-79.1/.mvn/jgitver.config.xml: -------------------------------------------------------------------------------- 1 | 18 | 21 | false 22 | true 23 | -------------------------------------------------------------------------------- /src/it/issues/issue-79.1/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.mavenOpts = -Djgitver.use-version=1.0.0 2 | invoker.goals = install -------------------------------------------------------------------------------- /src/it/issues/issue-79.2/.gitignore: -------------------------------------------------------------------------------- 1 | prebuild.log 2 | build.log -------------------------------------------------------------------------------- /src/it/issues/issue-79.2/.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 18 | 20 | 21 | @project.groupId@ 22 | @project.artifactId@ 23 | @project.version@ 24 | 25 | -------------------------------------------------------------------------------- /src/it/issues/issue-79.2/.mvn/jgitver.config.xml: -------------------------------------------------------------------------------- 1 | 18 | 21 | false 22 | true 23 | -------------------------------------------------------------------------------- /src/it/issues/issue-79.2/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.goals = install -------------------------------------------------------------------------------- /src/it/issues/issue-93-pattern-override/.gitignore: -------------------------------------------------------------------------------- 1 | prebuild.log 2 | build.log -------------------------------------------------------------------------------- /src/it/issues/issue-93-pattern-override/.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 18 | 20 | 21 | @project.groupId@ 22 | @project.artifactId@ 23 | @project.version@ 24 | 25 | -------------------------------------------------------------------------------- /src/it/issues/issue-93-pattern-override/.mvn/jgitver.config.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | PATTERN 20 | ${v}${+:meta.COMMIT_DISTANCE} 21 | -------------------------------------------------------------------------------- /src/it/issues/issue-93-pattern-override/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 4.0.0 21 | 22 | fr.brouillard.oss.it 23 | issue-93-pattern-override 24 | 0 25 | pom 26 | 27 | Verify pattern strategy is used with pattern overriden 28 | 29 | 30 | UTF-8 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/it/issues/issue-93-pattern-usage/.gitignore: -------------------------------------------------------------------------------- 1 | prebuild.log 2 | build.log -------------------------------------------------------------------------------- /src/it/issues/issue-93-pattern-usage/.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 18 | 20 | 21 | @project.groupId@ 22 | @project.artifactId@ 23 | @project.version@ 24 | 25 | -------------------------------------------------------------------------------- /src/it/issues/issue-93-pattern-usage/.mvn/jgitver.config.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | PATTERN 20 | -------------------------------------------------------------------------------- /src/it/issues/issue-93-pattern-usage/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 4.0.0 21 | 22 | fr.brouillard.oss.it 23 | issue-93-pattern-usage 24 | 0 25 | pom 26 | 27 | Verify pattern strategy is used with defaults 28 | 29 | 30 | UTF-8 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/it/issues/issue-98-merges/.gitignore: -------------------------------------------------------------------------------- 1 | prebuild.log 2 | build.log -------------------------------------------------------------------------------- /src/it/issues/issue-98-merges/.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 18 | 20 | 21 | @project.groupId@ 22 | @project.artifactId@ 23 | @project.version@ 24 | 25 | -------------------------------------------------------------------------------- /src/it/issues/issue-98-merges/.mvn/jgitver.config.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | CONFIGURABLE 20 | true 21 | true 22 | -------------------------------------------------------------------------------- /src/it/issues/issue-98-merges/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 4.0.0 21 | 22 | fr.brouillard.oss.it 23 | issue-98-merges 24 | 0 25 | pom 26 | 27 | Verify merges works correctly by finding max version between merged branches 28 | 29 | 30 | UTF-8 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/it/java-plugin-extension-it/.gitignore: -------------------------------------------------------------------------------- 1 | prebuild.log 2 | build.log -------------------------------------------------------------------------------- /src/it/java-plugin-extension-it/.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 18 | 20 | 21 | @project.groupId@ 22 | @project.artifactId@ 23 | @project.version@ 24 | 25 | -------------------------------------------------------------------------------- /src/it/java-plugin-extension-it/invoker.properties: -------------------------------------------------------------------------------- 1 | # invoker.mavenOpts = -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 2 | # invoker.goals = -X install project-info-reports:dependencies -------------------------------------------------------------------------------- /src/it/java-plugin-extension-it/pom.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | 4.0.0 20 | 21 | fr.brouillard.oss.it 22 | java-plugin-extension-it 23 | 0 24 | jar 25 | 26 | demo-jgitver-java 27 | http://maven.apache.org 28 | 29 | 30 | 1.8 31 | 1.8 32 | UTF-8 33 | 34 | 35 | 36 | 37 | junit 38 | junit 39 | 3.8.1 40 | test 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /src/it/java-plugin-extension-it/src/main/java/fr/brouillard/oss/demo/App.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Matthieu Brouillard [http://oss.brouillard.fr/jgitver-maven-plugin] (matthieu@brouillard.fr) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package fr.brouillard.oss.demo; 17 | 18 | /** 19 | * Hello world! 20 | * 21 | */ 22 | public class App 23 | { 24 | public static void main( String[] args ) 25 | { 26 | System.out.println( "Hello World!" ); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/it/java-plugin-extension-it/verify.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2016 Matthieu Brouillard [http://oss.brouillard.fr/jgitver-maven-plugin] (matthieu@brouillard.fr) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | def baseDir = new File("$basedir") 17 | 18 | File actions = new File(baseDir, "verify-actions.log") 19 | actions.write 'Actions started at: ' + new Date() + '\n' 20 | 21 | actions << 'rm -rf .git'.execute(null, baseDir).text 22 | 23 | // Check the version was used by the plugin execution 24 | def foundLines = new File("$basedir", "build.log").readLines().findAll { it =~ /fr.brouillard.oss.it::java-plugin-extension-it::0 -> 1.0.1-SNAPSHOT/ } 25 | assert 0 < foundLines.size 26 | 27 | // And check that the produced files were installed with the good version 28 | File installedPomFile = new File("$basedir" + "/../../local-repo/fr/brouillard/oss/it/java-plugin-extension-it/1.0.1-SNAPSHOT/", "java-plugin-extension-it-1.0.1-SNAPSHOT.pom") 29 | assert installedPomFile.isFile() 30 | assert 1 == installedPomFile.readLines().findAll { it =~ /1.0.1-SNAPSHOT<\/version>/ }.size() 31 | 32 | File installedJarFile = new File("$basedir" + "/../../local-repo/fr/brouillard/oss/it/java-plugin-extension-it/1.0.1-SNAPSHOT/", "java-plugin-extension-it-1.0.1-SNAPSHOT.jar") 33 | assert installedJarFile.isFile() 34 | 35 | return true 36 | -------------------------------------------------------------------------------- /src/it/multi-external-parent/.gitignore: -------------------------------------------------------------------------------- 1 | prebuild.log 2 | build.log -------------------------------------------------------------------------------- /src/it/multi-external-parent/.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 18 | 20 | 21 | @project.groupId@ 22 | @project.artifactId@ 23 | @project.version@ 24 | 25 | -------------------------------------------------------------------------------- /src/it/multi-external-parent/invoker.properties: -------------------------------------------------------------------------------- 1 | # invoker.mavenOpts = -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -------------------------------------------------------------------------------- /src/it/multi-external-parent/module-1/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 4.0.0 21 | 22 | child 23 | pom 24 | 25 | 26 | fr.brouillard.oss.it.multi.with.extparents 27 | main 28 | 0 29 | 30 | 31 | child::A simple IT verifying the basic use case. 32 | 33 | -------------------------------------------------------------------------------- /src/it/multi-external-parent/module-ext-parent/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 4.0.0 21 | 22 | child-with-extparent 23 | fr.brouillard.oss.it.multi.with.extparents 24 | 0 25 | pom 26 | 27 | 28 | org.springframework.boot 29 | spring-boot-starter-parent 30 | 1.5.9.RELEASE 31 | 32 | 33 | child with ext parent: 34 | 35 | -------------------------------------------------------------------------------- /src/it/multi-external-parent/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 4.0.0 21 | 22 | 23 | org.sonatype.oss 24 | oss-parent 25 | 7 26 | 27 | 28 | fr.brouillard.oss.it.multi.with.extparents 29 | main 30 | 0 31 | pom 32 | 33 | An IT verifying the use case of a multi-module project with a child module with an external parent. 34 | 35 | 36 | UTF-8 37 | 38 | 39 | 40 | module-1 41 | module-ext-parent 42 | 43 | 44 | -------------------------------------------------------------------------------- /src/it/multi-pure-extension-it/.gitignore: -------------------------------------------------------------------------------- 1 | prebuild.log 2 | build.log -------------------------------------------------------------------------------- /src/it/multi-pure-extension-it/.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 18 | 20 | 21 | @project.groupId@ 22 | @project.artifactId@ 23 | @project.version@ 24 | 25 | -------------------------------------------------------------------------------- /src/it/multi-pure-extension-it/module/src/main/java/fr/brouillard/oss/demo/App.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Matthieu Brouillard [http://oss.brouillard.fr/jgitver-maven-plugin] (matthieu@brouillard.fr) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package fr.brouillard.oss.demo; 17 | 18 | /** 19 | * Hello world! 20 | * 21 | */ 22 | public class App 23 | { 24 | public static void main( String[] args ) 25 | { 26 | System.out.println( "Hello World!" ); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/it/multi-pure-extension-resolve-version-variable-it/.gitignore: -------------------------------------------------------------------------------- 1 | prebuild.log 2 | build.log -------------------------------------------------------------------------------- /src/it/multi-pure-extension-resolve-version-variable-it/.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 18 | 20 | 21 | @project.groupId@ 22 | @project.artifactId@ 23 | @project.version@ 24 | 25 | -------------------------------------------------------------------------------- /src/it/multi-pure-extension-resolve-version-variable-it/module/src/main/java/fr/brouillard/oss/demo/App.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Matthieu Brouillard [http://oss.brouillard.fr/jgitver-maven-plugin] (matthieu@brouillard.fr) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package fr.brouillard.oss.demo; 17 | 18 | /** 19 | * Hello world! 20 | * 21 | */ 22 | public class App 23 | { 24 | public static void main( String[] args ) 25 | { 26 | System.out.println( "Hello World!" ); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/it/pom-non-qualifier-branches-list-on-develop-it/.gitignore: -------------------------------------------------------------------------------- 1 | prebuild.log 2 | build.log -------------------------------------------------------------------------------- /src/it/pom-non-qualifier-branches-list-on-develop-it/.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 18 | 20 | 21 | @project.groupId@ 22 | @project.artifactId@ 23 | @project.version@ 24 | 25 | -------------------------------------------------------------------------------- /src/it/pom-non-qualifier-branches-list-on-develop-it/verify.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2016 Matthieu Brouillard [http://oss.brouillard.fr/jgitver-maven-plugin] (matthieu@brouillard.fr) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | def baseDir = new File("$basedir") 17 | 18 | File actions = new File(baseDir, "verify-actions.log") 19 | actions.write 'Actions started at: ' + new Date() + '\n' 20 | 21 | actions << 'rm -rf .git'.execute(null, baseDir).text 22 | 23 | // Check the version was used by the plugin execution 24 | def foundLines = new File("$basedir", "build.log").readLines().findAll { it =~ /fr.brouillard.oss.it::pom-single-plugin-extension-it::0 -> 1.0.1-develop-SNAPSHOT/ } 25 | assert 0 < foundLines.size 26 | 27 | // And check that the produced artifact was installed with the good version 28 | File installedPomFile = new File("$basedir" + "/../../local-repo/fr/brouillard/oss/it/pom-single-plugin-extension-it/1.0.1-develop-SNAPSHOT/", "pom-single-plugin-extension-it-1.0.1-develop-SNAPSHOT.pom") 29 | assert installedPomFile.isFile() 30 | assert 1 == installedPomFile.readLines().findAll { it =~ /1.0.1-develop-SNAPSHOT<\/version>/ }.size() 31 | 32 | return true 33 | -------------------------------------------------------------------------------- /src/it/pom-non-qualifier-branches-list-on-feature-it/.gitignore: -------------------------------------------------------------------------------- 1 | prebuild.log 2 | build.log -------------------------------------------------------------------------------- /src/it/pom-non-qualifier-branches-list-on-feature-it/.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 18 | 20 | 21 | @project.groupId@ 22 | @project.artifactId@ 23 | @project.version@ 24 | 25 | -------------------------------------------------------------------------------- /src/it/pom-non-qualifier-branches-list-on-feature-it/verify.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2016 Matthieu Brouillard [http://oss.brouillard.fr/jgitver-maven-plugin] (matthieu@brouillard.fr) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | def baseDir = new File("$basedir") 17 | 18 | File actions = new File(baseDir, "verify-actions.log") 19 | actions.write 'Actions started at: ' + new Date() + '\n' 20 | 21 | actions << 'rm -rf .git'.execute(null, baseDir).text 22 | 23 | // Check the version was used by the plugin execution 24 | def foundLines = new File("$basedir", "build.log").readLines().findAll { it =~ /fr.brouillard.oss.it::pom-single-plugin-extension-it::0 -> 1.0.1-SNAPSHOT/ } 25 | assert 0 < foundLines.size 26 | 27 | // And check that the produced artifact was installed with the good version 28 | File installedPomFile = new File("$basedir" + "/../../local-repo/fr/brouillard/oss/it/pom-single-plugin-extension-it/1.0.1-SNAPSHOT/", "pom-single-plugin-extension-it-1.0.1-SNAPSHOT.pom") 29 | assert installedPomFile.isFile() 30 | assert 1 == installedPomFile.readLines().findAll { it =~ /1.0.1-SNAPSHOT<\/version>/ }.size() 31 | 32 | return true 33 | -------------------------------------------------------------------------------- /src/it/pom-non-qualifier-branches-single-on-develop-it/.gitignore: -------------------------------------------------------------------------------- 1 | prebuild.log 2 | build.log -------------------------------------------------------------------------------- /src/it/pom-non-qualifier-branches-single-on-develop-it/.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 18 | 20 | 21 | @project.groupId@ 22 | @project.artifactId@ 23 | @project.version@ 24 | 25 | -------------------------------------------------------------------------------- /src/it/pom-non-qualifier-branches-single-on-develop-it/verify.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2016 Matthieu Brouillard [http://oss.brouillard.fr/jgitver-maven-plugin] (matthieu@brouillard.fr) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | def baseDir = new File("$basedir") 17 | 18 | File actions = new File(baseDir, "verify-actions.log") 19 | actions.write 'Actions started at: ' + new Date() + '\n' 20 | 21 | actions << 'rm -rf .git'.execute(null, baseDir).text 22 | 23 | // Check the version was used by the plugin execution 24 | def foundLines = new File("$basedir", "build.log").readLines().findAll { it =~ /fr.brouillard.oss.it::pom-single-plugin-extension-it::0 -> 1.0.1-develop-SNAPSHOT/ } 25 | assert 0 < foundLines.size 26 | 27 | // And check that the produced artifact was installed with the good version 28 | File installedPomFile = new File("$basedir" + "/../../local-repo/fr/brouillard/oss/it/pom-single-plugin-extension-it/1.0.1-develop-SNAPSHOT/", "pom-single-plugin-extension-it-1.0.1-develop-SNAPSHOT.pom") 29 | assert installedPomFile.isFile() 30 | assert 1 == installedPomFile.readLines().findAll { it =~ /1.0.1-develop-SNAPSHOT<\/version>/ }.size() 31 | 32 | return true 33 | -------------------------------------------------------------------------------- /src/it/pom-non-qualifier-branches-single-on-feature-it/.gitignore: -------------------------------------------------------------------------------- 1 | prebuild.log 2 | build.log -------------------------------------------------------------------------------- /src/it/pom-non-qualifier-branches-single-on-feature-it/.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 18 | 20 | 21 | @project.groupId@ 22 | @project.artifactId@ 23 | @project.version@ 24 | 25 | -------------------------------------------------------------------------------- /src/it/pom-non-qualifier-branches-single-on-feature-it/verify.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2016 Matthieu Brouillard [http://oss.brouillard.fr/jgitver-maven-plugin] (matthieu@brouillard.fr) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | def baseDir = new File("$basedir") 17 | 18 | File actions = new File(baseDir, "verify-actions.log") 19 | actions.write 'Actions started at: ' + new Date() + '\n' 20 | 21 | actions << 'rm -rf .git'.execute(null, baseDir).text 22 | 23 | // Check the version was used by the plugin execution 24 | def foundLines = new File("$basedir", "build.log").readLines().findAll { it =~ /fr.brouillard.oss.it::pom-single-plugin-extension-it::0 -> 1.0.1-SNAPSHOT/ } 25 | assert 0 < foundLines.size 26 | 27 | // And check that the produced artifact was installed with the good version 28 | File installedPomFile = new File("$basedir" + "/../../local-repo/fr/brouillard/oss/it/pom-single-plugin-extension-it/1.0.1-SNAPSHOT/", "pom-single-plugin-extension-it-1.0.1-SNAPSHOT.pom") 29 | assert installedPomFile.isFile() 30 | assert 1 == installedPomFile.readLines().findAll { it =~ /1.0.1-SNAPSHOT<\/version>/ }.size() 31 | 32 | return true 33 | -------------------------------------------------------------------------------- /src/it/pom-plugin-extension-with-basic-configuration-it/.gitignore: -------------------------------------------------------------------------------- 1 | prebuild.log 2 | build.log -------------------------------------------------------------------------------- /src/it/pom-plugin-extension-with-basic-configuration-it/.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 18 | 20 | 21 | @project.groupId@ 22 | @project.artifactId@ 23 | @project.version@ 24 | 25 | -------------------------------------------------------------------------------- /src/it/pom-plugin-extension-with-basic-configuration-it/.mvn/jgitver.config.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | false 20 | true 21 | -------------------------------------------------------------------------------- /src/it/pom-plugin-extension-with-basic-configuration-it/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 4.0.0 21 | 22 | fr.brouillard.oss.it 23 | pom-plugin-extension-with-basic-configuration-it 24 | 0 25 | pom 26 | 27 | A simple IT verifying the basic use case. 28 | 29 | 30 | UTF-8 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/it/pom-plugin-extension-with-basic-configuration-it/verify.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2016 Matthieu Brouillard [http://oss.brouillard.fr/jgitver-maven-plugin] (matthieu@brouillard.fr) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | def baseDir = new File("$basedir") 17 | 18 | File actions = new File(baseDir, "verify-actions.log") 19 | actions.write 'Actions started at: ' + new Date() + '\n' 20 | 21 | actions << 'rm -rf .git'.execute(null, baseDir).text 22 | 23 | // Check the version was used by the plugin execution 24 | def foundLines = new File("$basedir", "build.log").readLines().findAll { it =~ /fr.brouillard.oss.it::pom-plugin-extension-with-basic-configuration-it::0 -> 1.0.1-1/ } 25 | assert 0 < foundLines.size 26 | 27 | // And check that the produced artifact was installed with the good version 28 | File installedPomFile = new File("$basedir" + "/../../local-repo/fr/brouillard/oss/it/pom-plugin-extension-with-basic-configuration-it/1.0.1-1/", "pom-plugin-extension-with-basic-configuration-it-1.0.1-1.pom") 29 | assert installedPomFile.isFile() 30 | assert 1 == installedPomFile.readLines().findAll { it =~ /1.0.1-1<\/version>/ }.size() 31 | 32 | return true 33 | -------------------------------------------------------------------------------- /src/it/pom-plugin-extension-with-basic-configuration-oldname-it/.gitignore: -------------------------------------------------------------------------------- 1 | prebuild.log 2 | build.log -------------------------------------------------------------------------------- /src/it/pom-plugin-extension-with-basic-configuration-oldname-it/.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 18 | 20 | 21 | @project.groupId@ 22 | @project.artifactId@ 23 | @project.version@ 24 | 25 | -------------------------------------------------------------------------------- /src/it/pom-plugin-extension-with-basic-configuration-oldname-it/.mvn/jgtiver.config.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | false 20 | true 21 | -------------------------------------------------------------------------------- /src/it/pom-plugin-extension-with-basic-configuration-oldname-it/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 4.0.0 21 | 22 | fr.brouillard.oss.it 23 | pom-plugin-extension-with-basic-configuration-it 24 | 0 25 | pom 26 | 27 | A simple IT verifying the basic use case. 28 | 29 | 30 | UTF-8 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/it/pom-plugin-extension-with-basic-configuration-oldname-it/verify.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2016 Matthieu Brouillard [http://oss.brouillard.fr/jgitver-maven-plugin] (matthieu@brouillard.fr) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | def baseDir = new File("$basedir") 17 | 18 | File actions = new File(baseDir, "verify-actions.log") 19 | actions.write 'Actions started at: ' + new Date() + '\n' 20 | 21 | actions << 'rm -rf .git'.execute(null, baseDir).text 22 | 23 | // Check the version was used by the plugin execution 24 | def foundLines = new File("$basedir", "build.log").readLines().findAll { it =~ /fr.brouillard.oss.it::pom-plugin-extension-with-basic-configuration-it::0 -> 1.0.1-1/ } 25 | assert 0 < foundLines.size 26 | 27 | // And check that the produced artifact was installed with the good version 28 | File installedPomFile = new File("$basedir" + "/../../local-repo/fr/brouillard/oss/it/pom-plugin-extension-with-basic-configuration-it/1.0.1-1/", "pom-plugin-extension-with-basic-configuration-it-1.0.1-1.pom") 29 | assert installedPomFile.isFile() 30 | assert 1 == installedPomFile.readLines().findAll { it =~ /1.0.1-1<\/version>/ }.size() 31 | 32 | return true 33 | -------------------------------------------------------------------------------- /src/it/pom-single-plugin-extension-it/.gitignore: -------------------------------------------------------------------------------- 1 | prebuild.log 2 | build.log -------------------------------------------------------------------------------- /src/it/pom-single-plugin-extension-it/.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 18 | 20 | 21 | @project.groupId@ 22 | @project.artifactId@ 23 | @project.version@ 24 | 25 | -------------------------------------------------------------------------------- /src/it/pom-single-plugin-extension-it/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 4.0.0 21 | 22 | fr.brouillard.oss.it 23 | pom-single-plugin-extension-it 24 | 0 25 | pom 26 | 27 | A simple IT verifying the basic use case. 28 | 29 | 30 | UTF-8 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/it/pom-single-plugin-extension-it/verify.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2016 Matthieu Brouillard [http://oss.brouillard.fr/jgitver-maven-plugin] (matthieu@brouillard.fr) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | def baseDir = new File("$basedir") 17 | 18 | File actions = new File(baseDir, "verify-actions.log") 19 | actions.write 'Actions started at: ' + new Date() + '\n' 20 | 21 | actions << 'rm -rf .git'.execute(null, baseDir).text 22 | 23 | // Check the version was used by the plugin execution 24 | def foundLines = new File("$basedir", "build.log").readLines().findAll { it =~ /fr.brouillard.oss.it::pom-single-plugin-extension-it::0 -> 1.0.1-SNAPSHOT/ } 25 | assert 0 < foundLines.size 26 | 27 | // And check that the produced artifact was installed with the good version 28 | File installedPomFile = new File("$basedir" + "/../../local-repo/fr/brouillard/oss/it/pom-single-plugin-extension-it/1.0.1-SNAPSHOT/", "pom-single-plugin-extension-it-1.0.1-SNAPSHOT.pom") 29 | assert installedPomFile.isFile() 30 | assert 1 == installedPomFile.readLines().findAll { it =~ /1.0.1-SNAPSHOT<\/version>/ }.size() 31 | 32 | return true 33 | -------------------------------------------------------------------------------- /src/it/pom-with-old-extension-system/.gitignore: -------------------------------------------------------------------------------- 1 | prebuild.log 2 | build.log -------------------------------------------------------------------------------- /src/it/pom-with-old-extension-system/invoker.properties: -------------------------------------------------------------------------------- 1 | # invoker.mavenOpts = -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 2 | invoker.buildResult = failure 3 | # invoker.goals = -X install -------------------------------------------------------------------------------- /src/it/pom-with-old-extension-system/verify.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2016 Matthieu Brouillard [http://oss.brouillard.fr/jgitver-maven-plugin] (matthieu@brouillard.fr) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | def baseDir = new File("$basedir") 17 | 18 | File actions = new File(baseDir, "verify-actions.log") 19 | actions.write 'Actions started at: ' + new Date() + '\n' 20 | 21 | actions << 'rm -rf .git'.execute(null, baseDir).text 22 | 23 | // Check the version was used by the plugin execution 24 | def foundLines = new File("$basedir", "build.log").readLines().findAll { it =~ /read https:\/\/github.com\/jgitver\/jgitver-maven-plugin for further information/ } 25 | assert 1 == foundLines.size 26 | 27 | return true 28 | -------------------------------------------------------------------------------- /src/it/pom-with-old-plugin-system/.gitignore: -------------------------------------------------------------------------------- 1 | prebuild.log 2 | build.log -------------------------------------------------------------------------------- /src/it/pom-with-old-plugin-system/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.buildResult = failure -------------------------------------------------------------------------------- /src/it/pom-with-old-plugin-system/verify.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2016 Matthieu Brouillard [http://oss.brouillard.fr/jgitver-maven-plugin] (matthieu@brouillard.fr) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | def baseDir = new File("$basedir") 17 | 18 | File actions = new File(baseDir, "verify-actions.log") 19 | actions.write 'Actions started at: ' + new Date() + '\n' 20 | 21 | actions << 'rm -rf .git'.execute(null, baseDir).text 22 | 23 | // Check the version was used by the plugin execution 24 | def foundLines = new File("$basedir", "build.log").readLines().findAll { it =~ /read https:\/\/github.com\/jgitver\/jgitver-maven-plugin for further information/ } 25 | assert 1 == foundLines.size 26 | 27 | return true 28 | -------------------------------------------------------------------------------- /src/it/settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | it-repo 23 | 24 | true 25 | 26 | 27 | 28 | local.central 29 | @localRepositoryUrl@ 30 | 31 | true 32 | 33 | 34 | true 35 | 36 | 37 | 38 | 39 | 40 | local.central 41 | @localRepositoryUrl@ 42 | 43 | true 44 | 45 | 46 | true 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /src/it/user-defined-tag-version-pattern/.gitignore: -------------------------------------------------------------------------------- 1 | prebuild.log 2 | build.log -------------------------------------------------------------------------------- /src/it/user-defined-tag-version-pattern/.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 18 | 20 | 21 | @project.groupId@ 22 | @project.artifactId@ 23 | @project.version@ 24 | 25 | -------------------------------------------------------------------------------- /src/it/user-defined-tag-version-pattern/.mvn/jgitver.config.xml: -------------------------------------------------------------------------------- 1 | 18 | 21 | r([0-9]+) 22 | -------------------------------------------------------------------------------- /src/it/user-defined-tag-version-pattern/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 4.0.0 21 | 22 | fr.brouillard.oss.it 23 | user-defined-tag-version-pattern 24 | 0 25 | pom 26 | 27 | Verify tag pattern can be changed 28 | 29 | 30 | UTF-8 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/it/verify-export-properties/.gitignore: -------------------------------------------------------------------------------- 1 | prebuild.log 2 | build.log -------------------------------------------------------------------------------- /src/it/verify-export-properties/.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 18 | 20 | 21 | @project.groupId@ 22 | @project.artifactId@ 23 | @project.version@ 24 | 25 | -------------------------------------------------------------------------------- /src/it/verify-export-properties/.mvn/jgitver.config.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | false 20 | -------------------------------------------------------------------------------- /src/it/verify-export-properties/invoker.properties: -------------------------------------------------------------------------------- 1 | # invoker.mavenOpts = -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 2 | invoker.goals = clean verify -Djgitver.export-properties-path=./jgitver-output.properties -------------------------------------------------------------------------------- /src/it/verify-export-properties/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 4.0.0 21 | 22 | fr.brouillard.oss.it 23 | export-properties-is-working 24 | 1.0 25 | pom 26 | 27 | A simple IT verifying that properties are exported into a file if so requested 28 | 29 | 30 | UTF-8 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/it/verify-export-properties/verify.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2016 Matthieu Brouillard [http://oss.brouillard.fr/jgitver-maven-plugin] (matthieu@brouillard.fr) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | def baseDir = new File("$basedir") 17 | def exportedPropsFileStr = 'jgitver-output.properties' 18 | 19 | File actions = new File(baseDir, "verify-actions.log") 20 | actions.write 'Actions started at: ' + new Date() + '\n' 21 | 22 | actions << 'rm -rf .git'.execute(null, baseDir).text 23 | 24 | def logLines = new File("$basedir", "build.log").readLines() 25 | foundLines = logLines.findAll { it =~ /Properties exported to/ } 26 | assert 1 == foundLines.size 27 | 28 | File exportedPropsFile = new File(basedir, exportedPropsFileStr) 29 | assert exportedPropsFile.isFile() 30 | 31 | Properties properties = new Properties() 32 | exportedPropsFile.withInputStream { 33 | properties.load(it) 34 | } 35 | 36 | // The should be a decent amount of properties 37 | assert properties.size() >= 10 38 | 39 | 40 | 41 | 42 | return true 43 | -------------------------------------------------------------------------------- /src/it/verify_skip/.gitignore: -------------------------------------------------------------------------------- 1 | prebuild.log 2 | build.log -------------------------------------------------------------------------------- /src/it/verify_skip/.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 18 | 20 | 21 | @project.groupId@ 22 | @project.artifactId@ 23 | @project.version@ 24 | 25 | -------------------------------------------------------------------------------- /src/it/verify_skip/.mvn/jgitver.config.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | false 20 | -------------------------------------------------------------------------------- /src/it/verify_skip/invoker.properties: -------------------------------------------------------------------------------- 1 | # invoker.mavenOpts = -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 2 | invoker.goals = clean install -Djgitver.skip=true -------------------------------------------------------------------------------- /src/it/verify_skip/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 4.0.0 21 | 22 | fr.brouillard.oss.it 23 | skip-is-working 24 | 2.0 25 | pom 26 | 27 | A simple IT verifying that extension can be skipped by property. 28 | 29 | 30 | UTF-8 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/it/verify_skip/verify.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2016 Matthieu Brouillard [http://oss.brouillard.fr/jgitver-maven-plugin] (matthieu@brouillard.fr) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | def baseDir = new File("$basedir") 17 | 18 | File actions = new File(baseDir, "verify-actions.log") 19 | actions.write 'Actions started at: ' + new Date() + '\n' 20 | 21 | actions << 'rm -rf .git'.execute(null, baseDir).text 22 | 23 | // Check the version was used by the plugin execution 24 | def logLines = new File("$basedir", "build.log").readLines() 25 | def foundLines = logLines.findAll { it =~ /fr.brouillard.oss.it::skip-is-working::2.0 ->/ } 26 | assert 0 == foundLines.size 27 | 28 | foundLines = logLines.findAll { it =~ /jgitver execution has been skipped by request of the user/ } 29 | assert 1 == foundLines.size 30 | 31 | // And check that the produced artifact was installed with the good version 32 | File installedPomFile = new File("$basedir" + "/../../local-repo/fr/brouillard/oss/it/skip-is-working/2.0/", "skip-is-working-2.0.pom") 33 | assert installedPomFile.isFile() 34 | assert 1 == installedPomFile.readLines().findAll { it =~ /2.0<\/version>/ }.size() 35 | 36 | return true 37 | -------------------------------------------------------------------------------- /src/it/xml-schemas/invalid-schema-1.0.0/.gitignore: -------------------------------------------------------------------------------- 1 | prebuild.log 2 | build.log -------------------------------------------------------------------------------- /src/it/xml-schemas/invalid-schema-1.0.0/.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 18 | 20 | 21 | @project.groupId@ 22 | @project.artifactId@ 23 | @project.version@ 24 | 25 | -------------------------------------------------------------------------------- /src/it/xml-schemas/invalid-schema-1.0.0/.mvn/jgitver.config.xml: -------------------------------------------------------------------------------- 1 | 18 | 21 | 22 | -------------------------------------------------------------------------------- /src/it/xml-schemas/invalid-schema-1.0.0/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.buildResult = failure 2 | invoker.goals = -X install 3 | -------------------------------------------------------------------------------- /src/it/xml-schemas/invalid-schema-1.0.0/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 4.0.0 21 | 22 | fr.brouillard.oss.it.xml-schemas 23 | invalid-1_0_0 24 | 0 25 | pom 26 | 27 | Verify dirty state is part of project name 28 | 29 | 30 | UTF-8 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/main/java/fr/brouillard/oss/jgitver/JGitverConfiguration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Matthieu Brouillard [http://oss.brouillard.fr/jgitver-maven-plugin] (matthieu@brouillard.fr) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package fr.brouillard.oss.jgitver; 17 | 18 | import fr.brouillard.oss.jgitver.cfg.Configuration; 19 | import java.io.File; 20 | import java.io.IOException; 21 | import org.apache.maven.MavenExecutionException; 22 | 23 | public interface JGitverConfiguration { 24 | public Configuration getConfiguration() throws MavenExecutionException; 25 | 26 | boolean ignore(File pomFile) throws IOException; 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/fr/brouillard/oss/jgitver/JGitverGuiceModule.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Matthieu Brouillard [http://oss.brouillard.fr/jgitver-maven-plugin] (matthieu@brouillard.fr) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package fr.brouillard.oss.jgitver; 17 | 18 | import com.google.inject.AbstractModule; 19 | 20 | /** 21 | * Guice binding for {@link fr.brouillard.oss.jgitver.JGitverConfiguration}. 22 | * 23 | *

Without a guice binding looking up the ProjectBuilder on other plugins will throw an exception 24 | * trying to load {@link fr.brouillard.oss.jgitver.JGitverConfiguration} (only started on maven 25 | * 3.6.3). 26 | */ 27 | public class JGitverGuiceModule extends AbstractModule { 28 | @Override 29 | protected void configure() { 30 | bind(JGitverConfiguration.class).to(JGitverConfigurationComponent.class); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/fr/brouillard/oss/jgitver/JGitverInformationProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Matthieu Brouillard [http://oss.brouillard.fr/jgitver-maven-plugin] (matthieu@brouillard.fr) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package fr.brouillard.oss.jgitver; 17 | 18 | import fr.brouillard.oss.jgitver.metadata.MetadataProvider; 19 | 20 | public interface JGitverInformationProvider extends MetadataProvider { 21 | default String getVersion() { 22 | return getVersionObject().toString(); 23 | } 24 | 25 | Version getVersionObject(); 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/fr/brouillard/oss/jgitver/JGitverMavenPluginProperties.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Matthieu Brouillard [http://oss.brouillard.fr/jgitver-maven-plugin] (matthieu@brouillard.fr) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package fr.brouillard.oss.jgitver; 17 | 18 | import java.io.IOException; 19 | import java.io.InputStream; 20 | import java.util.Properties; 21 | 22 | public class JGitverMavenPluginProperties { 23 | static Properties p = new Properties(); 24 | 25 | static { 26 | try { 27 | InputStream is = 28 | JGitverMavenPluginProperties.class.getResourceAsStream( 29 | "/META-INF/jgitver-maven-plugin-project.properties"); 30 | if (is != null) { 31 | p.load(is); 32 | } 33 | } catch (IOException e) { 34 | // ignore 35 | } 36 | } 37 | 38 | public static String getVersion() { 39 | return p.getProperty("version", "Unknown"); 40 | } 41 | 42 | public static String getSHA1() { 43 | return p.getProperty("sha1", "not git sha1"); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/fr/brouillard/oss/jgitver/JGitverSessionHolder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Matthieu Brouillard [http://oss.brouillard.fr/jgitver-maven-plugin] (matthieu@brouillard.fr) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package fr.brouillard.oss.jgitver; 17 | 18 | import java.util.Optional; 19 | import org.codehaus.plexus.component.annotations.Component; 20 | 21 | @Component(role = JGitverSessionHolder.class, instantiationStrategy = "singleton") 22 | public class JGitverSessionHolder { 23 | private JGitverSession session = null; 24 | 25 | public void setSession(JGitverSession session) { 26 | this.session = session; 27 | } 28 | 29 | public Optional session() { 30 | return Optional.ofNullable(session); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/fr/brouillard/oss/jgitver/Providers.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Matthieu Brouillard [http://oss.brouillard.fr/jgitver-maven-plugin] (matthieu@brouillard.fr) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package fr.brouillard.oss.jgitver; 17 | 18 | import fr.brouillard.oss.jgitver.metadata.Metadatas; 19 | import java.util.Optional; 20 | 21 | public class Providers { 22 | private Providers() {} 23 | 24 | public static JGitverInformationProvider decorate(final GitVersionCalculator calculator) { 25 | return new JGitverInformationProvider() { 26 | @Override 27 | public Version getVersionObject() { 28 | return calculator.getVersionObject(); 29 | } 30 | 31 | @Override 32 | public Optional meta(Metadatas meta) { 33 | return calculator.meta(meta); 34 | } 35 | }; 36 | } 37 | 38 | public static JGitverInformationProvider fixVersion( 39 | final String version, final JGitverInformationProvider provider) { 40 | return new JGitverInformationProvider() { 41 | final Version fixed = Version.parse(version); 42 | 43 | @Override 44 | public Version getVersionObject() { 45 | return fixed; 46 | } 47 | 48 | @Override 49 | public Optional meta(Metadatas meta) { 50 | return provider.meta(meta); 51 | } 52 | }; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/fr/brouillard/oss/jgitver/cfg/BranchPolicy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Matthieu Brouillard [http://oss.brouillard.fr/jgitver-maven-plugin] (matthieu@brouillard.fr) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package fr.brouillard.oss.jgitver.cfg; 17 | 18 | import fr.brouillard.oss.jgitver.BranchingPolicy.BranchNameTransformations; 19 | import java.util.Arrays; 20 | import java.util.LinkedList; 21 | import java.util.List; 22 | import javax.xml.bind.annotation.*; 23 | import org.simpleframework.xml.Root; 24 | import org.simpleframework.xml.convert.Convert; 25 | 26 | @XmlRootElement 27 | @XmlAccessorType(XmlAccessType.FIELD) 28 | @Root 29 | @Convert(SimpleBranchPolicyConverter.class) 30 | public class BranchPolicy { 31 | @XmlElement(name = "pattern") 32 | public String pattern; 33 | 34 | @XmlElementWrapper(name = "transformations") 35 | @XmlElement(name = "transformation") 36 | public List transformations = 37 | new LinkedList<>( 38 | Arrays.asList( 39 | BranchNameTransformations.REPLACE_UNEXPECTED_CHARS_UNDERSCORE.name(), 40 | BranchNameTransformations.LOWERCASE_EN.name())); 41 | } 42 | -------------------------------------------------------------------------------- /src/main/resources-filtered/META-INF/jgitver-maven-plugin-project.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2016 Matthieu Brouillard [http://oss.brouillard.fr/jgitver-maven-plugin] (matthieu@brouillard.fr) 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | version=${jgitver.calculated_version} 18 | dirty=${jgitver.dirty} 19 | sha1=${jgitver.git_sha1_full} 20 | branch=${jgitver.branch_name} -------------------------------------------------------------------------------- /src/quality/checkstyle/suppressions.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/test/java/fr/brouillard/oss/jgitver/GitVersionCalculatorProxyTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Matthieu Brouillard [http://oss.brouillard.fr/jgitver-maven-plugin] (matthieu@brouillard.fr) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package fr.brouillard.oss.jgitver; 17 | 18 | import static org.hamcrest.CoreMatchers.is; 19 | import static org.hamcrest.CoreMatchers.not; 20 | import static org.junit.Assert.assertThat; 21 | 22 | import fr.brouillard.oss.jgitver.metadata.Metadatas; 23 | import java.io.File; 24 | import org.junit.Test; 25 | 26 | public class GitVersionCalculatorProxyTest { 27 | @Test 28 | public void can_proxy_calls() throws Exception { 29 | String expectedVersion = "1.0.0"; 30 | File basedir = new File(System.getProperty("user.dir")); 31 | 32 | try (GitVersionCalculator gvc = GitVersionCalculator.location(basedir)) { 33 | JGitverInformationProvider infoProvider = 34 | Providers.fixVersion(expectedVersion, Providers.decorate(gvc)); 35 | assertThat(expectedVersion, is(infoProvider.getVersion())); 36 | assertThat(expectedVersion, not(is(infoProvider.meta(Metadatas.CALCULATED_VERSION).get()))); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/test/resources/config/complex-branch.cfg.xml: -------------------------------------------------------------------------------- 1 | 2 | false 3 | 4 | 5 | (master) 6 | 7 | IGNORE 8 | 9 | 10 | 11 | (.*) 12 | 13 | REMOVE_UNEXPECTED_CHARS 14 | UPPERCASE_EN 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/test/resources/config/invalid-with-schema.xml: -------------------------------------------------------------------------------- 1 | 18 | 21 | 22 | -------------------------------------------------------------------------------- /src/test/resources/config/simple.cfg.with.schema.xml: -------------------------------------------------------------------------------- 1 | 4 | false 5 | true 6 | -------------------------------------------------------------------------------- /src/test/resources/config/simple.cfg.xml: -------------------------------------------------------------------------------- 1 | 2 | false 3 | true 4 | -------------------------------------------------------------------------------- /travis-set-branch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (C) 2016 Matthieu Brouillard [http://oss.brouillard.fr/jgitver-maven-plugin] (matthieu@brouillard.fr) 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | set -ev 19 | 20 | if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then 21 | # this is not a pull request build 22 | 23 | # even knowing https://stackoverflow.com/questions/3601515/how-to-check-if-a-variable-is-set-in-bash 24 | # we test for existence or emptiness 25 | if [ -z "$TRAVIS_TAG"]; then 26 | # normal build on a branch 27 | echo "branch build detected, adjusting 'git checkout' local branch to git commit SHA1" 28 | git checkout $TRAVIS_BRANCH 29 | git reset --hard $TRAVIS_COMMIT 30 | else 31 | # tag build 32 | echo "tag build detected, keeping travis defaults for 'git checkout'" 33 | fi; 34 | 35 | else 36 | # this is a pull request build 37 | echo "PR build detected, adjusting 'git checkout' to a local PR branch " 38 | git checkout -b PR$TRAVIS_PULL_REQUEST 39 | fi; 40 | 41 | echo "asked to build: $TRAVIS_COMMIT" 42 | git status 43 | git log --oneline -n 1 44 | --------------------------------------------------------------------------------