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
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 )
{
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.
// ----------------------------------------------------------------------------
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 )
import org.apache.maven.archiva.discoverer.DiscovererException;
import java.io.File;
+import java.util.List;
/**
* @author Jason van Zyl
* @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;
}
import org.apache.maven.archiva.discoverer.DiscovererException;
import java.io.File;
+import java.util.List;
/**
* @author Jason van Zyl
public void convertLegacyRepository( File legacyRepositoryDirectory,
File repositoryDirectory,
+ List blacklistedPatterns,
boolean includeSnapshots )
throws RepositoryConversionException, DiscovererException
{
- legacyRepositoryConverter.convertLegacyRepository( legacyRepositoryDirectory, repositoryDirectory,
+ legacyRepositoryConverter.convertLegacyRepository( legacyRepositoryDirectory,
+ repositoryDirectory,
+ blacklistedPatterns,
includeSnapshots );
}
}
Archiva rm = (Archiva) lookup( Archiva.ROLE );
- rm.convertLegacyRepository( legacyRepositoryDirectory, repositoryDirectory, true );
+ rm.convertLegacyRepository( legacyRepositoryDirectory, repositoryDirectory, null, true );
}
}