From 7fd4c749fb3568f29dc0fbf7f31efd66107bec4f Mon Sep 17 00:00:00 2001 From: Brett Leslie Porter Date: Tue, 4 Oct 2005 02:40:58 +0000 Subject: [PATCH] PR: MNG-653 use the file assigned by the packager for installation/deployment. Error out if that isn't done. git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@293494 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/maven/plugin/deploy/DeployMojo.java | 7 ++++++- .../java/org/apache/maven/plugin/install/InstallMojo.java | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/maven-plugins/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java b/maven-plugins/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java index 08e363467b..f2f60d249a 100644 --- a/maven-plugins/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java +++ b/maven-plugins/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java @@ -139,7 +139,12 @@ public class DeployMojo } else { - File file = new File( buildDirectory, finalName + "." + artifact.getArtifactHandler().getExtension() ); + File file = artifact.getFile(); + if ( file == null ) + { + throw new MojoExecutionException( + "The packaging for this project did not assign a file to the build artifact" ); + } deployer.deploy( file, artifact, deploymentRepository, localRepository ); } diff --git a/maven-plugins/maven-install-plugin/src/main/java/org/apache/maven/plugin/install/InstallMojo.java b/maven-plugins/maven-install-plugin/src/main/java/org/apache/maven/plugin/install/InstallMojo.java index 56ea438bc9..4bcb01e154 100644 --- a/maven-plugins/maven-install-plugin/src/main/java/org/apache/maven/plugin/install/InstallMojo.java +++ b/maven-plugins/maven-install-plugin/src/main/java/org/apache/maven/plugin/install/InstallMojo.java @@ -108,7 +108,12 @@ public class InstallMojo } else { - File file = new File( buildDirectory, finalName + "." + artifact.getArtifactHandler().getExtension() ); + File file = artifact.getFile(); + if ( file == null ) + { + throw new MojoExecutionException( + "The packaging for this project did not assign a file to the build artifact" ); + } installer.install( file, artifact, localRepository ); }