]> source.dussan.org Git - archiva.git/commitdiff
o some files idea missed, 6.0 is buuuuggy
authorJason van Zyl <jvanzyl@apache.org>
Sat, 4 Nov 2006 04:05:09 +0000 (04:05 +0000)
committerJason van Zyl <jvanzyl@apache.org>
Sat, 4 Nov 2006 04:05:09 +0000 (04:05 +0000)
git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@471110 13f79535-47bb-0310-9956-ffa450edef68

archiva-cli/src/main/java/org/apache/maven/archiva/cli/Cli.java
archiva-cli/src/main/java/org/apache/maven/archiva/cli/CliManager.java
archiva-core/src/main/java/org/apache/maven/archiva/Archiva.java
archiva-core/src/main/java/org/apache/maven/archiva/DefaultArchiva.java
archiva-core/src/test/java/org/apache/maven/archiva/ArchivaTest.java

index 81f50c46a458b95376d84601d6e57f907275c497..57788c4b4c142dafa33d09580cc08c848973be97 100644 (file)
@@ -25,12 +25,15 @@ import org.codehaus.classworlds.ClassWorld;
 import org.codehaus.plexus.PlexusContainer;
 import org.codehaus.plexus.DefaultPlexusContainer;
 import org.codehaus.plexus.PlexusContainerException;
+import org.codehaus.plexus.util.StringUtils;
 import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
 
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.File;
 import java.util.Properties;
+import java.util.List;
+import java.util.Arrays;
 
 /**
  * @author jason van zyl
@@ -160,9 +163,16 @@ public class Cli
 
                     System.out.println( "Converting " + oldRepositoryPath + " to " + newRepositoryPath );
 
+                    List blacklistedPatterns = null;
+
+                    if ( cli.hasOption( CliManager.BLACKLISTED_PATTERNS ) )
+                    {
+                        blacklistedPatterns = Arrays.asList( StringUtils.split( cli.getOptionValue( CliManager.BLACKLISTED_PATTERNS ), "," ) );
+                    }
+
                     try
                     {
-                        archiva.convertLegacyRepository( oldRepositoryPath, newRepositoryPath, true );
+                        archiva.convertLegacyRepository( oldRepositoryPath, newRepositoryPath, blacklistedPatterns, true );
                     }
                     catch ( RepositoryConversionException e )
                     {
index 06120de66c00236b055fcb9c77efc81fcaedaa83..5b4d2b83fa70b46fc891d12e175e17e3c7d3c13a 100644 (file)
@@ -23,6 +23,8 @@ public class CliManager
 
     public static final char NEW_REPOSITORY_PATH = 'n';
 
+    public static final char BLACKLISTED_PATTERNS = 'b';
+
     // ----------------------------------------------------------------------------
     // These are standard options that we would want to use for all our projects.
     // ----------------------------------------------------------------------------
@@ -53,6 +55,9 @@ public class CliManager
 
         options.addOption( OptionBuilder.withLongOpt( "new-repo" ).hasArg().withDescription(
             "Path to newly created Maven 2.x repository." ).create( NEW_REPOSITORY_PATH ) );
+
+        options.addOption( OptionBuilder.withLongOpt( "new-repo" ).hasArg().withDescription(
+            "Path to newly created Maven 2.x repository." ).create( BLACKLISTED_PATTERNS  ) );
     }
 
     public CommandLine parse( String[] args )
index 460cad748b7137dc6474ca02036beaf6932c1879..f36b8e706ab8355fadb0ef40932485ba9fe1c1de 100644 (file)
@@ -20,6 +20,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
@@ -39,6 +40,9 @@ public interface Archiva
      * @param repositoryDirectory
      * @throws RepositoryConversionException
      */
-    void convertLegacyRepository( File legacyRepositoryDirectory, File repositoryDirectory, boolean includeSnapshots )
+    void convertLegacyRepository( File legacyRepositoryDirectory,
+                                  File repositoryDirectory,
+                                  List blacklistedPatterns,
+                                  boolean includeSnapshots )
         throws RepositoryConversionException, DiscovererException;
 }
index 59fc606835a2f771142b52b444905c94a9a19214..b50ed39363cbeac254515776e97a5a7cde710c73 100644 (file)
@@ -21,6 +21,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
@@ -37,10 +38,13 @@ public class DefaultArchiva
 
     public void convertLegacyRepository( File legacyRepositoryDirectory,
                                          File repositoryDirectory,
+                                         List blacklistedPatterns,
                                          boolean includeSnapshots )
         throws RepositoryConversionException, DiscovererException
     {
-        legacyRepositoryConverter.convertLegacyRepository( legacyRepositoryDirectory, repositoryDirectory,
+        legacyRepositoryConverter.convertLegacyRepository( legacyRepositoryDirectory,
+                                                           repositoryDirectory,
+                                                           blacklistedPatterns,
                                                            includeSnapshots );
     }
 }
index 9e916dfddc2007ab47298409883d2188e75925e5..111bf92245d5ccb26a5ce00fea1ec2edd04a2918 100644 (file)
@@ -35,6 +35,6 @@ public class ArchivaTest
 
         Archiva rm = (Archiva) lookup( Archiva.ROLE );
 
-        rm.convertLegacyRepository( legacyRepositoryDirectory, repositoryDirectory, true );
+        rm.convertLegacyRepository( legacyRepositoryDirectory, repositoryDirectory, null, true );
     }
 }