maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephen Connolly <stephen.alan.conno...@gmail.com>
Subject Re: executing release:prepare with release-sign-artifacts
Date Thu, 18 Jul 2013 12:40:38 GMT
Well actually that can be a bit of an anti-pattern... it might make sense
for the release plugin to allow defining properties that get passed
through. But normally you want to have the release:perform fork be clean
and pure.


On 18 July 2013 13:36, Richard Sand <rsand@idfconnect.com> wrote:

> Thanks Stephen, I'll give that a try. It'll at least get me unstuck. Would
> you agree that when plug-ins spawn a separate maven execution they should
> pass along any command-line java properties? Seems like this would be a
> good
> static utility method to include in the plugin api.
>
> -----Original Message-----
> From: Stephen Connolly [mailto:stephen.alan.connolly@gmail.com]
> Sent: Thursday, July 18, 2013 7:10 AM
> To: Maven Users List
> Subject: Re: executing release:prepare with release-sign-artifacts
>
> I have the following <profile> in my ~/.m2/settings.xml
>
>     <profile>
>       <id>sonatype-oss-release</id>
>       <properties>
>         <gpg.passphrase><!-- I am not going top copy & paste this
> bit--></gpg.passphrase>
>         <gpg.keyname>stephenc@apache.org</gpg.keyname>
>       </properties>
>     </profile>
>
> That means that any time I make a release which has the sonatype-oss-parent
> as its parent, then it gets signed with my personal key.
>
> For other projects which need a different key, I get them to use a
> different
> profile for releasing and I then have that different key get selected.
>
> I do worry about the passphrase being in clear text... but as my GPG keys
> for signing are on a USB stick and not permanently connected to the machine
> it seems an acceptable trade-off from my PoV
>
>
> On 17 July 2013 23:02, Richard Sand <rsand@idfconnect.com> wrote:
>
> > Hi all,
> >
> > Trying to move this obfuscation plugin along. I have the snapshot in
> > the OSS Sonatype snapshot repository now:
> >
> >
> > https://oss.sonatype.org/content/repositories/snapshots/com/idfconnect
> > /devto ols/idfc-proguard-maven-plugin/0.8.0-SNAPSHOT/
> >
> > Now I'm trying to release 0.8.0, however when I run maven
> > release:prepare, I'm getting an exception when it gets to the sign
> artifacts goal.
> >
> > The problem seems to be caused by the fact that "release:prepare"
> > forks a separate maven invocation, but isn't passing along the
> > command-line java properties into that forked invocation.
> >
> > When I call "maven deploy", I am passing in the password to my pgp.
> > Maven deploy works perfect, and puts the result SNAPSHOT artifact onto
> OSS:
> >
> >     mvn -DperformRelease=true -Dgpg.passphrase=*****  -B -X -e -U
> > -Dmaven.test.skip=true -s "C:\Documents and
> > Settings\rsand\.m2\settings.xml"
> > clean deploy
> >
> > But when I call "maven release:prepare" with the same arguments, the
> > forked maven execution fails because it cannot prompt for the gpg
> passphrase:
> >
> >     mvn -DperformRelease=true -Dgpg.passphrase=*****  -B -X -e -U
> > -Dmaven.test.skip=true -s "C:\Documents and
> > Settings\rsand\.m2\settings.xml"
> > release:prepare
> >
> > You can see the regular output below. The debug mode output is much
> > larger and shows all of the invocation properties.
> >
> > [INFO] --- maven-release-plugin:2.0:prepare (default-cli) @
> > idfc-proguard-maven-plugin --- [INFO] Resuming release from phase
> > 'run-preparation-goals'
> > [INFO] Executing goals 'clean verify'...
> > [INFO] [INFO] Scanning for projects...
> > [INFO] [INFO]
> >
> > [INFO] [INFO]
> > ----------------------------------------------------------------------
> > -- [INFO] [INFO] Building IDFC ProGuard Maven Plugin 0.8.0-SNAPSHOT
> > [INFO] [INFO]
> > ----------------------------------------------------------------------
> > --
> > [INFO] [INFO]
> > [INFO] [INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @
> > idfc-proguard-maven-plugin --- [INFO] [INFO] Deleting
> > D:\dev\workspace\IDFC ProGuard Maven Plugin\target [INFO] [INFO]
> > [INFO] [INFO] --- maven-plugin-plugin:3.2:helpmojo (help-goal) @
> > idfc-proguard-maven-plugin --- [INFO] [INFO] Using 'UTF-8' encoding to
> > read mojo metadata.
> > [INFO] [INFO] Applying mojo extractor for language: java-annotations
> > [INFO] [INFO] Mojo extractor for language: java-annotations found 0
> > mojo descriptors.
> > [INFO] [INFO] Applying mojo extractor for language: java [INFO] [INFO]
> > Mojo extractor for language: java found 0 mojo descriptors.
> > [INFO] [INFO] Applying mojo extractor for language: bsh [INFO] [INFO]
> > Mojo extractor for language: bsh found 0 mojo descriptors.
> > [INFO] [INFO]
> > [INFO] [INFO] --- maven-plugin-plugin:3.2:descriptor
> > (default-descriptor) @ idfc-proguard-maven-plugin --- [INFO] [INFO]
> > Using 'UTF-8' encoding to read mojo metadata.
> > [INFO] [INFO] Applying mojo extractor for language: java-annotations
> > [INFO] [INFO] Mojo extractor for language: java-annotations found 0
> > mojo descriptors.
> > [INFO] [INFO] Applying mojo extractor for language: java [INFO] [INFO]
> > Mojo extractor for language: java found 0 mojo descriptors.
> > [INFO] [INFO] Applying mojo extractor for language: bsh [INFO] [INFO]
> > Mojo extractor for language: bsh found 0 mojo descriptors.
> > [INFO] [INFO]
> > [INFO] [INFO] --- maven-resources-plugin:2.5:resources
> > (default-resources) @ idfc-proguard-maven-plugin --- [INFO] [debug]
> > execute contextualize [INFO] [INFO] Using 'UTF-8' encoding to copy
> > filtered resources.
> > [INFO] [INFO] skip non existing resourceDirectory
> > D:\dev\workspace\IDFC ProGuard Maven Plugin\src\main\resources [INFO]
> > [INFO] [INFO] [INFO] --- maven-compiler-plugin:2.3.2:compile
> > (default-compile) @ idfc-proguard-maven-plugin --- [INFO] [INFO]
> > Compiling 2 source files to D:\dev\workspace\IDFC ProGuard Maven
> > Plugin\target\classes [INFO] [INFO] [INFO] [INFO] ---
> > maven-plugin-plugin:3.2:descriptor (mojo-descriptor) @
> > idfc-proguard-maven-plugin --- [INFO] [INFO] Using 'UTF-8' encoding to
> > read mojo metadata.
> > [INFO] [INFO] Applying mojo extractor for language: java-annotations
> > [INFO] [INFO] Mojo extractor for language: java-annotations found 2
> > mojo descriptors.
> > [INFO] [INFO] Applying mojo extractor for language: java [INFO] [INFO]
> > Mojo extractor for language: java found 0 mojo descriptors.
> > [INFO] [INFO] Applying mojo extractor for language: bsh [INFO] [INFO]
> > Mojo extractor for language: bsh found 0 mojo descriptors.
> > [INFO] [INFO]
> > [INFO] [INFO] --- maven-resources-plugin:2.5:testResources
> > (default-testResources) @ idfc-proguard-maven-plugin --- [INFO]
> > [debug] execute contextualize [INFO] [INFO] Using 'UTF-8' encoding to
> > copy filtered resources.
> > [INFO] [INFO] skip non existing resourceDirectory
> > D:\dev\workspace\IDFC ProGuard Maven Plugin\src\test\resources [INFO]
> > [INFO] [INFO] [INFO] --- maven-compiler-plugin:2.3.2:testCompile
> > (default-testCompile) @ idfc-proguard-maven-plugin --- [INFO] [INFO]
> > Nothing to compile - all classes are up to date [INFO] [INFO] [INFO]
> > [INFO] --- maven-surefire-plugin:2.10:test (default-test) @
> > idfc-proguard-maven-plugin --- [INFO] [INFO] No tests to run.
> > [INFO] [INFO] Surefire report directory: D:\dev\workspace\IDFC
> > ProGuard Maven Plugin\target\surefire-reports [INFO] [INFO]
> > -------------------------------------------------------
> > [INFO]  T E S T S
> > [INFO] -------------------------------------------------------
> > [INFO]
> > [INFO] Results :
> > [INFO]
> > [INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0 [INFO] [INFO]
> > [INFO] [INFO] [INFO] --- maven-jar-plugin:2.3.1:jar (default-jar) @
> > idfc-proguard-maven-plugin --- [INFO] [INFO] Building jar:
> > D:\dev\workspace\IDFC ProGuard Maven
> > Plugin\target\idfc-proguard-maven-plugin-0.8.0-SNAPSHOT.jar
> > [INFO] [INFO]
> > [INFO] [INFO] --- maven-plugin-plugin:3.2:addPluginArtifactMetadata
> > (default-addPluginArtifactMetadata) @ idfc-proguard-maven-plugin ---
> > [INFO] [INFO] [INFO] [INFO] --- maven-gpg-plugin:1.1:sign
> > (sign-artifacts) @ idfc-proguard-maven-plugin --- [INFO] [INFO]
> > ----------------------------------------------------------------------
> > --
> > [INFO] [INFO] BUILD FAILURE
> > [INFO] [INFO]
> > ----------------------------------------------------------------------
> > --
> > [INFO] [INFO] Total time: 2.984s
> > [INFO] [INFO] Finished at: Wed Jul 17 17:57:58 EDT 2013 [INFO] [INFO]
> > Final Memory: 13M/32M [INFO] [INFO]
> > ----------------------------------------------------------------------
> > --
> > [INFO] [ERROR] Failed to execute goal
> > org.apache.maven.plugins:maven-gpg-plugin:1.1:sign (sign-artifacts) on
> > project idfc-proguard-maven-plugin: Cannot obtain passphrase in batch
> > mode
> > -> [Help 1]
> > [INFO] [ERROR]
> > [INFO] [ERROR] To see the full stack trace of the errors, re-run Maven
> > with the -e switch.
> > [INFO] [ERROR] Re-run Maven using the -X switch to enable full debug
> > logging.
> > [INFO] [ERROR]
> > [INFO] [ERROR] For more information about the errors and possible
> > solutions, please read the following articles:
> > [INFO] [ERROR] [Help 1]
> > http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
> > [INFO]
> > ----------------------------------------------------------------------
> > --
> > [INFO] BUILD FAILURE
> > [INFO]
> > ----------------------------------------------------------------------
> > --
> > [INFO] Total time: 4.891s
> > [INFO] Finished at: Wed Jul 17 17:57:58 EDT 2013 [INFO] Final Memory:
> > 8M/19M [INFO]
> > ----------------------------------------------------------------------
> > --
> > [ERROR] Failed to execute goal
> > org.apache.maven.plugins:maven-release-plugin:2.0:prepare
> > (default-cli) on project idfc-proguard-maven-plugin: Maven execution
> failed, exit code: '1'
> > -> [Help 1]
> > [ERROR]
> > [ERROR] To see the full stack trace of the errors, re-run Maven with
> > the -e switch.
> > [ERROR] Re-run Maven using the -X switch to enable full debug logging.
> > [ERROR]
> > [ERROR] For more information about the errors and possible solutions,
> > please read the following articles:
> > [ERROR] [Help 1]
> > http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionExceptio
> > n
> >
> >
> > Thanks for any help!
> >
> > -Richard
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message