Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Suppressing GPG signing for Maven-based continuous integration builds (Travis CI)

I'm using Travis-CI to provide continuous integration builds for a few Java open source projects I'm working on.

Normally this works smoothly, but I have a problem when the POM specifies GPG signing, e.g.

<plugin>   <groupId>org.apache.maven.plugins</groupId>   <artifactId>maven-gpg-plugin</artifactId>   <version>1.4</version>   <executions>     <execution>       <id>sign-artifacts</id>       <phase>verify</phase>       <goals>         <goal>sign</goal>       </goals>     </execution>   </executions> </plugin> 

This causes the Travis build to fail - apparently because it does not have a passphrase available while running mvn install. See this build for an example.

What is the best way to configure Maven and/or Travis to skip GPG signing for CI test builds, but still perform GPG signing when I do a proper release build?

like image 436
mikera Avatar asked Feb 12 '13 03:02

mikera


1 Answers

Disable GPG signing by adding the following line to your .travis.yml file:

install: mvn install -DskipTests -Dgpg.skip 

Example: https://github.com/stefanbirkner/system-rules/blob/master/.travis.yml

like image 99
Stefan Birkner Avatar answered Oct 05 '22 10:10

Stefan Birkner