in maven-artifact/src/main/java/org/apache/maven/artifact/resolver/AbstractArtifactResolutionException.java [209:291]
protected static String constructMissingArtifactMessage( String message, String indentation, String groupId, String artifactId, String version,
String type, String classifier, String downloadUrl, List path )
{
StringBuffer sb = new StringBuffer( message );
if ( !"pom".equals( type ) )
{
if ( downloadUrl != null )
{
sb.append( LS );
sb.append( LS );
sb.append( indentation );
sb.append( "Try downloading the file manually from: " );
sb.append( LS );
sb.append( indentation );
sb.append( " " );
sb.append( downloadUrl );
}
else
{
sb.append( LS );
sb.append( LS );
sb.append( indentation );
sb.append( "Try downloading the file manually from the project website." );
}
sb.append( LS );
sb.append( LS );
sb.append( indentation );
sb.append( "Then, install it using the command: " );
sb.append( LS );
sb.append( indentation );
sb.append( " mvn install:install-file -DgroupId=" );
sb.append( groupId );
sb.append( " -DartifactId=" );
sb.append( artifactId );
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( LS );
// If people want to deploy it
sb.append( LS );
sb.append( indentation );
sb.append( "Alternatively, if you host your own repository you can deploy the file there: " );
sb.append( LS );
sb.append( indentation );
sb.append( " mvn deploy:deploy-file -DgroupId=" );
sb.append( groupId );
sb.append( " -DartifactId=" );
sb.append( artifactId );
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( " -Durl=[url] -DrepositoryId=[id]" );
sb.append( LS );
}
sb.append( constructArtifactPath( path, indentation ) );
sb.append( LS );
return sb.toString();
}