Skip to content

Generated git propertes are no more usable by other plugins #159

@ouaibsky

Description

@ouaibsky

Hi,

Something that worked in version .11 and no more in .12 & .13

  • Use git-commit-id-plugin to generate properties (into a file but also inside the maven build itself)
  • reuse properties (git.commit.id.abbrev, git.commit.id.describe, ...) into following plugins (for examples version:set)
  <plugin>
                        <groupId>pl.project13.maven</groupId>
                        <artifactId>git-commit-id-plugin</artifactId>*
                        <version>2.1.12</version>
                        <configuration>
                            <skipPoms>false</skipPoms>
                            <generateGitPropertiesFile>false</generateGitPropertiesFile>
                            <generateGitPropertiesFilename>${project.basedir}/target/git.properties</generateGitPropertiesFilename>
                            <runOnlyOnce>false</runOnlyOnce>
                            <dotGitDirectory>${project.basedir}/../.git</dotGitDirectory>
                            <verbose>true</verbose>
                            <!--<gitDescribe>-->
                                <!--<always>true</always>-->
                            <!--</gitDescribe>-->
                        </configuration>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>revision</goal>
                                </goals>
                                <phase>initialize</phase>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>com.soebes.maven.plugins</groupId>
                        <artifactId>echo-maven-plugin</artifactId>
                        <version>0.2</version>
                        <configuration>
                            <echos>
                                <echo>"Build new version: ${parsedVersion.majorVersion}.${parsedVersion.minorVersion}-${git.commit.id.abbrev}"
                                </echo>
                            </echos>
                        </configuration>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>echo</goal>
                                </goals>
                                <phase>initialize</phase>
                            </execution>
                        </executions>
                    </plugin>

Any help is welcome
Christophe

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions