我尝试将应用的发布版本号设置为1.5.0.057b2009
,其中包含缩写的git commit hash。
我尝试将maven-release-plugin
与git-commit-id-plugin
结合使用。
我们在开发中的基本版本号是1.5.0-SNAPSHOT。
<plugin>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<tagNameFormat>APP-NAME-@{version}</tagNameFormat>
<autoVersionSubmodules>true</autoVersionSubmodules>
<preparationGoals>clean install</preparationGoals>
<localCheckout>true</localCheckout>
<pushChanges>true</pushChanges>
<branchName>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.x</branchName>
<releaseVersion>${project.version}.${git.commit.id.abbrev}</releaseVersion>
</configuration>
</plugin>
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<version>2.1.7</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>revision</goal>
</goals>
</execution>
</executions>
<configuration>
<dotGitDirectory>${project.basedir}/.git</dotGitDirectory>
<generateGitPropertiesFile>false</generateGitPropertiesFile><!-- somehow necessary. otherwise the variables are not available in the pom -->
</configuration>
</plugin>
整个项目使用以下命令构建:
mvn -B release:prepare
maven发布插件完全忽略了releaseVersion
属性。实际发布版本为1.5.0
,我该如何处理?