diff --git a/artifact/project.xml b/artifact/project.xml index baae6f0d..b302a06f 100644 --- a/artifact/project.xml +++ b/artifact/project.xml @@ -23,7 +23,7 @@ 3 maven-artifact-plugin Maven Artifact Plugin - 1.9 + 1.9.1-SNAPSHOT Tools to manage artifacts and deployment. *WARNING*: This version of the artifact-plugin requires Maven 1.1. People using Maven 1.0 should NOT use this version of the plugin. Tools to manage artifacts and deployment diff --git a/artifact/src/main/org/apache/maven/artifact/deployer/DefaultArtifactDeployer.java b/artifact/src/main/org/apache/maven/artifact/deployer/DefaultArtifactDeployer.java index c96cb959..fb0b7b17 100644 --- a/artifact/src/main/org/apache/maven/artifact/deployer/DefaultArtifactDeployer.java +++ b/artifact/src/main/org/apache/maven/artifact/deployer/DefaultArtifactDeployer.java @@ -115,14 +115,17 @@ public class DefaultArtifactDeployer implements ArtifactDeployer throws MavenException { Boolean gpgSkip = Boolean.valueOf( (String) project.getContext().getVariable( "maven.artifact.gpg.skip" ) ); - String gpgPassphrase; - try + String gpgPassphrase = null; + if ( !gpgSkip.booleanValue() ) { - gpgPassphrase = getPassphrase( project ); - } - catch ( IOException e ) - { - throw new MavenException( "Error while retreiving the passphrase for gpg", e ); + try + { + gpgPassphrase = getPassphrase( project ); + } + catch ( IOException e ) + { + throw new MavenException( "Error while retreiving the passphrase for gpg", e ); + } } String gpgKeyname = (String) project.getContext().getVariable( "maven.artifact.gpg.keyname" ); Boolean gpgUseagent = @@ -143,13 +146,17 @@ public class DefaultArtifactDeployer implements ArtifactDeployer { File pomFile = PomRewriter.getRewrittenPom( project ); if ( !gpgSkip.booleanValue() ) + { generateSignatureForArtifact( pomFile, gpgPassphrase, gpgUseagent.booleanValue(), gpgKeyname ); + } this.doDeploy( pomFile, project, artifactId, DefaultArtifactDeployer.POM_ARTIFACT_TYPE_HANDLER, version, DefaultArtifactDeployer.POM_TYPE, gpgSkip.booleanValue(), gpgPassphrase, gpgUseagent.booleanValue(), gpgKeyname ); } if ( !gpgSkip.booleanValue() ) + { generateSignatureForArtifact( file, gpgPassphrase, gpgUseagent.booleanValue(), gpgKeyname ); + } this.doDeploy( file, project, artifactId, handler, version, type, gpgSkip.booleanValue(), gpgPassphrase, gpgUseagent.booleanValue(), gpgKeyname ); diff --git a/artifact/xdocs/changes.xml b/artifact/xdocs/changes.xml index dbaef3cd..a48557a4 100644 --- a/artifact/xdocs/changes.xml +++ b/artifact/xdocs/changes.xml @@ -25,6 +25,9 @@ Vincent Massol + + artifact:deploy always asks for passphrase (even if maven.artifact.gpg.skip=true). + Allow to sign artifacts to deploy. Refer to properties documentation to know how to activate it. Upgrade maven-model to version 3.0.2 and use stax reader/parser for the pom to allow to use relative entities.