You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by br...@apache.org on 2006/01/04 06:15:31 UTC

svn commit: r365828 - /maven/plugins/trunk/maven-install-plugin/src/main/java/org/apache/maven/plugin/install/InstallMojo.java

Author: brett
Date: Tue Jan  3 21:15:28 2006
New Revision: 365828

URL: http://svn.apache.org/viewcvs?rev=365828&view=rev
Log:
Workaround for no primary artifact to install
PR: MINSTALL-3

Modified:
    maven/plugins/trunk/maven-install-plugin/src/main/java/org/apache/maven/plugin/install/InstallMojo.java

Modified: maven/plugins/trunk/maven-install-plugin/src/main/java/org/apache/maven/plugin/install/InstallMojo.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-install-plugin/src/main/java/org/apache/maven/plugin/install/InstallMojo.java?rev=365828&r1=365827&r2=365828&view=diff
==============================================================================
--- maven/plugins/trunk/maven-install-plugin/src/main/java/org/apache/maven/plugin/install/InstallMojo.java (original)
+++ maven/plugins/trunk/maven-install-plugin/src/main/java/org/apache/maven/plugin/install/InstallMojo.java Tue Jan  3 21:15:28 2006
@@ -96,12 +96,22 @@
             else
             {
                 File file = artifact.getFile();
-                if ( file == null )
+
+                // Here, we have a temporary solution to MINSTALL-3 (isDirectory() is true if it went through compile
+                // but not package). We are designing in a proper solution for Maven 2.1
+                if ( file != null && !file.isDirectory() )
+                {
+                    installer.install( file, artifact, localRepository );
+                }
+                else if ( !attachedArtifacts.isEmpty() )
+                {
+                    getLog().info( "No primary artifact to install, installing attached artifacts instead." );
+                }
+                else
                 {
                     throw new MojoExecutionException(
                         "The packaging for this project did not assign a file to the build artifact" );
                 }
-                installer.install( file, artifact, localRepository );
             }
 
             for ( Iterator i = attachedArtifacts.iterator(); i.hasNext(); )