Skip to content

Unable to obtaing git.branch property #287

Closed
@NicolaSpreafico

Description

@NicolaSpreafico

Hi,
I discovered your plugin from here: https://stackoverflow.com/a/13975553
My goal is very simple, having the git branch name inside the build version.

Here is I come so far

<plugin>
    <groupId>pl.project13.maven</groupId>
    <artifactId>git-commit-id-plugin</artifactId>
    <version>2.2.2</version>
    <executions>
        <execution>
            <id>get-the-git-infos</id>
            <goals>
                <goal>revision</goal>
            </goals>
        </execution>
    </executions>
</plugin>

And then the property
<deploy.version>test-${git.branch}</deploy.version>

But the variable is not resolved
[DEBUG] (f) version = test-${git.branch}

Am I missing a basic configuration?

I tried to launch the
pl.project13.maven:git-commit-id-plugin:revision
goal manually and there is no error

Because my filesystem is like this

.../.git
.../project/pom.xml

I also added this configuration, but no changes

<configuration>
    <dotGitDirectory>${project.basedir}/../.git</dotGitDirectory>
</configuration>

I also tried to generate the external properties files in order to see if the data is properly gathered from my repo, but no file is created

<!-- this is false by default, forces the plugin to generate the git.properties file -->
<generateGitPropertiesFile>true</generateGitPropertiesFile>

<!-- The path for the properties file to be generated. See Super Pom for default variable reference https://maven.apache.org/guides/introduction/introduction-to-the-pom.html -->
<generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>

Tha main problem here is that I'm not seeing any error, so I'm going a little blind understanding the problem.

Thanks

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions