You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ar...@apache.org on 2005/12/15 02:57:34 UTC

svn commit: r356969 - /maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployFileMojo.java

Author: aramirez
Date: Wed Dec 14 17:57:11 2005
New Revision: 356969

URL: http://svn.apache.org/viewcvs?rev=356969&view=rev
Log:
PR: MNG-1837
Submitted by: Dan Tran
Reviewed by: Allan Ramirez

Added throw of exception when the artifact is not found.

Modified:
    maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployFileMojo.java

Modified: maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployFileMojo.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployFileMojo.java?rev=356969&r1=356968&r2=356969&view=diff
==============================================================================
--- maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployFileMojo.java (original)
+++ maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployFileMojo.java Wed Dec 14 17:57:11 2005
@@ -172,19 +172,12 @@
                 artifact.addMetadata( metadata );
             }
 
-            // Upload the artifact with this file
-            if ( file == null )
+            if ( ! file.exists() )
             {
-                throw new MojoExecutionException(
-                   "The packaging for this project did not assign a file to the build artifact" );
-            }
-            else
-            {
-                if ( file.exists() )
-                {
-                    getDeployer().deploy( file, artifact, deploymentRepository, getLocalRepository() );
-                }
+                throw new MojoExecutionException( file.getPath() + " not found." );
             }
+            
+            getDeployer().deploy( file, artifact, deploymentRepository, getLocalRepository() );
         }
         catch ( ArtifactDeploymentException e )
         {