diff options
author | Nicolas De Loof <nicolas@apache.org> | 2008-04-08 14:51:30 +0000 |
---|---|---|
committer | Nicolas De Loof <nicolas@apache.org> | 2008-04-08 14:51:30 +0000 |
commit | f4e428ee649b358cbbd6552d5afdcea4c320161e (patch) | |
tree | 378608a798709181a3efb400f4af1c80e3864728 /archiva-modules | |
parent | 66612a985f5fcea7e86af85dd163942cac5db5db (diff) | |
download | archiva-f4e428ee649b358cbbd6552d5afdcea4c320161e.tar.gz archiva-f4e428ee649b358cbbd6552d5afdcea4c320161e.zip |
MRM-768 : use a distinct "type" for maven1 and maven2 plugins to avoid conflicts when M2 plugins are stored in M1 repo
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@645955 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules')
5 files changed, 30 insertions, 10 deletions
diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/AbstractLegacyRepositoryContent.java b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/AbstractLegacyRepositoryContent.java index 018d86e4f..f135d5aad 100644 --- a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/AbstractLegacyRepositoryContent.java +++ b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/AbstractLegacyRepositoryContent.java @@ -43,7 +43,8 @@ public abstract class AbstractLegacyRepositoryContent { 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" ); diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/ArtifactExtensionMapping.java b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/ArtifactExtensionMapping.java index 5c9300b70..e7cd021a8 100644 --- a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/ArtifactExtensionMapping.java +++ b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/ArtifactExtensionMapping.java @@ -34,6 +34,8 @@ public class ArtifactExtensionMapping 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 @@ public class ArtifactExtensionMapping typeToExtensionMap.put( "aspect", "jar" ); typeToExtensionMap.put( "uberjar", "jar" ); typeToExtensionMap.put( MAVEN_PLUGIN, "jar" ); + typeToExtensionMap.put( MAVEN_ONE_PLUGIN, "jar" ); typeToExtensionMap.put( MAVEN_ARCHETYPE, "jar" ); } diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/LegacyPathParser.java b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/LegacyPathParser.java index 0cf3b3997..2d2baa97d 100644 --- a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/LegacyPathParser.java +++ b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/LegacyPathParser.java @@ -191,7 +191,7 @@ public class LegacyPathParser // 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 { diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/AbstractLegacyRepositoryContentTestCase.java b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/AbstractLegacyRepositoryContentTestCase.java index 998eea827..4fddac331 100644 --- a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/AbstractLegacyRepositoryContentTestCase.java +++ b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/AbstractLegacyRepositoryContentTestCase.java @@ -271,7 +271,7 @@ public abstract class AbstractLegacyRepositoryContentTestCase 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 @@ public abstract class AbstractLegacyRepositoryContentTestCase 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 @@ public abstract class AbstractLegacyRepositoryContentTestCase 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 @@ public abstract class AbstractLegacyRepositoryContentTestCase 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 diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/LegacyPathParserTest.java b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/LegacyPathParserTest.java index c86d66ff1..cb1d3544c 100644 --- a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/LegacyPathParserTest.java +++ b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/LegacyPathParserTest.java @@ -340,7 +340,7 @@ public class LegacyPathParserTest 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 @@ public class LegacyPathParserTest 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 @@ public class LegacyPathParserTest 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 @@ public class LegacyPathParserTest 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 ); |