Author: brett Date: Sun May 22 23:43:12 2005 New Revision: 177934 URL: http://svn.apache.org/viewcvs?rev=177934&view=rev Log: PR: MNG-378 Only deploy the release information at the point of release
Modified: maven/components/trunk/m2-bootstrap-all.sh maven/components/trunk/maven-artifact/src/main/java/org/apache/maven/artifact/transform/ReleaseArtifactTransformation.java maven/components/trunk/maven-core-it/it0013/goals.txt maven/components/trunk/maven-core-it/it0015/goals.txt maven/components/trunk/maven-core-it/it0020/goals.txt maven/components/trunk/maven-plugins/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java maven/components/trunk/maven-plugins/maven-install-plugin/src/main/java/org/apache/maven/plugin/install/InstallMojo.java maven/components/trunk/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugin/release/PerformReleaseMojo.java maven/components/trunk/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugin/release/PrepareReleaseMojo.java maven/components/trunk/sandbox/maven-ear-plugin/ (props changed) Modified: maven/components/trunk/m2-bootstrap-all.sh URL: http://svn.apache.org/viewcvs/maven/components/trunk/m2-bootstrap-all.sh?rev=177934&r1=177933&r2=177934&view=diff ============================================================================== --- maven/components/trunk/m2-bootstrap-all.sh (original) +++ maven/components/trunk/m2-bootstrap-all.sh Sun May 22 23:43:12 2005 @@ -50,7 +50,8 @@ echo "-----------------------------------------------------------------------" cd maven-plugins - m2 -e --update-snapshots clean:clean install + # update the release info to ensure these versions get used in the integration tests + m2 -DupdateReleaseInfo=true -e --update-snapshots clean:clean install ret=$?; if [ $ret != 0 ]; then exit $ret; fi ) ret=$?; if [ $ret != 0 ]; then exit $ret; fi Modified: maven/components/trunk/maven-artifact/src/main/java/org/apache/maven/artifact/transform/ReleaseArtifactTransformation.java URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-artifact/src/main/java/org/apache/maven/artifact/transform/ReleaseArtifactTransformation.java?rev=177934&r1=177933&r2=177934&view=diff ============================================================================== --- maven/components/trunk/maven-artifact/src/main/java/org/apache/maven/artifact/transform/ReleaseArtifactTransformation.java (original) +++ maven/components/trunk/maven-artifact/src/main/java/org/apache/maven/artifact/transform/ReleaseArtifactTransformation.java Sun May 22 23:43:12 2005 @@ -61,23 +61,13 @@ public void transformForInstall( Artifact artifact, ArtifactRepository localRepository ) throws ArtifactMetadataRetrievalException { - // TODO: this is implemented like a SNAPSHOT - it should be at release time only when we have that concept - ReleaseArtifactMetadata metadata = new ReleaseArtifactMetadata( artifact ); - - metadata.setVersion( artifact.getVersion() ); - - artifact.addMetadata( metadata ); + // metadata is added at install time } public void transformForDeployment( Artifact artifact, ArtifactRepository remoteRepository ) throws ArtifactMetadataRetrievalException { - // TODO: this is implemented like a SNAPSHOT - it should be at release time only when we have that concept - ReleaseArtifactMetadata metadata = new ReleaseArtifactMetadata( artifact ); - - metadata.setVersion( artifact.getVersion() ); - - artifact.addMetadata( metadata ); + // metadata is added at deploy time } protected VersionArtifactMetadata retrieveFromRemoteRepository( Artifact artifact, Modified: maven/components/trunk/maven-core-it/it0013/goals.txt URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-core-it/it0013/goals.txt?rev=177934&r1=177933&r2=177934&view=diff ============================================================================== --- maven/components/trunk/maven-core-it/it0013/goals.txt (original) +++ maven/components/trunk/maven-core-it/it0013/goals.txt Sun May 22 23:43:12 2005 @@ -1,3 +1,3 @@ -clean:clean +-DupdateReleaseInfo=true install it0013:it0013 Modified: maven/components/trunk/maven-core-it/it0015/goals.txt URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-core-it/it0015/goals.txt?rev=177934&r1=177933&r2=177934&view=diff ============================================================================== --- maven/components/trunk/maven-core-it/it0015/goals.txt (original) +++ maven/components/trunk/maven-core-it/it0015/goals.txt Sun May 22 23:43:12 2005 @@ -1,2 +1,3 @@ +-DupdateReleaseInfo=true install it0015:it0015 Modified: maven/components/trunk/maven-core-it/it0020/goals.txt URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-core-it/it0020/goals.txt?rev=177934&r1=177933&r2=177934&view=diff ============================================================================== --- maven/components/trunk/maven-core-it/it0020/goals.txt (original) +++ maven/components/trunk/maven-core-it/it0020/goals.txt Sun May 22 23:43:12 2005 @@ -1,2 +1,3 @@ +-DupdateReleaseInfo=true install it0020:it0020 Modified: maven/components/trunk/maven-plugins/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-plugins/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java?rev=177934&r1=177933&r2=177934&view=diff ============================================================================== --- maven/components/trunk/maven-plugins/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java (original) +++ maven/components/trunk/maven-plugins/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java Sun May 22 23:43:12 2005 @@ -21,6 +21,7 @@ import org.apache.maven.artifact.deployer.ArtifactDeployer; import org.apache.maven.artifact.deployer.ArtifactDeploymentException; import org.apache.maven.artifact.metadata.ArtifactMetadata; +import org.apache.maven.artifact.metadata.ReleaseArtifactMetadata; import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException; @@ -29,11 +30,11 @@ import java.io.File; /** + * Deploys an artifact to remote repository. * @author <a href="mailto:[EMAIL PROTECTED]">Emmanuel Venisse</a> * @author <a href="mailto:[EMAIL PROTECTED]">John Casey (refactoring only)</a> * @version $Id$ * @goal deploy - * @description deploys an artifact to remote repository */ public class DeployMojo extends AbstractMojo @@ -108,6 +109,11 @@ */ private ArtifactRepository localRepository; + /** + * @parameter expression="${updateReleaseInfo}" + */ + private boolean updateReleaseInfo = false; + public void execute() throws MojoExecutionException { @@ -128,15 +134,22 @@ artifact.addMetadata( metadata ); } + if ( updateReleaseInfo ) + { + ReleaseArtifactMetadata metadata = new ReleaseArtifactMetadata( artifact ); + metadata.setVersion( artifact.getVersion() ); + artifact.addMetadata( metadata ); + } + try { - if ( !isPomArtifact ) + if ( isPomArtifact ) { - deployer.deploy( buildDirectory, finalName, artifact, deploymentRepository, localRepository ); + deployer.deploy( pom, artifact, deploymentRepository, localRepository ); } else { - deployer.deploy( pom, artifact, deploymentRepository, localRepository ); + deployer.deploy( buildDirectory, finalName, artifact, deploymentRepository, localRepository ); } } catch ( ArtifactDeploymentException e ) Modified: maven/components/trunk/maven-plugins/maven-install-plugin/src/main/java/org/apache/maven/plugin/install/InstallMojo.java URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-plugins/maven-install-plugin/src/main/java/org/apache/maven/plugin/install/InstallMojo.java?rev=177934&r1=177933&r2=177934&view=diff ============================================================================== --- maven/components/trunk/maven-plugins/maven-install-plugin/src/main/java/org/apache/maven/plugin/install/InstallMojo.java (original) +++ maven/components/trunk/maven-plugins/maven-install-plugin/src/main/java/org/apache/maven/plugin/install/InstallMojo.java Sun May 22 23:43:12 2005 @@ -20,6 +20,7 @@ import org.apache.maven.artifact.DefaultArtifact; import org.apache.maven.artifact.installer.ArtifactInstallationException; import org.apache.maven.artifact.metadata.ArtifactMetadata; +import org.apache.maven.artifact.metadata.ReleaseArtifactMetadata; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.project.artifact.ProjectArtifactMetadata; @@ -82,6 +83,11 @@ */ private String finalName; + /** + * @parameter expression="${updateReleaseInfo}" + */ + private boolean updateReleaseInfo = false; + public void execute() throws MojoExecutionException { @@ -95,16 +101,23 @@ artifact.addMetadata( metadata ); } + if ( updateReleaseInfo ) + { + ReleaseArtifactMetadata metadata = new ReleaseArtifactMetadata( artifact ); + metadata.setVersion( artifact.getVersion() ); + artifact.addMetadata( metadata ); + } + try { - if ( !isPomArtifact ) + if ( isPomArtifact ) { - // TODO: would be something nice to get back from the project to get the full filename (the OGNL feedback thing) - installer.install( buildDirectory, finalName, artifact, localRepository ); + installer.install( pom, artifact, localRepository ); } else { - installer.install( pom, artifact, localRepository ); + // TODO: would be something nice to get back from the project to get the full filename (the OGNL feedback thing) + installer.install( buildDirectory, finalName, artifact, localRepository ); } } catch ( ArtifactInstallationException e ) Modified: maven/components/trunk/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugin/release/PerformReleaseMojo.java URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugin/release/PerformReleaseMojo.java?rev=177934&r1=177933&r2=177934&view=diff ============================================================================== --- maven/components/trunk/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugin/release/PerformReleaseMojo.java (original) +++ maven/components/trunk/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugin/release/PerformReleaseMojo.java Sun May 22 23:43:12 2005 @@ -66,7 +66,8 @@ throws MojoExecutionException { // TODO: we need to get a reference to the maven component and use that so this - // will work purely in an embedded mode. + // will work purely in an embedded mode. Not sure how to pass the release setting to the plugin in that + // instance though - still via -D, or is there a better way? Commandline cl = new Commandline(); @@ -75,6 +76,8 @@ cl.setWorkingDirectory( workingDirectory ); cl.createArgument().setLine( goals ); + + cl.createArgument().setLine( "-DupdateReleaseInfo=true" ); StreamConsumer consumer = new DefaultConsumer(); Modified: maven/components/trunk/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugin/release/PrepareReleaseMojo.java URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugin/release/PrepareReleaseMojo.java?rev=177934&r1=177933&r2=177934&view=diff ============================================================================== --- maven/components/trunk/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugin/release/PrepareReleaseMojo.java (original) +++ maven/components/trunk/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugin/release/PrepareReleaseMojo.java Sun May 22 23:43:12 2005 @@ -248,6 +248,7 @@ releaseProperties.setProperty( "version", projectVersion ); + // TODO: fix releaseProperties.setProperty( USERNAME, username ); releaseProperties.setProperty( TAG, getTagLabel() ); Propchange: maven/components/trunk/sandbox/maven-ear-plugin/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Sun May 22 23:43:12 2005 @@ -0,0 +1,4 @@ +target +*.iws +*.ipr +*.iml --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]