From: Jason van Zyl Date: Sat, 4 Nov 2006 04:00:46 +0000 (+0000) Subject: o allow for blacklisted patterns X-Git-Tag: archiva-0.9-alpha-1~400 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c5c102746cd47f8cfbb67c62be4a06302f07647e;p=archiva.git o allow for blacklisted patterns git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@471109 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/archiva-core/src/main/java/org/apache/maven/archiva/conversion/DefaultLegacyRepositoryConverter.java b/archiva-core/src/main/java/org/apache/maven/archiva/conversion/DefaultLegacyRepositoryConverter.java index 6673f19ec..9720bdb53 100644 --- a/archiva-core/src/main/java/org/apache/maven/archiva/conversion/DefaultLegacyRepositoryConverter.java +++ b/archiva-core/src/main/java/org/apache/maven/archiva/conversion/DefaultLegacyRepositoryConverter.java @@ -63,7 +63,9 @@ public class DefaultLegacyRepositoryConverter */ private ReportGroup reportGroup; - public void convertLegacyRepository( File legacyRepositoryDirectory, File repositoryDirectory, + public void convertLegacyRepository( File legacyRepositoryDirectory, + File repositoryDirectory, + List blacklistedPatterns, boolean includeSnapshots ) throws RepositoryConversionException, DiscovererException { @@ -88,7 +90,7 @@ public class DefaultLegacyRepositoryConverter ArtifactFilter filter = includeSnapshots ? new AcceptAllArtifactFilter() : (ArtifactFilter) new SnapshotArtifactFilter(); - List legacyArtifacts = artifactDiscoverer.discoverArtifacts( legacyRepository, null, filter ); + List legacyArtifacts = artifactDiscoverer.discoverArtifacts( legacyRepository, blacklistedPatterns, filter ); ReportingDatabase reporter; try diff --git a/archiva-core/src/main/java/org/apache/maven/archiva/conversion/LegacyRepositoryConverter.java b/archiva-core/src/main/java/org/apache/maven/archiva/conversion/LegacyRepositoryConverter.java index 17f6864a6..e6e7a90e1 100644 --- a/archiva-core/src/main/java/org/apache/maven/archiva/conversion/LegacyRepositoryConverter.java +++ b/archiva-core/src/main/java/org/apache/maven/archiva/conversion/LegacyRepositoryConverter.java @@ -4,6 +4,7 @@ import org.apache.maven.archiva.converter.RepositoryConversionException; import org.apache.maven.archiva.discoverer.DiscovererException; import java.io.File; +import java.util.List; /** * @author Jason van Zyl @@ -19,7 +20,11 @@ public interface LegacyRepositoryConverter * @param legacyRepositoryDirectory * @param repositoryDirectory * @throws org.apache.maven.archiva.converter.RepositoryConversionException + * */ - void convertLegacyRepository( File legacyRepositoryDirectory, File repositoryDirectory, boolean includeSnapshots ) + void convertLegacyRepository( File legacyRepositoryDirectory, + File repositoryDirectory, + List blacklistedPatterns, + boolean includeSnapshots ) throws RepositoryConversionException, DiscovererException; } diff --git a/archiva-core/src/test/java/org/apache/maven/archiva/ArchivaTest.java b/archiva-core/src/test/java/org/apache/maven/archiva/ArchivaTest.java new file mode 100644 index 000000000..9e916dfdd --- /dev/null +++ b/archiva-core/src/test/java/org/apache/maven/archiva/ArchivaTest.java @@ -0,0 +1,40 @@ +package org.apache.maven.archiva; + +/* + * Copyright 2005-2006 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import org.codehaus.plexus.PlexusTestCase; + +import java.io.File; + +/** + * @author Jason van Zyl + */ +public class ArchivaTest + extends PlexusTestCase +{ + public void testLegacyRepositoryConversion() + throws Exception + { + File legacyRepositoryDirectory = getTestFile( "src/test/maven-1.x-repository" ); + + File repositoryDirectory = getTestFile( "target/maven-2.x-repository" ); + + Archiva rm = (Archiva) lookup( Archiva.ROLE ); + + rm.convertLegacyRepository( legacyRepositoryDirectory, repositoryDirectory, true ); + } +} diff --git a/archiva-core/src/test/java/org/apache/maven/archiva/RepositoryManagerTest.java b/archiva-core/src/test/java/org/apache/maven/archiva/RepositoryManagerTest.java deleted file mode 100644 index 6c2fa03b8..000000000 --- a/archiva-core/src/test/java/org/apache/maven/archiva/RepositoryManagerTest.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.apache.maven.archiva; - -/* - * Copyright 2005-2006 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import org.codehaus.plexus.PlexusTestCase; - -import java.io.File; - -/** - * @author Jason van Zyl - */ -public class RepositoryManagerTest - extends PlexusTestCase -{ - public void testLegacyRepositoryConversion() - throws Exception - { - File legacyRepositoryDirectory = getTestFile( "src/test/maven-1.x-repository" ); - - File repositoryDirectory = getTestFile( "target/maven-2.x-repository" ); - - Archiva rm = (Archiva) lookup( Archiva.ROLE ); - - rm.convertLegacyRepository( legacyRepositoryDirectory, repositoryDirectory, true ); - } -} diff --git a/maven-meeper/src/bin/m1-m2-conversion/archiva-cli-1.0-SNAPSHOT-cli.jar b/maven-meeper/src/bin/m1-m2-conversion/archiva-cli-1.0-SNAPSHOT-cli.jar new file mode 100644 index 000000000..c7598b8a2 Binary files /dev/null and b/maven-meeper/src/bin/m1-m2-conversion/archiva-cli-1.0-SNAPSHOT-cli.jar differ diff --git a/pom.xml b/pom.xml index eed4a0b81..f78633bfb 100644 --- a/pom.xml +++ b/pom.xml @@ -132,6 +132,7 @@ archiva-plexus-application archiva-plexus-runtime archiva-security + archiva-cli