From 9bf5cb099fdc7e938e728f3964ec53afc163421a Mon Sep 17 00:00:00 2001 From: Brett Porter Date: Thu, 31 Jul 2014 15:12:13 +1000 Subject: fix location of beans --- .../java/org/apache/archiva/cli/ArchivaCli.java | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) (limited to 'archiva-cli/src') diff --git a/archiva-cli/src/main/java/org/apache/archiva/cli/ArchivaCli.java b/archiva-cli/src/main/java/org/apache/archiva/cli/ArchivaCli.java index 4bb426a62..7fc1a2c37 100644 --- a/archiva-cli/src/main/java/org/apache/archiva/cli/ArchivaCli.java +++ b/archiva-cli/src/main/java/org/apache/archiva/cli/ArchivaCli.java @@ -22,8 +22,6 @@ package org.apache.archiva.cli; import com.sampullara.cli.Args; import com.sampullara.cli.Argument; import org.apache.archiva.admin.model.beans.ManagedRepository; -import org.apache.archiva.common.plexusbridge.PlexusSisuBridge; -import org.apache.archiva.common.plexusbridge.PlexusSisuBridgeException; import org.apache.archiva.consumers.ConsumerException; import org.apache.archiva.consumers.InvalidRepositoryContentConsumer; import org.apache.archiva.consumers.KnownRepositoryContentConsumer; @@ -163,7 +161,7 @@ public class ArchivaCli } private void doScan( String path, String[] consumers ) - throws ConsumerException, MalformedURLException, PlexusSisuBridgeException + throws ConsumerException, MalformedURLException { ManagedRepository repo = new ManagedRepository(); repo.setId( "cliRepo" ); @@ -179,7 +177,7 @@ public class ArchivaCli List ignoredContent = new ArrayList<>(); ignoredContent.addAll( Arrays.asList( RepositoryScanner.IGNORABLE_CONTENT ) ); - RepositoryScanner scanner = lookup( RepositoryScanner.class ); + RepositoryScanner scanner = applicationContext.getBean( RepositoryScanner.class ); try { @@ -194,15 +192,8 @@ public class ArchivaCli } } - private T lookup( Class clazz ) - throws PlexusSisuBridgeException - { - PlexusSisuBridge plexusSisuBridge = applicationContext.getBean( PlexusSisuBridge.class ); - return plexusSisuBridge.lookup( clazz ); - } - private List getConsumerList( String[] consumers ) - throws ConsumerException, PlexusSisuBridgeException + throws ConsumerException { List consumerList = new ArrayList<>(); @@ -224,7 +215,6 @@ public class ArchivaCli } private void dumpAvailableConsumers() - throws PlexusSisuBridgeException { Map availableConsumers = getConsumers(); @@ -241,7 +231,6 @@ public class ArchivaCli @SuppressWarnings( "unchecked" ) private Map getConsumers() - throws PlexusSisuBridgeException { Map beans = applicationContext.getBeansOfType( KnownRepositoryContentConsumer.class ); @@ -259,9 +248,9 @@ public class ArchivaCli } private void doConversion( String properties ) - throws IOException, RepositoryConversionException, PlexusSisuBridgeException + throws IOException, RepositoryConversionException { - LegacyRepositoryConverter legacyRepositoryConverter = lookup( LegacyRepositoryConverter.class ); + LegacyRepositoryConverter legacyRepositoryConverter = applicationContext.getBean( LegacyRepositoryConverter.class ); Properties p = new Properties(); -- cgit v1.2.3