Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ But I highly recommend using only stable versions, from maven central... :-)
</pluginRepositories>
```

If you just would like to see what the plugin can do, you can clone the repository and run
```
mvn clean install -Dmaven.test.skip=true && mvn clean package -Pdemo -Dmaven.test.skip=true
```

Using the plugin
----------------
It's really simple to setup this plugin; below is a sample pom that you may base your **pom.xml** on. Note that it binds to the initialize phase by default such that all Git properties are available for use throughout the build lifecycle.
Expand Down
89 changes: 46 additions & 43 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@
</dependency>

<!-- JGit -->

<dependency>
<groupId>org.eclipse.jgit</groupId>
<artifactId>org.eclipse.jgit</artifactId>
Expand Down Expand Up @@ -188,48 +187,7 @@
</resources>

<plugins>
<!--<plugin>-->
<!--<groupId>pl.project13.maven</groupId>-->
<!--<artifactId>git-commit-id-plugin</artifactId>-->
<!--<version>${project.version}</version>-->
<!--<executions>-->
<!--<execution>-->
<!--<goals>-->
<!--<goal>revision</goal>-->
<!--</goals>-->
<!--</execution>-->
<!--</executions>-->
<!--<configuration>-->
<!--<verbose>true</verbose>-->
<!--<skip>false</skip>-->
<!--<prefix>git</prefix>-->
<!--<dotGitDirectory>${project.basedir}/.git</dotGitDirectory>-->
<!--<generateGitPropertiesFile>true</generateGitPropertiesFile>-->
<!--<generateGitPropertiesFilename>target/testing.properties</generateGitPropertiesFilename>-->

<!--<dateFormat>dd.MM.yyyy '@' HH:mm:ss z</dateFormat>-->
<!--<useNativeGit>false</useNativeGit>-->
<!--<abbrevLength>7</abbrevLength>-->
<!--<format>properties</format>-->

<!--<gitDescribe>-->
<!--<skip>false</skip>-->
<!--<always>false</always>-->
<!--<abbrev>7</abbrev>-->
<!--<match>*</match>-->
<!--<dirty>-DEVEL</dirty>-->
<!--<forceLongFormat>false</forceLongFormat>-->
<!--</gitDescribe>-->

<!--<excludeProperties>-->
<!--<excludeProperty>git.commit.*</excludeProperty>-->
<!--<excludeProperty>git.remote.origin.url</excludeProperty>-->
<!--</excludeProperties>-->

<!--<failOnNoGitDirectory>true</failOnNoGitDirectory>-->
<!--<failOnUnableToExtractRepoInfo>true</failOnUnableToExtractRepoInfo>-->
<!--</configuration>-->
<!--</plugin>-->
<!-- if you would like to run the git-commit-id-plugin for your build, you could also include it here instead using a profile (see README.md) -->
<!-- Setting built-in java compiler properties -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down Expand Up @@ -294,6 +252,51 @@
</plugins>
</build>
</profile>
<profile>
<id>demo</id>
<build>
<plugins>
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<version>${project.version}</version>
<executions>
<execution>
<goals>
<goal>revision</goal>
</goals>
</execution>
</executions>
<configuration>
<verbose>true</verbose>
<skip>false</skip>
<prefix>git</prefix>
<dotGitDirectory>${project.basedir}/.git</dotGitDirectory>
<generateGitPropertiesFile>true</generateGitPropertiesFile>
<generateGitPropertiesFilename>target/testing.properties</generateGitPropertiesFilename>
<dateFormat>dd.MM.yyyy '@' HH:mm:ss z</dateFormat>
<useNativeGit>false</useNativeGit>
<abbrevLength>7</abbrevLength>
<format>properties</format>
<gitDescribe>
<skip>false</skip>
<always>false</always>
<abbrev>7</abbrev>
<match>*</match>
<dirty>-DEVEL</dirty>
<forceLongFormat>false</forceLongFormat>
</gitDescribe>
<excludeProperties>
<excludeProperty>git.commit.*</excludeProperty>
<excludeProperty>git.remote.origin.url</excludeProperty>
</excludeProperties>
<failOnNoGitDirectory>false</failOnNoGitDirectory>
<failOnUnableToExtractRepoInfo>true</failOnUnableToExtractRepoInfo>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>