small hack for packaging maven-plugin in artifact url calculation

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1177073 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2011-09-28 21:37:38 +00:00
parent 6b77912095
commit ddb8a0a595
1 changed files with 11 additions and 2 deletions

View File

@ -468,12 +468,13 @@ public class NexusRepositorySearch
/** /**
* calculate baseUrl without the context and base Archiva Url * calculate baseUrl without the context and base Archiva Url
*
* @param artifactInfo * @param artifactInfo
* @return * @return
*/ */
protected String getBaseUrl( ArtifactInfo artifactInfo ) protected String getBaseUrl( ArtifactInfo artifactInfo )
{ {
StringBuilder sb = new StringBuilder( ); StringBuilder sb = new StringBuilder();
sb.append( '/' ).append( StringUtils.replaceChars( artifactInfo.groupId, '.', '/' ) ); sb.append( '/' ).append( StringUtils.replaceChars( artifactInfo.groupId, '.', '/' ) );
sb.append( '/' ).append( artifactInfo.artifactId ); sb.append( '/' ).append( artifactInfo.artifactId );
@ -484,7 +485,15 @@ public class NexusRepositorySearch
{ {
sb.append( '-' ).append( artifactInfo.classifier ); sb.append( '-' ).append( artifactInfo.classifier );
} }
sb.append( '.' ).append( artifactInfo.packaging ); // maven-plugin packaging is a jar
if ( StringUtils.equals( "maven-plugin", artifactInfo.packaging ) )
{
sb.append( "jar" );
}
else
{
sb.append( '.' ).append( artifactInfo.packaging );
}
return sb.toString(); return sb.toString();
} }