Git-commit-id-maven-plugin: Spring Boot maven plugin 2.1.4 does not resolve placeholder

Created on 10 May 2019  路  3Comments  路  Source: git-commit-id/git-commit-id-maven-plugin

I'm using Spring Boot 2.1.4.RELEASE, it comes with spring-boot-maven-plugin of the same version, however, this version does not resolve ${git.commit.time}.${git.commit.id.abbrev}.

When I change spring-boot-maven-plugin back to 2.1.3.RELEASE, it works.

<properties>
        <version.number>${git.commit.time}.${git.commit.id.abbrev}</version.number>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <!-- <version>2.1.3.RELEASE</version> -->
            </plugin>
            <plugin>
                <groupId>pl.project13.maven</groupId>
                <artifactId>git-commit-id-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>revision</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <dateFormat>yyyyMMdd-HHmmss</dateFormat>
                    <dotGitDirectory>${project.basedir}/.git</dotGitDirectory>
                    <failOnNoGitDirectory>false</failOnNoGitDirectory>
                </configuration>
            </plugin>
        </plugins>
</build>

Using spring-boot-maven-plugin 2.1.3, it produces
demo-20190510-223456.a922def.jar

Using spring-boot-maven-plugin 2.1.4, it produces
demo-${git.commit.time}.${git.commit.id.abbrev}.jar

Please see uploaded simple project to reproduce this.

demo.zip

not-a-bug

Most helpful comment

I agree with the analysis and also believe this issue should be closed.

All 3 comments

Hi,
thanks for reporting this issue and providing a sample demo where i can reproduce the issue.

To be fair this looks like the issue reported in https://github.com/spring-projects/spring-boot/issues/16456

By reading the comments I currently don't think it's a problem with this plugin. In fact based on this https://github.com/spring-projects/spring-boot/issues/16456#issuecomment-487271098 it seems that build/finalName should be immutable and it just happens to work.

In honesty I'm not sure if I can do anything to address this issue. For me it appears that spring-boot needs to apply a fix (again based on the discussion in the issue).

Let me know if I understand anything wrong.

I agree with the analysis and also believe this issue should be closed.

Thanks for the confirmation.

Please follow the linked issue for a resolution.

I'm going ahead and close this as 'non issue' in regards for this plugin.

Was this page helpful?
0 / 5 - 0 ratings