git-commit-id-plugin
Used in:
components
- OverviewOverview
- VersionsVersions
- DependentsDependents
- DependenciesDependencies
<dependency> <groupId>pl.project13.maven</groupId> <artifactId>git-commit-id-plugin</artifactId> <version>4.9.10</version> </dependency>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>pl.project13.maven</groupId> <artifactId>git-commit-id-plugin-parent</artifactId> <version>4.9.10</version> <relativePath>../pom.xml</relativePath> </parent> <groupId>pl.project13.maven</groupId> <artifactId>git-commit-id-plugin</artifactId> <packaging>maven-plugin</packaging> <version>4.9.10</version> <name>Git Commit Id Maven Plugin</name> <description> This plugin makes basic repository information available through maven resources. This can be used to display "what version is this?" or "who has deployed this and when, from which branch?" information at runtime, making it easy to find things like "oh, that isn't deployed yet, I'll test it tomorrow" and making both testers and developers life easier. See https://github.com/git-commit-id/git-commit-id-maven-plugin </description> <prerequisites> <maven>[${maven-plugin-api.version},)</maven> </prerequisites> <distributionManagement> <snapshotRepository> <id>ossrh</id> <url>https://oss.sonatype.org/content/repositories/snapshots</url> </snapshotRepository> <repository> <id>ossrh</id> <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url> </repository> <!-- We should include relocation information, but if we do maven fails with "Could not find artifact io.github.git-commit-id:git-commit-id-maven-plugin:jar:${version}". If we publish a release under the new coordinates, maven silent ignores the plugin settings when we happen to use the old coordinates in our config (https://github.com/git-commit-id/git-commit-id-maven-plugin/issues/571). As a result: The plugin is moving to a new location, but we can't encode it in the pom :-( <relocation> <groupId>io.github.git-commit-id</groupId> <artifactId>git-commit-id-maven-plugin</artifactId> </relocation> --> </distributionManagement> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <java.target>1.8</java.target> <maven-plugin-api.version>3.0</maven-plugin-api.version> <maven-plugin-plugin.version>3.6.0</maven-plugin-plugin.version> <junit.version>4.13.2</junit.version> <mockito.version>3.11.0</mockito.version> <assertj.version>3.19.0</assertj.version> </properties> <dependencies> <!-- MAVEN --> <dependency> <groupId>org.apache.maven</groupId> <artifactId>maven-plugin-api</artifactId> <version>${maven-plugin-api.version}</version> </dependency> <dependency> <groupId>org.apache.maven</groupId> <artifactId>maven-core</artifactId> <version>${maven-plugin-api.version}</version> </dependency> <dependency> <groupId>${project.groupId}</groupId> <artifactId>git-commit-id-plugin-core</artifactId> </dependency> <dependency> <groupId>com.google.code.findbugs</groupId> <artifactId>jsr305</artifactId> </dependency> <!-- dependencies to annotations --> <dependency> <groupId>org.apache.maven.plugin-tools</groupId> <artifactId>maven-plugin-annotations</artifactId> <version>${maven-plugin-plugin.version}</version> <scope>provided</scope><!-- annotations are needed only to build the plugin --> </dependency> <!-- Test stuff --> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>${junit.version}</version> <scope>test</scope> </dependency> <dependency> <groupId>org.assertj</groupId> <artifactId>assertj-core</artifactId> <version>${assertj.version}</version> <scope>test</scope> </dependency> <dependency> <groupId>org.codehaus.plexus</groupId> <artifactId>plexus-utils</artifactId> <version>3.3.0</version> <scope>test</scope> </dependency> <dependency> <groupId>org.mockito</groupId> <artifactId>mockito-core</artifactId> <version>${mockito.version}</version> <scope>test</scope> </dependency> <dependency> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> <version>2.9.0</version> <type>jar</type> <scope>test</scope> </dependency> <dependency> <groupId>pl.pragmatists</groupId> <artifactId>JUnitParams</artifactId> <version>1.1.1</version> <scope>test</scope> </dependency> <dependency> <groupId>com.github.stefanbirkner</groupId> <artifactId>system-rules</artifactId> <version>1.19.0</version> <scope>test</scope> </dependency> <!--to avoid complaints during tests--> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-simple</artifactId> <version>1.7.25</version> <scope>test</scope> </dependency> </dependencies> <build> <!-- GIT COMMIT ID PLUGIN CONFIGURATION --> <resources> <resource> <directory>src/main/resources</directory> <filtering>true</filtering> <includes> <include>**/*.properties</include> <include>**/*.xml</include> </includes> </resource> </resources> <testResources> <testResource> <directory>src/test/resources</directory> <excludes> <exclude>_git_*/**</exclude> <exclude>README.md</exclude> </excludes> </testResource> </testResources> <plugins> <!-- 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> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>${java.target}</source> <target>${java.target}</target> <compilerArgument>-Xlint:deprecation</compilerArgument> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-plugin-plugin</artifactId> <executions> <execution> <id>default-descriptor</id> <phase>process-classes</phase> </execution> <!-- <execution> <id>generated-helpmojo</id> <goals> <goal>helpmojo</goal> </goals> <configuration> <goalPrefix>git-commit-id</goalPrefix> <helpPackageName>pl.project13.maven</helpPackageName> </configuration> </execution> --> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> </plugin> </plugins> </build> <profiles> <profile> <id>java-allow-illegal-access</id> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <configuration> <trimStackTrace>false</trimStackTrace> <!-- Workaround for https://github.com/stefanbirkner/system-lambda/issues/23 --> <argLine>--illegal-access=permit --add-opens=java.base/java.util=ALL-UNNAMED</argLine> </configuration> </plugin> </plugins> </build> </profile> <profile> <id>gpg</id> <build> <plugins> <!-- GPG --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-gpg-plugin</artifactId> <executions> <execution> <id>sign-artifacts</id> <phase>verify</phase> <goals> <goal>sign</goal> </goals> </execution> </executions> </plugin> </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> <!-- optional to change the phases of the individual mojo's --> <executions> <execution> <id>get-the-git-infos</id> <goals> <goal>revision</goal> </goals> </execution> <execution> <id>validate-the-git-infos</id> <goals> <goal>validateRevision</goal> </goals> <phase>package</phase> </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>yyyy-MM-dd'T'HH:mm:ssZ</dateFormat> <dateFormatTimeZone>GMT-08:00</dateFormatTimeZone> <useNativeGit>false</useNativeGit> <abbrevLength>7</abbrevLength> <format>properties</format> <injectAllReactorProjects>true</injectAllReactorProjects> <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> <replacementProperties> <replacementProperty> <property>git.branch</property> <propertyOutputSuffix>something</propertyOutputSuffix> <token>^([^\/]*)\/([^\/]*)$</token> <value>$1-$2</value> <transformationRules> <transformationRule> <apply>BEFORE</apply> <action>UPPER_CASE</action> </transformationRule> </transformationRules> </replacementProperty> </replacementProperties> <failOnNoGitDirectory>false</failOnNoGitDirectory> <failOnUnableToExtractRepoInfo>true</failOnUnableToExtractRepoInfo> <!-- used in validateRevision --> <validationProperties> <validationProperty> <name>validating project version</name> <value>${project.version}</value> <!-- <shouldMatchTo>^[0-9\.]*$</shouldMatchTo> --> <shouldMatchTo><![CDATA[^.*(?<!-SNAPSHOT)$]]></shouldMatchTo> </validationProperty> <validationProperty> <name>validating git dirty</name> <value>${git.dirty}</value> <shouldMatchTo>false</shouldMatchTo> </validationProperty> </validationProperties> <validationShouldFailIfNoMatch>true</validationShouldFailIfNoMatch> </configuration> </plugin> </plugins> </build> </profile> </profiles> </project>