summaryrefslogtreecommitdiffstats
path: root/archiva-cli
diff options
context:
space:
mode:
authorBrett Porter <brett@apache.org>2008-04-08 01:24:10 +0000
committerBrett Porter <brett@apache.org>2008-04-08 01:24:10 +0000
commitfa4aa397259b5e9a4037c71bdc490d7fb97ec529 (patch)
treeaab81e27d38dade947ae0dd252492116c92f5f09 /archiva-cli
parentd346a91845de094c333c60cda17592038c44729d (diff)
downloadarchiva-fa4aa397259b5e9a4037c71bdc490d7fb97ec529.tar.gz
archiva-fa4aa397259b5e9a4037c71bdc490d7fb97ec529.zip
a couple of workarounds to force "offline" behaviour
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@645751 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-cli')
-rw-r--r--archiva-cli/pom.xml5
-rw-r--r--archiva-cli/src/main/java/org/apache/maven/archiva/cli/ArchivaCli.java38
2 files changed, 26 insertions, 17 deletions
diff --git a/archiva-cli/pom.xml b/archiva-cli/pom.xml
index f2101ed79..ed18c9112 100644
--- a/archiva-cli/pom.xml
+++ b/archiva-cli/pom.xml
@@ -48,6 +48,11 @@
<artifactId>archiva-converter</artifactId>
</dependency>
<dependency>
+ <groupId>org.apache.maven.wagon</groupId>
+ <artifactId>wagon-file</artifactId>
+ <version>1.0-beta-2</version>
+ </dependency>
+ <dependency>
<groupId>com.google.code.cli-parser</groupId>
<artifactId>cli</artifactId>
<version>7</version>
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 c2e98049e..4462dbcb2 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
@@ -19,8 +19,19 @@ package org.apache.maven.archiva.cli;
* under the License.
*/
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
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.InvalidRepositoryContentConsumer;
@@ -31,26 +42,13 @@ import org.apache.maven.archiva.converter.legacy.LegacyRepositoryConverter;
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.apache.maven.artifact.manager.WagonManager;
import org.codehaus.plexus.spring.PlexusClassPathXmlApplicationContext;
import org.codehaus.plexus.spring.PlexusToSpringUtils;
import com.sampullara.cli.Args;
import com.sampullara.cli.Argument;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-
/**
* ArchivaCli
*
@@ -144,8 +142,14 @@ public class ArchivaCli
}
private void doScan( String path, String[] consumers )
- throws ConsumerException
+ throws ConsumerException, MalformedURLException
{
+ // hack around poorly configurable project builder by pointing all repositories back at this location to be self
+ // contained
+ WagonManager wagonManager =
+ (WagonManager) applicationContext.getBean( PlexusToSpringUtils.buildSpringId( WagonManager.class.getName() ) );
+ wagonManager.addMirror( "internal", "*", new File( path ).toURL().toExternalForm() );
+
ManagedRepositoryConfiguration repo = new ManagedRepositoryConfiguration();
repo.setId( "cliRepo" );
repo.setName( "Archiva CLI Provided Repo" );
@@ -218,7 +222,7 @@ public class ArchivaCli
}
}
- @SuppressWarnings("unchecked")
+ @SuppressWarnings( "unchecked" )
private Map<String, KnownRepositoryContentConsumer> getConsumers()
{
return PlexusToSpringUtils.lookupMap( "knownRepositoryContentConsumer", applicationContext );