diff options
author | Olivier Lamy <olamy@apache.org> | 2011-08-16 13:51:48 +0000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2011-08-16 13:51:48 +0000 |
commit | eceef0131910f6b5b684c9d104188be29e18e380 (patch) | |
tree | 1fc4c2a44e1f02ade6ed60685ac03636435cfeb3 /archiva-modules | |
parent | b39ba2f6c511c85032a2f62f559edf0393a6ca05 (diff) | |
download | archiva-eceef0131910f6b5b684c9d104188be29e18e380.tar.gz archiva-eceef0131910f6b5b684c9d104188be29e18e380.zip |
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
Diffstat (limited to 'archiva-modules')
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 @@ <logger name="org.apache.archiva.indexer.search.NexusRepositorySearch"> <level value="debug"/> </logger> + <logger name="org.apache.archiva.common.plexusbridge.MavenIndexerUtils"> + <level value="debug"/> + </logger> + <logger name="JPOX"> + <level value="error"/> + </logger> + <logger name="org.apache.commons.configuration.DefaultConfigurationBuilder"> <level value="error"/> </logger> |