#Selective finalNames in Maven?

1 messages · Page 1 of 1 (latest)

echo terrace
#

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?

frail lynxBOT
#

This post has been reserved for your question.

Hey @echo terrace! 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.

echo terrace
#

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>