Return-Path: X-Original-To: apmail-maven-commits-archive@www.apache.org Delivered-To: apmail-maven-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 709D210D62 for ; Mon, 9 Sep 2013 20:03:11 +0000 (UTC) Received: (qmail 92263 invoked by uid 500); 9 Sep 2013 20:03:10 -0000 Delivered-To: apmail-maven-commits-archive@maven.apache.org Received: (qmail 92213 invoked by uid 500); 9 Sep 2013 20:03:10 -0000 Mailing-List: contact commits-help@maven.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@maven.apache.org Delivered-To: mailing list commits@maven.apache.org Received: (qmail 92206 invoked by uid 99); 9 Sep 2013 20:03:10 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Sep 2013 20:03:10 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Sep 2013 20:03:07 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id CE4C82388C32 for ; Mon, 9 Sep 2013 20:01:53 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r877833 [17/17] - in /websites/production/maven/content/plugins/maven-install-plugin: ./ apidocs/ apidocs/class-use/ apidocs/org/apache/maven/plugin/install/ apidocs/org/apache/maven/plugin/install/class-use/ cobertura/ examples/ testapidoc... Date: Mon, 09 Sep 2013 20:01:47 -0000 To: commits@maven.apache.org From: rfscholte@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20130909200153.CE4C82388C32@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Modified: websites/production/maven/content/plugins/maven-install-plugin/xref/org/apache/maven/plugin/install/InstallMojo.html ============================================================================== --- websites/production/maven/content/plugins/maven-install-plugin/xref/org/apache/maven/plugin/install/InstallMojo.html (original) +++ websites/production/maven/content/plugins/maven-install-plugin/xref/org/apache/maven/plugin/install/InstallMojo.html Mon Sep 9 20:01:45 2013 @@ -29,146 +29,203 @@ 19 * under the License. 20 */ 21 -22 import org.apache.maven.artifact.Artifact; -23 import org.apache.maven.artifact.installer.ArtifactInstallationException; -24 import org.apache.maven.artifact.metadata.ArtifactMetadata; -25 import org.apache.maven.plugin.MojoExecutionException; -26 import org.apache.maven.plugins.annotations.LifecyclePhase; -27 import org.apache.maven.plugins.annotations.Mojo; -28 import org.apache.maven.plugins.annotations.Parameter; -29 import org.apache.maven.project.artifact.ProjectArtifactMetadata; -30 -31 import java.io.File; -32 import java.util.Collection; -33 import java.util.Iterator; -34 import java.util.LinkedHashSet; -35 import java.util.List; -36 -37 /** -38 * Installs the project's main artifact, and any other artifacts attached by other plugins in the lifecycle, to the local repository. -39 * -40 * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a> -41 * @version $Id: InstallMojo.java 1358784 2012-07-08 17:08:57Z olamy $ -42 */ -43 @Mojo( name = "install", defaultPhase = LifecyclePhase.INSTALL, threadSafe = true ) -44 public class InstallMojo -45 extends AbstractInstallMojo -46 { -47 /** -48 */ -49 @Parameter( defaultValue = "${project.packaging}", required = true, readonly = true ) -50 protected String packaging; -51 -52 /** -53 */ -54 @Parameter( defaultValue = "${project.file}", required = true, readonly = true ) -55 private File pomFile; -56 -57 /** -58 * Set this to <code>true</code> to bypass artifact installation. -59 * Use this for artifacts that does not need to be installed in the local repository. -60 * -61 * @since 2.4 -62 */ -63 @Parameter( property = "maven.install.skip", defaultValue = "false", required = true ) -64 private boolean skip; -65 -66 /** -67 */ -68 @Parameter( defaultValue = "${project.artifact}", required = true, readonly = true ) -69 private Artifact artifact; -70 -71 /** -72 */ -73 @Parameter( defaultValue = "${project.attachedArtifacts}", required = true, readonly = true ) -74 private List attachedArtifacts; -75 -76 public void execute() -77 throws MojoExecutionException -78 { -79 if ( skip ) -80 { -81 getLog().info( "Skipping artifact installation" ); -82 return; -83 } -84 -85 // TODO: push into transformation -86 boolean isPomArtifact = "pom".equals( packaging ); -87 -88 ArtifactMetadata metadata = null; -89 -90 if ( updateReleaseInfo ) -91 { -92 artifact.setRelease( true ); -93 } +22 import java.io.File; +23 import java.util.Collection; +24 import java.util.LinkedHashSet; +25 import java.util.List; +26 +27 import org.apache.maven.artifact.Artifact; +28 import org.apache.maven.artifact.installer.ArtifactInstallationException; +29 import org.apache.maven.artifact.metadata.ArtifactMetadata; +30 import org.apache.maven.plugin.MojoExecutionException; +31 import org.apache.maven.plugins.annotations.Component; +32 import org.apache.maven.plugins.annotations.LifecyclePhase; +33 import org.apache.maven.plugins.annotations.Mojo; +34 import org.apache.maven.plugins.annotations.Parameter; +35 import org.apache.maven.project.MavenProject; +36 import org.apache.maven.project.artifact.ProjectArtifactMetadata; +37 +38 /** +39 * Installs the project's main artifact, and any other artifacts attached by other plugins in the lifecycle, +40 * to the local repository. +41 * +42 * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a> +43 * @version $Id: InstallMojo.java 1520404 2013-09-05 19:54:18Z rfscholte $ +44 */ +45 @Mojo( name = "install", defaultPhase = LifecyclePhase.INSTALL, threadSafe = true ) +46 public class InstallMojo +47 extends AbstractInstallMojo +48 { +49 +50 /** +51 */ +52 @Component +53 private MavenProject project; +54 +55 @SuppressWarnings( "MismatchedQueryAndUpdateOfCollection" ) +56 @Parameter( defaultValue = "${reactorProjects}", required = true, readonly = true ) +57 private List<MavenProject> reactorProjects; +58 +59 /** +60 * Whether every project should be deployed during its own deploy-phase or at the end of the multimodule build. +61 * If set to {@code true} and the build fails, none of the reactor projects is deployed +62 * +63 * @since 2.5 +64 */ +65 @Parameter( defaultValue = "false", property = "installAtEnd" ) +66 private boolean installAtEnd; +67 +68 /** +69 * @deprecated either use project.getPackaging() or reactorProjects.get(i).getPackaging() +70 */ +71 @Parameter( defaultValue = "${project.packaging}", required = true, readonly = true ) +72 protected String packaging; +73 +74 /** +75 * @deprecated either use project.getFile() or reactorProjects.get(i).getFile() +76 */ +77 @Parameter( defaultValue = "${project.file}", required = true, readonly = true ) +78 private File pomFile; +79 +80 /** +81 * Set this to <code>true</code> to bypass artifact installation. +82 * Use this for artifacts that does not need to be installed in the local repository. +83 * +84 * @since 2.4 +85 */ +86 @Parameter( property = "maven.install.skip", defaultValue = "false" ) +87 private boolean skip; +88 +89 /** +90 * @deprecated either use project.getArtifact() or reactorProjects.get(i).getArtifact() +91 */ +92 @Parameter( defaultValue = "${project.artifact}", required = true, readonly = true ) +93 private Artifact artifact; 94 -95 try -96 { -97 Collection metadataFiles = new LinkedHashSet(); -98 -99 if ( isPomArtifact ) -100 { -101 installer.install( pomFile, artifact, localRepository ); -102 installChecksums( artifact, metadataFiles ); -103 } -104 else -105 { -106 metadata = new ProjectArtifactMetadata( artifact, pomFile ); -107 artifact.addMetadata( metadata ); -108 -109 File file = artifact.getFile(); -110 -111 // Here, we have a temporary solution to MINSTALL-3 (isDirectory() is true if it went through compile -112 // but not package). We are designing in a proper solution for Maven 2.1 -113 if ( file != null && file.isFile() ) -114 { -115 installer.install( file, artifact, localRepository ); -116 installChecksums( artifact, metadataFiles ); -117 } -118 else if ( !attachedArtifacts.isEmpty() ) -119 { -120 getLog().info( "No primary artifact to install, installing attached artifacts instead." ); -121 -122 Artifact pomArtifact = -123 artifactFactory.createProjectArtifact( artifact.getGroupId(), artifact.getArtifactId(), -124 artifact.getBaseVersion() ); -125 pomArtifact.setFile( pomFile ); -126 if ( updateReleaseInfo ) -127 { -128 pomArtifact.setRelease( true ); -129 } -130 -131 installer.install( pomFile, pomArtifact, localRepository ); -132 installChecksums( pomArtifact, metadataFiles ); -133 } -134 else -135 { -136 throw new MojoExecutionException( -137 "The packaging for this project did not assign a file to the build artifact" ); -138 } -139 } -140 -141 for ( Iterator i = attachedArtifacts.iterator(); i.hasNext(); ) -142 { -143 Artifact attached = (Artifact) i.next(); +95 /** +96 * @deprecated either use project.getAttachedArtifacts() or reactorProjects.get(i).getAttachedArtifacts() +97 */ +98 @Parameter( defaultValue = "${project.attachedArtifacts}", required = true, readonly = true ) +99 private List<Artifact> attachedArtifacts; +100 +101 public void execute() +102 throws MojoExecutionException +103 { +104 if ( skip ) +105 { +106 getLog().info( "Skipping artifact installation" ); +107 return; +108 } +109 +110 if ( !installAtEnd ) +111 { +112 installProject( project ); +113 } +114 else +115 { +116 MavenProject lastProject = reactorProjects.get( reactorProjects.size() - 1 ); +117 if ( lastProject.equals( project ) ) +118 { +119 for ( MavenProject reactorProject : reactorProjects ) +120 { +121 installProject( reactorProject ); +122 } +123 } +124 else +125 { +126 getLog().info( "Installing " + project.getGroupId() + ":" + project.getArtifactId() + ":" +127 + project.getVersion() + " at end" ); +128 } +129 } +130 } +131 +132 private void installProject( MavenProject project ) +133 throws MojoExecutionException +134 { +135 Artifact artifact = project.getArtifact(); +136 String packaging = project.getPackaging(); +137 File pomFile = project.getFile(); +138 @SuppressWarnings( "unchecked" ) List<Artifact> attachedArtifacts = project.getAttachedArtifacts(); +139 +140 // TODO: push into transformation +141 boolean isPomArtifact = "pom".equals( packaging ); +142 +143 ArtifactMetadata metadata; 144 -145 installer.install( attached.getFile(), attached, localRepository ); -146 installChecksums( attached, metadataFiles ); -147 } -148 -149 installChecksums( metadataFiles ); -150 } -151 catch ( ArtifactInstallationException e ) -152 { -153 throw new MojoExecutionException( e.getMessage(), e ); -154 } -155 } -156 -157 public void setSkip( boolean skip ) -158 { -159 this.skip = skip; -160 } -161 } +145 if ( updateReleaseInfo ) +146 { +147 artifact.setRelease( true ); +148 } +149 +150 try +151 { +152 Collection<File> metadataFiles = new LinkedHashSet<File>(); +153 +154 if ( isPomArtifact ) +155 { +156 installer.install( pomFile, artifact, localRepository ); +157 installChecksums( artifact ); +158 addMetaDataFilesForArtifact( artifact, metadataFiles ); +159 } +160 else +161 { +162 metadata = new ProjectArtifactMetadata( artifact, pomFile ); +163 artifact.addMetadata( metadata ); +164 +165 File file = artifact.getFile(); +166 +167 // Here, we have a temporary solution to MINSTALL-3 (isDirectory() is true if it went through compile +168 // but not package). We are designing in a proper solution for Maven 2.1 +169 if ( file != null && file.isFile() ) +170 { +171 installer.install( file, artifact, localRepository ); +172 installChecksums( artifact ); +173 addMetaDataFilesForArtifact( artifact, metadataFiles ); +174 } +175 else if ( !attachedArtifacts.isEmpty() ) +176 { +177 getLog().info( "No primary artifact to install, installing attached artifacts instead." ); +178 +179 Artifact pomArtifact = +180 artifactFactory.createProjectArtifact( artifact.getGroupId(), artifact.getArtifactId(), +181 artifact.getBaseVersion() ); +182 pomArtifact.setFile( pomFile ); +183 if ( updateReleaseInfo ) +184 { +185 pomArtifact.setRelease( true ); +186 } +187 +188 installer.install( pomFile, pomArtifact, localRepository ); +189 installChecksums( pomArtifact ); +190 addMetaDataFilesForArtifact( pomArtifact, metadataFiles ); +191 } +192 else +193 { +194 throw new MojoExecutionException( +195 "The packaging for this project did not assign a file to the build artifact" ); +196 } +197 } +198 +199 for ( Artifact attached : attachedArtifacts ) +200 { +201 installer.install( attached.getFile(), attached, localRepository ); +202 installChecksums( attached ); +203 addMetaDataFilesForArtifact( attached, metadataFiles ); +204 } +205 +206 installChecksums( metadataFiles ); +207 } +208 catch ( ArtifactInstallationException e ) +209 { +210 throw new MojoExecutionException( e.getMessage(), e ); +211 } +212 } +213 +214 public void setSkip( boolean skip ) +215 { +216 this.skip = skip; +217 } +218 }
Modified: websites/production/maven/content/plugins/maven-install-plugin/xref/org/apache/maven/plugin/install/package-frame.html ============================================================================== --- websites/production/maven/content/plugins/maven-install-plugin/xref/org/apache/maven/plugin/install/package-frame.html (original) +++ websites/production/maven/content/plugins/maven-install-plugin/xref/org/apache/maven/plugin/install/package-frame.html Mon Sep 9 20:01:45 2013 @@ -3,7 +3,7 @@ - Maven Install Plugin 2.4 Reference Package org.apache.maven.plugin.install + Apache Maven Install Plugin 2.5 Reference Package org.apache.maven.plugin.install @@ -19,6 +19,12 @@ AbstractInstallMojo
  • + DualDigester +
  • +
  • + HelpMojo +
  • +
  • InstallFileMojo
  • Modified: websites/production/maven/content/plugins/maven-install-plugin/xref/org/apache/maven/plugin/install/package-summary.html ============================================================================== --- websites/production/maven/content/plugins/maven-install-plugin/xref/org/apache/maven/plugin/install/package-summary.html (original) +++ websites/production/maven/content/plugins/maven-install-plugin/xref/org/apache/maven/plugin/install/package-summary.html Mon Sep 9 20:01:45 2013 @@ -3,7 +3,7 @@ - Maven Install Plugin 2.4 Reference Package org.apache.maven.plugin.install + Apache Maven Install Plugin 2.5 Reference Package org.apache.maven.plugin.install @@ -42,6 +42,16 @@ + DualDigester + + + + + HelpMojo + + + + InstallFileMojo Modified: websites/production/maven/content/plugins/maven-install-plugin/xref/overview-frame.html ============================================================================== --- websites/production/maven/content/plugins/maven-install-plugin/xref/overview-frame.html (original) +++ websites/production/maven/content/plugins/maven-install-plugin/xref/overview-frame.html Mon Sep 9 20:01:45 2013 @@ -3,7 +3,7 @@ - Maven Install Plugin 2.4 Reference + Apache Maven Install Plugin 2.5 Reference @@ -16,9 +16,6 @@ Modified: websites/production/maven/content/plugins/maven-install-plugin/xref/overview-summary.html ============================================================================== --- websites/production/maven/content/plugins/maven-install-plugin/xref/overview-summary.html (original) +++ websites/production/maven/content/plugins/maven-install-plugin/xref/overview-summary.html Mon Sep 9 20:01:45 2013 @@ -3,7 +3,7 @@ - Maven Install Plugin 2.4 Reference + Apache Maven Install Plugin 2.5 Reference @@ -24,7 +24,7 @@ -

    Maven Install Plugin 2.4 Reference

    +

    Apache Maven Install Plugin 2.5 Reference

    @@ -35,11 +35,6 @@ - - -
    - (default package) -
    org.apache.maven.plugin.install