]> source.dussan.org Git - archiva.git/commitdiff
small hack for packaging maven-plugin in artifact url calculation
authorOlivier Lamy <olamy@apache.org>
Wed, 28 Sep 2011 21:37:38 +0000 (21:37 +0000)
committerOlivier Lamy <olamy@apache.org>
Wed, 28 Sep 2011 21:37:38 +0000 (21:37 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1177073 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/NexusRepositorySearch.java

index 957b22627e942323bb32945ea9327f0af8481bcd..a2fef942036f5c9d3bd518c620cc0836e67c9cc3 100644 (file)
@@ -468,12 +468,13 @@ public class NexusRepositorySearch
 
     /**
      * calculate baseUrl without the context and base Archiva Url
+     *
      * @param artifactInfo
      * @return
      */
     protected String getBaseUrl( ArtifactInfo artifactInfo )
     {
-        StringBuilder sb = new StringBuilder( );
+        StringBuilder sb = new StringBuilder();
 
         sb.append( '/' ).append( StringUtils.replaceChars( artifactInfo.groupId, '.', '/' ) );
         sb.append( '/' ).append( artifactInfo.artifactId );
@@ -484,7 +485,15 @@ public class NexusRepositorySearch
         {
             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();
     }