aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-cli/src
diff options
context:
space:
mode:
Diffstat (limited to 'archiva-cli/src')
-rw-r--r--archiva-cli/src/main/java/org/apache/maven/archiva/cli/Cli.java12
-rw-r--r--archiva-cli/src/main/java/org/apache/maven/archiva/cli/CliManager.java5
2 files changed, 16 insertions, 1 deletions
diff --git a/archiva-cli/src/main/java/org/apache/maven/archiva/cli/Cli.java b/archiva-cli/src/main/java/org/apache/maven/archiva/cli/Cli.java
index 81f50c46a..57788c4b4 100644
--- a/archiva-cli/src/main/java/org/apache/maven/archiva/cli/Cli.java
+++ b/archiva-cli/src/main/java/org/apache/maven/archiva/cli/Cli.java
@@ -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 )
{
diff --git a/archiva-cli/src/main/java/org/apache/maven/archiva/cli/CliManager.java b/archiva-cli/src/main/java/org/apache/maven/archiva/cli/CliManager.java
index 06120de66..5b4d2b83f 100644
--- a/archiva-cli/src/main/java/org/apache/maven/archiva/cli/CliManager.java
+++ b/archiva-cli/src/main/java/org/apache/maven/archiva/cli/CliManager.java
@@ -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 )