archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nico...@apache.org
Subject svn commit: r645962 - in /archiva/branches/archiva-1.0.x/archiva-base/archiva-repository-layer/src: main/java/org/apache/maven/archiva/repository/content/ test/java/org/apache/maven/archiva/repository/content/
Date Tue, 08 Apr 2008 14:59:41 GMT
Author: nicolas
Date: Tue Apr  8 07:59:37 2008
New Revision: 645962

URL: http://svn.apache.org/viewvc?rev=645962&view=rev
Log:
MRM-768 : use a distinct "type" for maven1 and maven2 plugins to avoid conflicts when M2 plugins
are stored in M1 repo

Modified:
    archiva/branches/archiva-1.0.x/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/AbstractLegacyRepositoryContent.java
    archiva/branches/archiva-1.0.x/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/ArtifactExtensionMapping.java
    archiva/branches/archiva-1.0.x/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/LegacyPathParser.java
    archiva/branches/archiva-1.0.x/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/AbstractLegacyRepositoryContentTestCase.java
    archiva/branches/archiva-1.0.x/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/LegacyPathParserTest.java

Modified: archiva/branches/archiva-1.0.x/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/AbstractLegacyRepositoryContent.java
URL: http://svn.apache.org/viewvc/archiva/branches/archiva-1.0.x/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/AbstractLegacyRepositoryContent.java?rev=645962&r1=645961&r2=645962&view=diff
==============================================================================
--- archiva/branches/archiva-1.0.x/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/AbstractLegacyRepositoryContent.java
(original)
+++ archiva/branches/archiva-1.0.x/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/AbstractLegacyRepositoryContent.java
Tue Apr  8 07:59:37 2008
@@ -43,7 +43,8 @@
     {
         typeToDirectoryMap = new HashMap<String, String>();
         typeToDirectoryMap.put( "ejb-client", "ejb" );
-        typeToDirectoryMap.put( ArtifactExtensionMapping.MAVEN_PLUGIN, "plugin" );
+        typeToDirectoryMap.put( ArtifactExtensionMapping.MAVEN_PLUGIN, "maven-plugin" );
+        typeToDirectoryMap.put( ArtifactExtensionMapping.MAVEN_ONE_PLUGIN, "plugin" );
         typeToDirectoryMap.put( "distribution-tgz", "distribution" );
         typeToDirectoryMap.put( "distribution-zip", "distribution" );
         typeToDirectoryMap.put( "javadoc", "javadoc.jar" );

Modified: archiva/branches/archiva-1.0.x/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/ArtifactExtensionMapping.java
URL: http://svn.apache.org/viewvc/archiva/branches/archiva-1.0.x/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/ArtifactExtensionMapping.java?rev=645962&r1=645961&r2=645962&view=diff
==============================================================================
--- archiva/branches/archiva-1.0.x/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/ArtifactExtensionMapping.java
(original)
+++ archiva/branches/archiva-1.0.x/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/ArtifactExtensionMapping.java
Tue Apr  8 07:59:37 2008
@@ -34,6 +34,8 @@
     public static final String MAVEN_ARCHETYPE = "maven-archetype";
 
     public static final String MAVEN_PLUGIN = "maven-plugin";
+	
+	public static final String MAVEN_ONE_PLUGIN = "maven-one-plugin";
 
     private static final Map<String, String> typeToExtensionMap;
 
@@ -52,6 +54,7 @@
         typeToExtensionMap.put( "aspect", "jar" );
         typeToExtensionMap.put( "uberjar", "jar" );
         typeToExtensionMap.put( MAVEN_PLUGIN, "jar" );
+        typeToExtensionMap.put( MAVEN_ONE_PLUGIN, "jar" );
         typeToExtensionMap.put( MAVEN_ARCHETYPE, "jar" );
     }
 

Modified: archiva/branches/archiva-1.0.x/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/LegacyPathParser.java
URL: http://svn.apache.org/viewvc/archiva/branches/archiva-1.0.x/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/LegacyPathParser.java?rev=645962&r1=645961&r2=645962&view=diff
==============================================================================
--- archiva/branches/archiva-1.0.x/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/LegacyPathParser.java
(original)
+++ archiva/branches/archiva-1.0.x/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/LegacyPathParser.java
Tue Apr  8 07:59:37 2008
@@ -191,7 +191,7 @@
         // Special Case with Maven Plugins
         if ( StringUtils.equals( "jar", extension ) && StringUtils.equals( "plugins",
expectedType ) )
         {
-            artifact.setType( ArtifactExtensionMapping.MAVEN_PLUGIN );
+            artifact.setType( ArtifactExtensionMapping.MAVEN_ONE_PLUGIN );
         }
         else
         {

Modified: archiva/branches/archiva-1.0.x/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/AbstractLegacyRepositoryContentTestCase.java
URL: http://svn.apache.org/viewvc/archiva/branches/archiva-1.0.x/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/AbstractLegacyRepositoryContentTestCase.java?rev=645962&r1=645961&r2=645962&view=diff
==============================================================================
--- archiva/branches/archiva-1.0.x/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/AbstractLegacyRepositoryContentTestCase.java
(original)
+++ archiva/branches/archiva-1.0.x/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/AbstractLegacyRepositoryContentTestCase.java
Tue Apr  8 07:59:37 2008
@@ -271,7 +271,7 @@
         String groupId = "maven";
         String artifactId = "maven-test-plugin";
         String version = "1.8.2";
-        String type = "maven-plugin";
+        String type = "maven-one-plugin";
         String path = "maven/plugins/maven-test-plugin-1.8.2.jar";
 
         assertLayout( path, groupId, artifactId, version, null, type );
@@ -286,7 +286,7 @@
         String groupId = "avalon-meta";
         String artifactId = "avalon-meta-plugin";
         String version = "1.1";
-        String type = "maven-plugin";
+        String type = "maven-one-plugin";
         String path = "avalon-meta/plugins/avalon-meta-plugin-1.1.jar";
 
         assertLayout( path, groupId, artifactId, version, null, type );
@@ -301,7 +301,7 @@
         String groupId = "cactus";
         String artifactId = "cactus-maven";
         String version = "1.7dev-20040815";
-        String type = "maven-plugin";
+        String type = "maven-one-plugin";
         String path = "cactus/plugins/cactus-maven-1.7dev-20040815.jar";
 
         assertLayout( path, groupId, artifactId, version, null, type );
@@ -316,12 +316,28 @@
         String groupId = "geronimo";
         String artifactId = "geronimo-packaging-plugin";
         String version = "1.0.1";
-        String type = "maven-plugin";
+        String type = "maven-one-plugin";
         String path = "geronimo/plugins/geronimo-packaging-plugin-1.0.1.jar";
 
         assertLayout( path, groupId, artifactId, version, null, type );
     }
 
+	/**
+	 * [MRM-768] Artifact type "maven-plugin" does not distinguish maven1 and maven2 plugins.

+	 * This produces conflicts when m2 plugins are stored in legacy-layout repository
+	 */
+	public void testMaven1Maven2PluginTypeDistinc()
+	    throws Exception
+    {
+        String groupId = "com.sun.tools.xjc.maven2";
+        String artifactId = "maven-jaxb-plugin";
+        String version = "1.1";
+        String type = "maven-plugin";
+        String path = "com.sun.tools.xjc.maven2/maven-plugins/maven-jaxb-plugin-1.1.jar";
+
+        assertLayout( path, groupId, artifactId, version, null, type );
+	}
+	
     /**
      * Perform a roundtrip through the layout routines to determine success.
      * @param classifier TODO

Modified: archiva/branches/archiva-1.0.x/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/LegacyPathParserTest.java
URL: http://svn.apache.org/viewvc/archiva/branches/archiva-1.0.x/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/LegacyPathParserTest.java?rev=645962&r1=645961&r2=645962&view=diff
==============================================================================
--- archiva/branches/archiva-1.0.x/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/LegacyPathParserTest.java
(original)
+++ archiva/branches/archiva-1.0.x/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/LegacyPathParserTest.java
Tue Apr  8 07:59:37 2008
@@ -340,7 +340,7 @@
         String groupId = "maven";
         String artifactId = "maven-test-plugin";
         String version = "1.8.2";
-        String type = "maven-plugin";
+        String type = "maven-one-plugin";
         String path = "maven/plugins/maven-test-plugin-1.8.2.jar";
 
         assertLayout( path, groupId, artifactId, version, null, type );
@@ -355,7 +355,7 @@
         String groupId = "avalon-meta";
         String artifactId = "avalon-meta-plugin";
         String version = "1.1";
-        String type = "maven-plugin";
+        String type = "maven-one-plugin";
         String path = "avalon-meta/plugins/avalon-meta-plugin-1.1.jar";
 
         assertLayout( path, groupId, artifactId, version, null, type );
@@ -370,7 +370,7 @@
         String groupId = "cactus";
         String artifactId = "cactus-maven";
         String version = "1.7dev-20040815";
-        String type = "maven-plugin";
+        String type = "maven-one-plugin";
         String path = "cactus/plugins/cactus-maven-1.7dev-20040815.jar";
 
         assertLayout( path, groupId, artifactId, version, null, type );
@@ -385,7 +385,7 @@
         String groupId = "geronimo";
         String artifactId = "geronimo-packaging-plugin";
         String version = "1.0.1";
-        String type = "maven-plugin";
+        String type = "maven-one-plugin";
         String path = "geronimo/plugins/geronimo-packaging-plugin-1.0.1.jar";
 
         assertLayout( path, groupId, artifactId, version, null, type );



Mime
View raw message