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
This commit is contained in:
Jason van Zyl 2007-06-05 21:09:39 +00:00
parent d8890819ad
commit 02d3305b8e
1 changed files with 30 additions and 1 deletions

View File

@ -248,7 +248,7 @@ public class AbstractArtifactResolutionException
sb.append( " " ); sb.append( " " );
sb.append( "-Dversion=" ); sb.append( "-Dversion=" );
sb.append( version ); sb.append( version );
//insert classifier only if it was used in the artifact //insert classifier only if it was used in the artifact
if (classifier !=null && !classifier.equals( "" )) if (classifier !=null && !classifier.equals( "" ))
{ {
@ -259,6 +259,35 @@ public class AbstractArtifactResolutionException
sb.append( type ); sb.append( type );
sb.append( " -Dfile=/path/to/file" ); sb.append( " -Dfile=/path/to/file" );
sb.append( LS ); 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 ) ); sb.append( constructArtifactPath( path, indentation ) );