From 02d3305b8ec609717ca93fe65910087de6304550 Mon Sep 17 00:00:00 2001 From: Jason van Zyl Date: Tue, 5 Jun 2007 21:09:39 +0000 Subject: [PATCH] Add better message when artifacts are missing so that people know how to deploy to their own repositories. Suggested by Patrick Lightbody. git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@544634 13f79535-47bb-0310-9956-ffa450edef68 --- .../AbstractArtifactResolutionException.java | 31 ++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/AbstractArtifactResolutionException.java b/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/AbstractArtifactResolutionException.java index a0293d62f6..a1c36d8390 100644 --- a/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/AbstractArtifactResolutionException.java +++ b/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/AbstractArtifactResolutionException.java @@ -248,7 +248,7 @@ public class AbstractArtifactResolutionException sb.append( " " ); sb.append( "-Dversion=" ); sb.append( version ); - + //insert classifier only if it was used in the artifact if (classifier !=null && !classifier.equals( "" )) { @@ -259,6 +259,35 @@ public class AbstractArtifactResolutionException sb.append( type ); sb.append( " -Dfile=/path/to/file" ); sb.append( LS ); + + // If people want to deploy it + + sb.append( "Alternatively, if you host your own repository you can deploy the file there: " ); + sb.append( indentation ); + sb.append( " mvn deploy:deploy-file -DgroupId=" ); + sb.append( groupId ); + sb.append( " -DartifactId=" ); + sb.append( artifactId ); + sb.append( " \\\n"); + sb.append( indentation ); + sb.append( " " ); + sb.append( "-Dversion=" ); + sb.append( version ); + + //insert classifier only if it was used in the artifact + if (classifier !=null && !classifier.equals( "" )) + { + sb.append( " -Dclassifier=" ); + sb.append( classifier ); + } + sb.append( " -Dpackaging=" ); + sb.append( type ); + sb.append( " -Dfile=/path/to/file" ); + sb.append( " \\\n"); + sb.append( indentation ); + sb.append( " " ); + sb.append( " -Durl=[url] -DrepositoryId=[id]" ); + sb.append( LS ); } sb.append( constructArtifactPath( path, indentation ) );