diff options
Diffstat (limited to 'archiva-cli/src/main')
3 files changed, 14 insertions, 10 deletions
diff --git a/archiva-cli/src/main/java/org/apache/maven/archiva/cli/AbstractProgressConsumer.java b/archiva-cli/src/main/java/org/apache/maven/archiva/cli/AbstractProgressConsumer.java index 36229c844..6e916fa19 100644 --- a/archiva-cli/src/main/java/org/apache/maven/archiva/cli/AbstractProgressConsumer.java +++ b/archiva-cli/src/main/java/org/apache/maven/archiva/cli/AbstractProgressConsumer.java @@ -19,10 +19,10 @@ package org.apache.maven.archiva.cli; * under the License. */ +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer; import org.apache.maven.archiva.consumers.ConsumerException; import org.apache.maven.archiva.consumers.RepositoryContentConsumer; -import org.apache.maven.archiva.model.ArchivaRepository; /** * AbstractProgressConsumer @@ -36,7 +36,7 @@ public abstract class AbstractProgressConsumer { private int count = 0; - public void beginScan( ArchivaRepository repository ) + public void beginScan( ManagedRepositoryConfiguration repository ) throws ConsumerException { this.count = 0; diff --git a/archiva-cli/src/main/java/org/apache/maven/archiva/cli/ArchivaCli.java b/archiva-cli/src/main/java/org/apache/maven/archiva/cli/ArchivaCli.java index fbbe7593f..f4c358d09 100644 --- a/archiva-cli/src/main/java/org/apache/maven/archiva/cli/ArchivaCli.java +++ b/archiva-cli/src/main/java/org/apache/maven/archiva/cli/ArchivaCli.java @@ -24,13 +24,14 @@ import org.apache.commons.cli.Option; import org.apache.commons.cli.Options; import org.apache.commons.lang.StringUtils; import org.apache.maven.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; import org.apache.maven.archiva.consumers.ConsumerException; import org.apache.maven.archiva.consumers.RepositoryContentConsumer; import org.apache.maven.archiva.converter.RepositoryConversionException; import org.apache.maven.archiva.converter.legacy.LegacyRepositoryConverter; -import org.apache.maven.archiva.model.ArchivaRepository; import org.apache.maven.archiva.model.RepositoryContentStatistics; import org.apache.maven.archiva.repository.RepositoryException; +import org.apache.maven.archiva.repository.scanner.RepositoryScanStatistics; import org.apache.maven.archiva.repository.scanner.RepositoryScanner; import org.codehaus.plexus.PlexusContainer; import org.codehaus.plexus.component.repository.exception.ComponentLookupException; @@ -167,7 +168,10 @@ public class ArchivaCli { String path = cli.getOptionValue( SCAN ); - ArchivaRepository repo = new ArchivaRepository( "cliRepo", "Archiva CLI Provided Repo", "file://" + path ); + ManagedRepositoryConfiguration repo = new ManagedRepositoryConfiguration(); + repo.setId( "cliRepo" ); + repo.setName( "Archiva CLI Provided Repo" ); + repo.setLocation( path ); List knownConsumerList = new ArrayList(); @@ -182,8 +186,8 @@ public class ArchivaCli try { - RepositoryContentStatistics stats = scanner.scan( repo, knownConsumerList, invalidConsumerList, - ignoredContent, RepositoryScanner.FRESH_SCAN ); + RepositoryScanStatistics stats = scanner.scan( repo, knownConsumerList, invalidConsumerList, + ignoredContent, RepositoryScanner.FRESH_SCAN ); System.out.println( "\n" + stats.toDump( repo ) ); } diff --git a/archiva-cli/src/main/java/org/apache/maven/archiva/cli/ProjectReaderConsumer.java b/archiva-cli/src/main/java/org/apache/maven/archiva/cli/ProjectReaderConsumer.java index 537060c06..1a6511270 100644 --- a/archiva-cli/src/main/java/org/apache/maven/archiva/cli/ProjectReaderConsumer.java +++ b/archiva-cli/src/main/java/org/apache/maven/archiva/cli/ProjectReaderConsumer.java @@ -19,10 +19,10 @@ package org.apache.maven.archiva.cli; * under the License. */ +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; import org.apache.maven.archiva.consumers.ConsumerException; import org.apache.maven.archiva.consumers.RepositoryContentConsumer; import org.apache.maven.archiva.model.ArchivaProjectModel; -import org.apache.maven.archiva.model.ArchivaRepository; import org.apache.maven.archiva.repository.project.ProjectModelException; import org.apache.maven.archiva.repository.project.ProjectModelReader; import org.apache.maven.archiva.repository.project.readers.ProjectModel400Reader; @@ -57,7 +57,7 @@ public class ProjectReaderConsumer private ProjectModelReader reader; - private ArchivaRepository repo; + private ManagedRepositoryConfiguration repo; private List includes; @@ -94,7 +94,7 @@ public class ProjectReaderConsumer return includes; } - public void beginScan( ArchivaRepository repository ) + public void beginScan( ManagedRepositoryConfiguration repository ) throws ConsumerException { super.beginScan( repository ); @@ -106,7 +106,7 @@ public class ProjectReaderConsumer { super.processFile( path ); - File pomFile = new File( repo.getUrl().getPath(), path ); + File pomFile = new File( repo.getLocation(), path ); try { ArchivaProjectModel model = reader.read( pomFile ); |