Skip to content

Patch docs git commit #45582

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

johnnydacosta
Copy link

@johnnydacosta johnnydacosta commented May 16, 2025

Simply adding the git-commit-id-maven-plugin plugin to your POM will not generate the git.properties file by default. We must explicitly configure the plugin’s and sections to enable generation during the build lifecycle.
The block binds the plugin goal to the initialize phase, ensuring the Git information is captured early in the build.
The block enables the creation of the git.properties file with full commit details at the specified location.

wilkinsona and others added 3 commits April 24, 2025 13:23
…h Maven

This ensures the git.properties file is properly generated during the
initialize phase.
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label May 16, 2025
@wilkinsona
Copy link
Member

Thanks for the proposal, but similar configuration is already provided by spring-boot-starter-parent:

<plugin>
    <groupId>io.github.git-commit-id</groupId>
    <artifactId>git-commit-id-maven-plugin</artifactId>
    <executions>
        <execution>
            <goals>
                <goal>revision</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <verbose>true</verbose>
        <generateGitPropertiesFile>true</generateGitPropertiesFile>
        <generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>
    </configuration>
</plugin>

The documentation already mentions the role that the starter parent plays:

For Maven users, the spring-boot-starter-parent POM includes a pre-configured plugin to generate a git.properties file

@wilkinsona wilkinsona added the status: waiting-for-feedback We need additional information before we can continue label May 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-feedback We need additional information before we can continue status: waiting-for-triage An issue we've not yet triaged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants