From eceef0131910f6b5b684c9d104188be29e18e380 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Tue, 16 Aug 2011 13:51:48 +0000 Subject: [PATCH] fix typo and use lookup rather than empty constructor for components coming from maven-indexer git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1158274 13f79535-47bb-0310-9956-ffa450edef68 --- .../common/plexusbridge/DigesterUtils.java | 7 ++++++- .../common/plexusbridge/MavenIndexerUtils.java | 17 ++++++++++++----- .../archiva-webapp/src/test/resources/log4j.xml | 7 +++++++ 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/archiva-modules/archiva-base/archiva-plexus-bridge/src/main/java/org/apache/archiva/common/plexusbridge/DigesterUtils.java b/archiva-modules/archiva-base/archiva-plexus-bridge/src/main/java/org/apache/archiva/common/plexusbridge/DigesterUtils.java index a8a72d417..dcb22ef71 100644 --- a/archiva-modules/archiva-base/archiva-plexus-bridge/src/main/java/org/apache/archiva/common/plexusbridge/DigesterUtils.java +++ b/archiva-modules/archiva-base/archiva-plexus-bridge/src/main/java/org/apache/archiva/common/plexusbridge/DigesterUtils.java @@ -52,12 +52,17 @@ public class DigesterUtils { // olamy when the TCL is not a URLClassLoader lookupList fail ! // when using tomcat maven plugin so adding a simple hack - log.warn( "using lookList from sisu plexus failed so build plexus Digesters manually" ); + log.warn( "using lookupList from sisu plexus failed so build plexus Digesters manually" ); allDigesters = Arrays.asList( new Sha1Digester(), new Md5Digester() ); } + if ( allDigesters == null || allDigesters.isEmpty() ) + { + throw new PlexusSisuBridgeException( "no way to initiliaze IndexCreator" ); + } + log.debug( "allIndexCreators {}", allDigesters ); } diff --git a/archiva-modules/archiva-base/archiva-plexus-bridge/src/main/java/org/apache/archiva/common/plexusbridge/MavenIndexerUtils.java b/archiva-modules/archiva-base/archiva-plexus-bridge/src/main/java/org/apache/archiva/common/plexusbridge/MavenIndexerUtils.java index 4992dcf02..2deae9d1f 100644 --- a/archiva-modules/archiva-base/archiva-plexus-bridge/src/main/java/org/apache/archiva/common/plexusbridge/MavenIndexerUtils.java +++ b/archiva-modules/archiva-base/archiva-plexus-bridge/src/main/java/org/apache/archiva/common/plexusbridge/MavenIndexerUtils.java @@ -38,7 +38,7 @@ import java.util.List; * @author Olivier Lamy * @since 1.4 */ -@Service("mavenIndexerUtils") +@Service( "mavenIndexerUtils" ) public class MavenIndexerUtils { @@ -56,15 +56,22 @@ public class MavenIndexerUtils { // olamy when the TCL is not a URLClassLoader lookupList fail ! // when using tomcat maven plugin so adding a simple hack - log.warn( "using lookList from sisu plexus failed so build indexCreator manually" ); + log.warn( "using lookupList from sisu plexus failed so build indexCreator manually" ); allIndexCreators = - Arrays.asList( new OSGIArtifactIndexCreator(), new MavenArchetypeArtifactInfoIndexCreator(), - new MinimalArtifactInfoIndexCreator(), new JarFileContentsIndexCreator(), - new MavenPluginArtifactInfoIndexCreator() ); + Arrays.asList( plexusSisuBridge.lookup( IndexCreator.class, OSGIArtifactIndexCreator.ID ), + plexusSisuBridge.lookup( IndexCreator.class, MavenArchetypeArtifactInfoIndexCreator.ID ), + plexusSisuBridge.lookup( IndexCreator.class, MinimalArtifactInfoIndexCreator.ID ), + plexusSisuBridge.lookup( IndexCreator.class, JarFileContentsIndexCreator.ID ), + plexusSisuBridge.lookup( IndexCreator.class, MavenPluginArtifactInfoIndexCreator.ID ) ); } + if ( allIndexCreators == null || allIndexCreators.isEmpty() ) + { + throw new PlexusSisuBridgeException( "no way to initiliaze IndexCreator" ); + } + log.debug( "allIndexCreators {}", allIndexCreators ); } diff --git a/archiva-modules/archiva-web/archiva-webapp/src/test/resources/log4j.xml b/archiva-modules/archiva-web/archiva-webapp/src/test/resources/log4j.xml index 664d39de0..cbba76e6c 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/test/resources/log4j.xml +++ b/archiva-modules/archiva-web/archiva-webapp/src/test/resources/log4j.xml @@ -33,6 +33,13 @@ + + + + + + +