简体   繁体   中英

git-commit-id-plugin not generating git.properties in classpath during Jenkins build

I added the below dependency and build plugin in my maven pom file.

<dependency>
           <groupId>pl.project13.maven</groupId>
           <artifactId>git-commit-id-plugin</artifactId>
           <version>3.0.0</version>
</dependency>

<plugin>
               <groupId>pl.project13.maven</groupId>
               <artifactId>git-commit-id-plugin</artifactId>
               <version>3.0.0</version>
               <configuration>
                   <dotGitDirectory>${project.basedir}/.git</dotGitDirectory>
                   <prefix>git</prefix>
                   <verbose>false</verbose>
                   <generateGitPropertiesFile>true</generateGitPropertiesFile>
                   <generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>
                   <format>json</format>
               </configuration>
</plugin>

when I do a maven build from my local machine which running on Windows, it generates git.properties in my local. But the same configuration when ran through a Jenkins build the git.properties is not created in classpath so the git commit referring rest-controller not able to resolve the annotated value.

Any finding here why the git.properties not created through my Jenkins build would be highly appreciated.

Try this file output property / path - ${project.build.directory}/git.properties

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM