Selective finalNames in Maven?

Currently, my pom's finalName is ProjectName-${project.version}-${git.branch.caps}-${git.commit.id.abbrev} I want to make it so that the -${git.commit.id.abbrev} is dropped from the end on every branch other than nightly. Does anyone know of a sane way to do that?
3 Replies
JavaBot
JavaBot2mo ago
This post has been reserved for your question.
Hey @Pheotis! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
Pheotis
PheotisOP2mo ago
It might be possible with the Git Maven ID Plugin, but if it is, I don't know where I would even start Currently using this:
<plugin>
<groupId>io.github.git-commit-id</groupId>
<artifactId>git-commit-id-maven-plugin</artifactId>
<version>9.0.1</version>
<executions>
<execution>
<id>get-the-git-infos</id>
<goals>
<goal>revision</goal>
</goals>
<phase>initialize</phase>
</execution>
</executions>
<configuration>
<generateGitPropertiesFile>true</generateGitPropertiesFile>
<generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>
<includeOnlyProperties>
<includeOnlyProperty>^git.commit.id.abbrev</includeOnlyProperty>
<includeOnlyProperty>^git.branch</includeOnlyProperty>
</includeOnlyProperties>
<replacementProperties>
<replacementProperty>
<property>git.branch</property>
<propertyOutputSuffix>caps</propertyOutputSuffix>
<forceValueEvaluation>false</forceValueEvaluation>
<transformationRules>
<transformationRule>
<apply>AFTER</apply>
<action>UPPER_CASE</action>
</transformationRule>
</transformationRules>
</replacementProperty>
</replacementProperties>
<commitIdGenerationMode>full</commitIdGenerationMode>
</configuration>
</plugin>
<plugin>
<groupId>io.github.git-commit-id</groupId>
<artifactId>git-commit-id-maven-plugin</artifactId>
<version>9.0.1</version>
<executions>
<execution>
<id>get-the-git-infos</id>
<goals>
<goal>revision</goal>
</goals>
<phase>initialize</phase>
</execution>
</executions>
<configuration>
<generateGitPropertiesFile>true</generateGitPropertiesFile>
<generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>
<includeOnlyProperties>
<includeOnlyProperty>^git.commit.id.abbrev</includeOnlyProperty>
<includeOnlyProperty>^git.branch</includeOnlyProperty>
</includeOnlyProperties>
<replacementProperties>
<replacementProperty>
<property>git.branch</property>
<propertyOutputSuffix>caps</propertyOutputSuffix>
<forceValueEvaluation>false</forceValueEvaluation>
<transformationRules>
<transformationRule>
<apply>AFTER</apply>
<action>UPPER_CASE</action>
</transformationRule>
</transformationRules>
</replacementProperty>
</replacementProperties>
<commitIdGenerationMode>full</commitIdGenerationMode>
</configuration>
</plugin>
JavaBot
JavaBot2mo ago
Post Closed
This post has been closed by <@928755449665298432>.
Want results from more Discord servers?
Add your server