]> source.dussan.org Git - archiva.git/commitdiff
push work started with shaded lucene
authorolivier lamy <olamy@apache.org>
Fri, 7 Jul 2017 07:20:47 +0000 (17:20 +1000)
committerolivier lamy <olamy@apache.org>
Fri, 7 Jul 2017 07:20:47 +0000 (17:20 +1000)
Signed-off-by: olivier lamy <olamy@apache.org>
26 files changed:
archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/consumers/core/AbstractArtifactConsumerTest.java
archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/consumers/core/repository/AbstractRepositoryPurgeTest.java
archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/pom.xml
archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/archiva/consumers/lucene/NexusIndexerConsumer.java
archiva-modules/archiva-base/archiva-indexer/pom.xml
archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/merger/DefaultIndexMerger.java
archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/merger/TemporaryGroupIndexCleaner.java
archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/MavenRepositorySearch.java
archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/NoClassifierArtifactInfoFilter.java
archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/archiva/indexer/search/AbstractMavenRepositorySearch.java
archiva-modules/archiva-base/archiva-plexus-bridge/pom.xml
archiva-modules/archiva-base/archiva-plexus-bridge/src/main/java/org/apache/archiva/common/plexusbridge/MavenIndexerUtils.java
archiva-modules/archiva-base/archiva-plexus-bridge/src/main/resources/META-INF/spring-context.xml
archiva-modules/archiva-base/archiva-proxy-common/src/main/resources/META-INF/spring-context.xml
archiva-modules/archiva-base/archiva-proxy-common/src/test/resources/META-INF/spring-context.xml
archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/AbstractProxyTestCase.java
archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/pom.xml
archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/pom.xml
archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/managed/DefaultManagedRepositoryAdmin.java
archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/resources/META-INF/spring-context.xml
archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/resources/spring-context.xml
archiva-modules/archiva-scheduler/archiva-scheduler-indexing/pom.xml
archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/ArchivaIndexingTaskExecutor.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/utils/MavenIndexerCleaner.java
archiva-modules/archiva-web/archiva-webapp/pom.xml
pom.xml

index 1176bc59c405e48d32c76a937b908679bdf88dfa..715dc684cd0345c001688daf1a9872748751035c 100644 (file)
@@ -56,7 +56,7 @@ public abstract class AbstractArtifactConsumerTest
     ArchivaConfiguration archivaConfiguration;
 
     @Inject
-    protected PlexusSisuBridge plexusSisuBridge;
+    protected NexusIndexer nexusIndexer;
 
 
     @Before
@@ -75,7 +75,6 @@ public abstract class AbstractArtifactConsumerTest
     public void tearDown()
         throws Exception
     {
-        NexusIndexer nexusIndexer = plexusSisuBridge.lookup( NexusIndexer.class );
         for ( IndexingContext indexingContext : nexusIndexer.getIndexingContexts().values() )
         {
             nexusIndexer.removeIndexingContext( indexingContext, false );
index 9412ac73c3df6da28c342de240d4f39fb010eaf8..f517533281131e0de847b72359f9a0c65fbad15f 100644 (file)
@@ -98,7 +98,7 @@ public abstract class AbstractRepositoryPurgeTest
     protected ApplicationContext applicationContext;
 
     @Inject
-    protected PlexusSisuBridge plexusSisuBridge;
+    protected NexusIndexer nexusIndexer;
 
 
     @Before
@@ -132,7 +132,6 @@ public abstract class AbstractRepositoryPurgeTest
     protected void removeMavenIndexes()
         throws Exception
     {
-        NexusIndexer nexusIndexer = plexusSisuBridge.lookup( NexusIndexer.class );
         for ( IndexingContext indexingContext : nexusIndexer.getIndexingContexts().values() )
         {
             nexusIndexer.removeIndexingContext( indexingContext, false );
index e8b970b3e0ef42bc3d5029bfac258e7ef4d8c1b6..208825140478b155cca2799e717e8b0641fce489 100644 (file)
@@ -80,6 +80,7 @@
     <dependency>
       <groupId>org.apache.maven.indexer</groupId>
       <artifactId>indexer-core</artifactId>
+      <classifier>shaded-lucene</classifier>
       <exclusions>
         <exclusion>
           <groupId>org.apache.lucene</groupId>
index aa999bd6fa8b14807c172772ed76a243d048b9bb..c85a8fbea841c3f3315e58f08647f479cfb5cbee 100644 (file)
@@ -88,14 +88,13 @@ public class NexusIndexerConsumer
     public NexusIndexerConsumer(
         @Named( value = "archivaTaskScheduler#indexing" ) ArchivaTaskScheduler<ArtifactIndexingTask> scheduler,
         @Named( value = "archivaConfiguration" ) ArchivaConfiguration configuration, FileTypes filetypes,
-        PlexusSisuBridge plexusSisuBridge, MavenIndexerUtils mavenIndexerUtils,
-        ManagedRepositoryAdmin managedRepositoryAdmin )
-        throws PlexusSisuBridgeException
+        MavenIndexerUtils mavenIndexerUtils,
+        ManagedRepositoryAdmin managedRepositoryAdmin, NexusIndexer nexusIndexer )
     {
         this.configuration = configuration;
         this.filetypes = filetypes;
         this.scheduler = scheduler;
-        this.nexusIndexer = plexusSisuBridge.lookup( NexusIndexer.class );
+        this.nexusIndexer = nexusIndexer;
         this.allIndexCreators = mavenIndexerUtils.getAllIndexCreators();
         this.managedRepositoryAdmin = managedRepositoryAdmin;
     }
index eae5642a951fa8d135ee441cb1011afd1cc865d6..a9f24ef0ee120ba6cef9461f974b671e75901f93 100644 (file)
       <artifactId>spring-context-support</artifactId>
     </dependency>
 
-    <dependency>
-      <groupId>org.apache.lucene</groupId>
-      <artifactId>lucene-core</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.lucene</groupId>
-      <artifactId>lucene-queries</artifactId>
-    </dependency>
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-utils</artifactId>
       <groupId>commons-io</groupId>
       <artifactId>commons-io</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.apache.maven.indexer</groupId>
+      <artifactId>indexer-reader</artifactId>
+    </dependency>
     <dependency>
       <groupId>org.apache.maven.indexer</groupId>
       <artifactId>indexer-core</artifactId>
+      <classifier>shaded-lucene</classifier>
       <exclusions>
         <exclusion>
           <groupId>org.apache.lucene</groupId>
index 225cc78e8a1864efdec0e22e36df757b499d6cd3..663f0b63abef0adae9f4873b11728d6ed80713cc 100644 (file)
@@ -19,7 +19,6 @@ package org.apache.archiva.indexer.merger;
  */
 
 import org.apache.archiva.common.plexusbridge.MavenIndexerUtils;
-import org.apache.archiva.common.plexusbridge.PlexusSisuBridge;
 import org.apache.archiva.common.plexusbridge.PlexusSisuBridgeException;
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.lang.time.StopWatch;
@@ -62,12 +61,12 @@ public class DefaultIndexMerger
     private List<String> runningGroups = new CopyOnWriteArrayList<String>();
 
     @Inject
-    public DefaultIndexMerger( PlexusSisuBridge plexusSisuBridge, MavenIndexerUtils mavenIndexerUtils )
+    public DefaultIndexMerger( NexusIndexer nexusIndexer, IndexPacker indexPacker, MavenIndexerUtils mavenIndexerUtils )
         throws PlexusSisuBridgeException
     {
-        this.indexer = plexusSisuBridge.lookup( NexusIndexer.class );
+        this.indexer = nexusIndexer;
         this.mavenIndexerUtils = mavenIndexerUtils;
-        indexPacker = plexusSisuBridge.lookup( IndexPacker.class, "default" );
+        this.indexPacker = indexPacker;
     }
 
     @Override
@@ -112,7 +111,9 @@ public class DefaultIndexMerger
 
             if ( indexMergerRequest.isPackIndex() )
             {
-                IndexPackingRequest request = new IndexPackingRequest( indexingContext, indexLocation );
+                IndexPackingRequest request = new IndexPackingRequest( indexingContext, //
+                                                                       indexingContext.acquireIndexSearcher().getIndexReader(), //
+                                                                       indexLocation );
                 indexPacker.packIndex( request );
             }
 
index 322d82e06102229539d7e8f833d528d3cfa39601..dc7f5c03a696cb3b96abfde320fee7c402130f90 100644 (file)
@@ -44,10 +44,10 @@ public class TemporaryGroupIndexCleaner
     private NexusIndexer indexer;
 
     @Inject
-    public TemporaryGroupIndexCleaner( PlexusSisuBridge plexusSisuBridge )
+    public TemporaryGroupIndexCleaner( NexusIndexer nexusIndexer )
         throws PlexusSisuBridgeException
     {
-        indexer = plexusSisuBridge.lookup( NexusIndexer.class );
+        this.indexer = nexusIndexer;
     }
 
     // 900000
@@ -55,15 +55,19 @@ public class TemporaryGroupIndexCleaner
     public void cleanTemporaryIndex()
     {
 
-        for ( TemporaryGroupIndex temporaryGroupIndex : indexMerger.getTemporaryGroupIndexes() )
-        {
-            // cleanup files older than the ttl
-            if ( new Date().getTime() - temporaryGroupIndex.getCreationTime() > temporaryGroupIndex.getMergedIndexTtl() )
-            {
-                log.info( "cleanTemporaryIndex for groupId {}", temporaryGroupIndex.getGroupId() );
-                indexMerger.cleanTemporaryGroupIndex( temporaryGroupIndex );
+        indexMerger.getTemporaryGroupIndexes()
+            .stream()
+            .forEach( temporaryGroupIndex ->
+                 {
+                     // cleanup files older than the ttl
+                     if ( new Date().getTime() - temporaryGroupIndex.getCreationTime() >
+                         temporaryGroupIndex.getMergedIndexTtl() )
+                     {
+                         log.info( "cleanTemporaryIndex for groupId {}", temporaryGroupIndex.getGroupId() );
+                         indexMerger.cleanTemporaryGroupIndex( temporaryGroupIndex );
 
-            }
-        }
+                     }
+                 }
+        );
     }
 }
index 848ca78c1ae501ec3d42e47a8c4d6d42aa70ec25..64db78594d227036fd5436f65f9b1cfe48d54513 100644 (file)
@@ -25,15 +25,10 @@ import org.apache.archiva.admin.model.beans.ProxyConnector;
 import org.apache.archiva.admin.model.managed.ManagedRepositoryAdmin;
 import org.apache.archiva.admin.model.proxyconnector.ProxyConnectorAdmin;
 import org.apache.archiva.common.plexusbridge.MavenIndexerUtils;
-import org.apache.archiva.common.plexusbridge.PlexusSisuBridge;
 import org.apache.archiva.common.plexusbridge.PlexusSisuBridgeException;
 import org.apache.archiva.indexer.util.SearchUtil;
 import org.apache.commons.lang.StringUtils;
-import org.apache.lucene.queryParser.ParseException;
-import org.apache.lucene.search.BooleanClause;
-import org.apache.lucene.search.BooleanClause.Occur;
-import org.apache.lucene.search.BooleanQuery;
-import org.apache.lucene.search.Query;
+
 import org.apache.maven.index.ArtifactInfo;
 import org.apache.maven.index.FlatSearchRequest;
 import org.apache.maven.index.FlatSearchResponse;
@@ -48,6 +43,9 @@ import org.apache.maven.index.expr.SearchExpression;
 import org.apache.maven.index.expr.SearchTyped;
 import org.apache.maven.index.expr.SourcedSearchExpression;
 import org.apache.maven.index.expr.UserInputSearchExpression;
+import org.apache.maven.index.shaded.lucene.search.BooleanClause;
+import org.apache.maven.index.shaded.lucene.search.BooleanClause.Occur;
+import org.apache.maven.index.shaded.lucene.search.BooleanQuery;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Service;
@@ -87,12 +85,13 @@ public class MavenRepositorySearch
     }
 
     @Inject
-    public MavenRepositorySearch( PlexusSisuBridge plexusSisuBridge, ManagedRepositoryAdmin managedRepositoryAdmin,
-                                  MavenIndexerUtils mavenIndexerUtils, ProxyConnectorAdmin proxyConnectorAdmin )
+    public MavenRepositorySearch( NexusIndexer nexusIndexer, ManagedRepositoryAdmin managedRepositoryAdmin,
+                                  MavenIndexerUtils mavenIndexerUtils, ProxyConnectorAdmin proxyConnectorAdmin,
+                                  QueryCreator queryCreator)
         throws PlexusSisuBridgeException
     {
-        this.indexer = plexusSisuBridge.lookup( NexusIndexer.class );
-        this.queryCreator = plexusSisuBridge.lookup( QueryCreator.class );
+        this.indexer = nexusIndexer;
+        this.queryCreator = queryCreator;
         this.managedRepositoryAdmin = managedRepositoryAdmin;
         this.mavenIndexerUtils = mavenIndexerUtils;
         this.proxyConnectorAdmin = proxyConnectorAdmin;
@@ -124,12 +123,12 @@ public class MavenRepositorySearch
                 BooleanQuery iQuery = new BooleanQuery();
                 constructQuery( previousTerm, iQuery );
 
-                q.add( iQuery, Occur.MUST );
+                q.add( iQuery, BooleanClause.Occur.MUST );
             }
 
             BooleanQuery iQuery = new BooleanQuery();
             constructQuery( term, iQuery );
-            q.add( iQuery, Occur.MUST );
+            q.add( iQuery, BooleanClause.Occur.MUST );
         }
 
         // we retun only artifacts without classifier in quick search, olamy cannot find a way to say with this field empty
@@ -166,7 +165,7 @@ public class MavenRepositorySearch
             q.add( indexer.constructQuery( MAVEN.GROUP_ID, searchFields.isExactSearch()
                                                ? new SourcedSearchExpression( searchFields.getGroupId() )
                                                : new UserInputSearchExpression( searchFields.getGroupId() )
-                   ), Occur.MUST
+                   ), BooleanClause.Occur.MUST
             );
         }
 
@@ -176,35 +175,35 @@ public class MavenRepositorySearch
                                            searchFields.isExactSearch()
                                                ? new SourcedSearchExpression( searchFields.getArtifactId() )
                                                : new UserInputSearchExpression( searchFields.getArtifactId() )
-                   ), Occur.MUST
+                   ), BooleanClause.Occur.MUST
             );
         }
 
         if ( StringUtils.isNotBlank( searchFields.getVersion() ) )
         {
             q.add( indexer.constructQuery( MAVEN.VERSION, searchFields.isExactSearch() ? new SourcedSearchExpression(
-                searchFields.getVersion() ) : new SourcedSearchExpression( searchFields.getVersion() ) ), Occur.MUST );
+                searchFields.getVersion() ) : new SourcedSearchExpression( searchFields.getVersion() ) ), BooleanClause.Occur.MUST );
         }
 
         if ( StringUtils.isNotBlank( searchFields.getPackaging() ) )
         {
             q.add( indexer.constructQuery( MAVEN.PACKAGING, searchFields.isExactSearch() ? new SourcedSearchExpression(
                        searchFields.getPackaging() ) : new UserInputSearchExpression( searchFields.getPackaging() ) ),
-                   Occur.MUST
+                   BooleanClause.Occur.MUST
             );
         }
 
         if ( StringUtils.isNotBlank( searchFields.getClassName() ) )
         {
             q.add( indexer.constructQuery( MAVEN.CLASSNAMES,
-                                           new UserInputSearchExpression( searchFields.getClassName() ) ), Occur.MUST );
+                                           new UserInputSearchExpression( searchFields.getClassName() ) ), BooleanClause.Occur.MUST );
         }
 
         if ( StringUtils.isNotBlank( searchFields.getBundleSymbolicName() ) )
         {
             q.add( indexer.constructQuery( OSGI.SYMBOLIC_NAME,
                                            new UserInputSearchExpression( searchFields.getBundleSymbolicName() ) ),
-                   Occur.MUST
+                   BooleanClause.Occur.MUST
             );
         }
 
@@ -212,7 +211,7 @@ public class MavenRepositorySearch
         {
             q.add( indexer.constructQuery( OSGI.VERSION,
                                            new UserInputSearchExpression( searchFields.getBundleVersion() ) ),
-                   Occur.MUST
+                   BooleanClause.Occur.MUST
             );
         }
 
@@ -494,12 +493,14 @@ public class MavenRepositorySearch
 
         for ( ArtifactInfo artifactInfo : artifactInfos )
         {
-            if ( StringUtils.equalsIgnoreCase( "pom", artifactInfo.fextension ) && !includePoms )
+            if ( StringUtils.equalsIgnoreCase( "pom", artifactInfo.getFileExtension() ) && !includePoms )
             {
                 continue;
             }
-            String id = SearchUtil.getHitId( artifactInfo.groupId, artifactInfo.artifactId, artifactInfo.classifier,
-                                             artifactInfo.packaging );
+            String id = SearchUtil.getHitId( artifactInfo.getGroupId(), //
+                                             artifactInfo.getArtifactId(), //
+                                             artifactInfo.getClassifier(), //
+                                             artifactInfo.getPackaging() );
             Map<String, SearchResultHit> hitsMap = results.getHitsMap();
 
             if ( !applyArtifactInfoFilters( artifactInfo, artifactInfoFilters, hitsMap ) )
@@ -510,34 +511,34 @@ public class MavenRepositorySearch
             SearchResultHit hit = hitsMap.get( id );
             if ( hit != null )
             {
-                if ( !hit.getVersions().contains( artifactInfo.version ) )
+                if ( !hit.getVersions().contains( artifactInfo.getVersion() ) )
                 {
-                    hit.addVersion( artifactInfo.version );
+                    hit.addVersion( artifactInfo.getVersion() );
                 }
             }
             else
             {
                 hit = new SearchResultHit();
-                hit.setArtifactId( artifactInfo.artifactId );
-                hit.setGroupId( artifactInfo.groupId );
-                hit.setRepositoryId( artifactInfo.repository );
-                hit.addVersion( artifactInfo.version );
-                hit.setBundleExportPackage( artifactInfo.bundleExportPackage );
-                hit.setBundleExportService( artifactInfo.bundleExportService );
-                hit.setBundleSymbolicName( artifactInfo.bundleSymbolicName );
-                hit.setBundleVersion( artifactInfo.bundleVersion );
-                hit.setBundleDescription( artifactInfo.bundleDescription );
-                hit.setBundleDocUrl( artifactInfo.bundleDocUrl );
-                hit.setBundleRequireBundle( artifactInfo.bundleRequireBundle );
-                hit.setBundleImportPackage( artifactInfo.bundleImportPackage );
-                hit.setBundleLicense( artifactInfo.bundleLicense );
-                hit.setBundleName( artifactInfo.bundleName );
-                hit.setContext( artifactInfo.context );
-                hit.setGoals( artifactInfo.goals );
-                hit.setPrefix( artifactInfo.prefix );
-                hit.setPackaging( artifactInfo.packaging );
-                hit.setClassifier( artifactInfo.classifier );
-                hit.setFileExtension( artifactInfo.fextension );
+                hit.setArtifactId( artifactInfo.getArtifactId() );
+                hit.setGroupId( artifactInfo.getGroupId() );
+                hit.setRepositoryId( artifactInfo.getRepository() );
+                hit.addVersion( artifactInfo.getVersion() );
+                hit.setBundleExportPackage( artifactInfo.getBundleExportPackage() );
+                hit.setBundleExportService( artifactInfo.getBundleExportService() );
+                hit.setBundleSymbolicName( artifactInfo.getBundleSymbolicName() );
+                hit.setBundleVersion( artifactInfo.getBundleVersion() );
+                hit.setBundleDescription( artifactInfo.getBundleDescription() );
+                hit.setBundleDocUrl( artifactInfo.getBundleDocUrl() );
+                hit.setBundleRequireBundle( artifactInfo.getBundleRequireBundle() );
+                hit.setBundleImportPackage( artifactInfo.getBundleImportPackage() );
+                hit.setBundleLicense( artifactInfo.getBundleLicense() );
+                hit.setBundleName( artifactInfo.getBundleName() );
+                hit.setContext( artifactInfo.getContext() );
+                hit.setGoals( artifactInfo.getGoals() );
+                hit.setPrefix( artifactInfo.getPrefix() );
+                hit.setPackaging( artifactInfo.getPackaging() );
+                hit.setClassifier( artifactInfo.getClassifier() );
+                hit.setFileExtension( artifactInfo.getFileExtension() );
                 hit.setUrl( getBaseUrl( artifactInfo, selectedRepos ) );
             }
 
@@ -569,40 +570,40 @@ public class MavenRepositorySearch
         throws RepositoryAdminException
     {
         StringBuilder sb = new StringBuilder();
-        if ( StringUtils.startsWith( artifactInfo.context, "remote-" ) )
+        if ( StringUtils.startsWith( artifactInfo.getContext(), "remote-" ) )
         {
             // it's a remote index result we search a managed which proxying this remote and on which
             // current user has read karma
             String managedRepoId =
-                getManagedRepoId( StringUtils.substringAfter( artifactInfo.context, "remote-" ), selectedRepos );
+                getManagedRepoId( StringUtils.substringAfter( artifactInfo.getContext(), "remote-" ), selectedRepos );
             if ( managedRepoId != null )
             {
                 sb.append( '/' ).append( managedRepoId );
-                artifactInfo.context = managedRepoId;
+                artifactInfo.setContext( managedRepoId );
             }
         }
         else
         {
-            sb.append( '/' ).append( artifactInfo.context );
+            sb.append( '/' ).append( artifactInfo.getContext() );
         }
 
-        sb.append( '/' ).append( StringUtils.replaceChars( artifactInfo.groupId, '.', '/' ) );
-        sb.append( '/' ).append( artifactInfo.artifactId );
-        sb.append( '/' ).append( artifactInfo.version );
-        sb.append( '/' ).append( artifactInfo.artifactId );
-        sb.append( '-' ).append( artifactInfo.version );
-        if ( StringUtils.isNotBlank( artifactInfo.classifier ) )
+        sb.append( '/' ).append( StringUtils.replaceChars( artifactInfo.getGroupId(), '.', '/' ) );
+        sb.append( '/' ).append( artifactInfo.getArtifactId() );
+        sb.append( '/' ).append( artifactInfo.getVersion() );
+        sb.append( '/' ).append( artifactInfo.getArtifactId() );
+        sb.append( '-' ).append( artifactInfo.getVersion() );
+        if ( StringUtils.isNotBlank( artifactInfo.getClassifier() ) )
         {
-            sb.append( '-' ).append( artifactInfo.classifier );
+            sb.append( '-' ).append( artifactInfo.getClassifier() );
         }
         // maven-plugin packaging is a jar
-        if ( StringUtils.equals( "maven-plugin", artifactInfo.packaging ) )
+        if ( StringUtils.equals( "maven-plugin", artifactInfo.getPackaging() ) )
         {
             sb.append( "jar" );
         }
         else
         {
-            sb.append( '.' ).append( artifactInfo.packaging );
+            sb.append( '.' ).append( artifactInfo.getPackaging() );
         }
 
         return sb.toString();
index 6068aa72040ec8aee89f4457b738d37f80c6160b..49feb2d811df3e4e3491d97aabaa41031b8d0404 100644 (file)
@@ -38,6 +38,6 @@ public class NoClassifierArtifactInfoFilter
     @Override
     public boolean addArtifactInResult( ArtifactInfo artifact, Map<String, SearchResultHit> currentResult )
     {
-        return StringUtils.isBlank( artifact.classifier );
+        return StringUtils.isBlank( artifact.getClassifier() );
     }
 }
index 461a4d76b720de8647944dcd484811dfa77455f6..58fdf68d51c1810af21cff4904c576d901c932a4 100644 (file)
@@ -35,6 +35,7 @@ import org.apache.maven.index.ArtifactContext;
 import org.apache.maven.index.ArtifactContextProducer;
 import org.apache.maven.index.ArtifactScanningListener;
 import org.apache.maven.index.NexusIndexer;
+import org.apache.maven.index.QueryCreator;
 import org.apache.maven.index.ScanningResult;
 import org.apache.maven.index.context.IndexingContext;
 import org.easymock.EasyMock;
@@ -72,6 +73,7 @@ public abstract class AbstractMavenRepositorySearch
 
     ArchivaConfiguration archivaConfig;
 
+    @Inject
     ArtifactContextProducer artifactContextProducer;
 
     IMocksControl archivaConfigControl;
@@ -84,8 +86,12 @@ public abstract class AbstractMavenRepositorySearch
     @Inject
     MavenIndexerUtils mavenIndexerUtils;
 
+    @Inject
     NexusIndexer nexusIndexer;
 
+    @Inject
+    QueryCreator queryCreator;
+
     @Before
     @Override
     public void setUp()
@@ -109,12 +115,8 @@ public abstract class AbstractMavenRepositorySearch
         DefaultProxyConnectorAdmin defaultProxyConnectorAdmin = new DefaultProxyConnectorAdmin();
         defaultProxyConnectorAdmin.setArchivaConfiguration( archivaConfig );
 
-        search = new MavenRepositorySearch( plexusSisuBridge, defaultManagedRepositoryAdmin, mavenIndexerUtils,
-                                            defaultProxyConnectorAdmin );
-
-        nexusIndexer = plexusSisuBridge.lookup( NexusIndexer.class );
-
-        artifactContextProducer = plexusSisuBridge.lookup( ArtifactContextProducer.class );
+        search = new MavenRepositorySearch( nexusIndexer, defaultManagedRepositoryAdmin, mavenIndexerUtils,
+                                            defaultProxyConnectorAdmin, queryCreator );
 
         defaultManagedRepositoryAdmin.setMavenIndexerUtils( mavenIndexerUtils );
         defaultManagedRepositoryAdmin.setIndexer( nexusIndexer );
@@ -205,8 +207,8 @@ public abstract class AbstractMavenRepositorySearch
                                                    search.getAllIndexCreators() );
 
         // minimize datas in memory
-        context.getIndexWriter().setMaxBufferedDocs( -1 );
-        context.getIndexWriter().setRAMBufferSizeMB( 1 );
+//        context.getIndexWriter().setMaxBufferedDocs( -1 );
+//        context.getIndexWriter().setRAMBufferSizeMB( 1 );
         for ( File artifactFile : filesToBeIndexed )
         {
             assertTrue( "file not exists " + artifactFile.getPath(), artifactFile.exists() );
@@ -214,9 +216,9 @@ public abstract class AbstractMavenRepositorySearch
 
             if ( artifactFile.getPath().endsWith( ".pom" ) )
             {
-                ac.getArtifactInfo().fextension = "pom";
-                ac.getArtifactInfo().packaging = "pom";
-                ac.getArtifactInfo().classifier = "pom";
+                ac.getArtifactInfo().setFileExtension( "pom" );
+                ac.getArtifactInfo().setPackaging( "pom" );
+                ac.getArtifactInfo().setClassifier( "pom" );
             }
             nexusIndexer.addArtifactToIndex( ac, context );
             context.updateTimestamp( true );
index d8b477e3fefc3cddaee7a2231205521d398e47dd..3e85ac5a581d14b1a4f4c5197203bceaebb0ac2c 100644 (file)
     <dependency>
       <groupId>org.apache.maven.indexer</groupId>
       <artifactId>indexer-core</artifactId>
-      <exclusions>
-        <exclusion>
-          <groupId>org.apache.lucene</groupId>
-          <artifactId>lucene-queryparser</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>org.apache.lucene</groupId>
-          <artifactId>lucene-analyzers-common</artifactId>
-        </exclusion>
-      </exclusions>
+      <classifier>shaded-lucene</classifier>
     </dependency>
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
index dc94ad5fec973d41901009395b8892ff7d3fe06d..7f86da4ff9b9c586065270c4316958a891b4093c 100644 (file)
@@ -22,10 +22,15 @@ package org.apache.archiva.common.plexusbridge;
 import org.apache.maven.index.context.IndexCreator;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.springframework.context.ApplicationContext;
 import org.springframework.stereotype.Service;
 
+import javax.annotation.PostConstruct;
 import javax.inject.Inject;
+import javax.inject.Named;
+import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
 
 /**
  * @author Olivier Lamy
@@ -37,11 +42,21 @@ public class MavenIndexerUtils
 
     private Logger log = LoggerFactory.getLogger( getClass() );
 
-    @Inject
     private List<? extends IndexCreator> allIndexCreators;
 
-    public MavenIndexerUtils()
+    private ApplicationContext applicationContext;
+
+    @Inject
+    public MavenIndexerUtils(ApplicationContext applicationContext, Map<String, IndexCreator> indexers)
     {
+        this.applicationContext = applicationContext;
+    }
+
+    @PostConstruct
+    public void initialize()
+    {
+        allIndexCreators = new ArrayList<>( applicationContext.getBeansOfType( IndexCreator.class ).values());
+
         if ( allIndexCreators == null || allIndexCreators.isEmpty() )
         {
             throw new RuntimeException( "cannot initiliaze IndexCreators" );
index cd6acffd90bd6921ee068e7722c28a33d7edb847..9c12ec813bf480f14ee7281c5056a9d2389f8133 100644 (file)
 <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:util="http://www.springframework.org/schema/util"
        xsi:schemaLocation="http://www.springframework.org/schema/beans
-           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+           http://www.springframework.org/schema/beans/spring-beans.xsd
            http://www.springframework.org/schema/context 
-           http://www.springframework.org/schema/context/spring-context-3.0.xsd"
-       default-lazy-init="true">
+           http://www.springframework.org/schema/context/spring-context.xsd
+           http://www.springframework.org/schema/util
+           http://www.springframework.org/schema/util/spring-util.xsd"
+      default-lazy-init="true">
 
   <context:annotation-config/>
-  <context:component-scan base-package="org.apache.archiva.common.plexusbridge,org.apache.maven.index"/>
+  <context:component-scan base-package="org.apache.archiva.common.plexusbridge
+                                        org.apache.maven.index"/>
+
+  <!--
+  <bean id="indexer" class="org.apache.maven.index.DefaultIndexer"/>
+  <bean id="scanner" class="org.apache.maven.index.DefaultScanner"/>
+  <bean id="indexerEngine" class="org.apache.maven.index.DefaultIndexerEngine"/>
+  <bean id="searchEngine" class="org.apache.maven.index.DefaultSearchEngine"/>
+  <bean id="queryCreator" class="org.apache.maven.index.DefaultQueryCreator"/>
+  <bean id="artifactContextProducer" class="org.apache.maven.index.DefaultArtifactContextProducer"/>
+  <bean id="artifactPackagingMapper" class="org.apache.maven.index.artifact.DefaultArtifactPackagingMapper"/>
+  -->
+
+  <!-- Index creators:
+  <bean id="minimalArtifactInfoIndexCreator" class="org.apache.maven.index.creator.MinimalArtifactInfoIndexCreator"/>
+  <bean id="jarFileContentsIndexCreator" class="org.apache.maven.index.creator.JarFileContentsIndexCreator"/>
+  <bean id="mavenPluginArtifactInfoIndexCreator" class="org.apache.maven.index.creator.MavenPluginArtifactInfoIndexCreator"/>
+   -->
+  <!-- Index creators.
+
+  <util:map id="indexers"
+            key-type="java.lang.String"
+            value-type="org.apache.maven.index.context.IndexCreator"
+            map-class="java.util.LinkedHashMap">
+    <entry key="min" value-ref="minimalArtifactInfoIndexCreator"/>
+    <entry key="jarContent" value-ref="jarFileContentsIndexCreator"/>
+    <entry key="maven-plugin" value-ref="mavenPluginArtifactInfoIndexCreator"/>
+  </util:map>
+  -->
 </beans>
\ No newline at end of file
index 217a33d3b3f6f57f2e8bf783aa2f19aa020ef982..7374f3685fc67c5cd5700c86bff68cf3d70f8542 100644 (file)
@@ -22,9 +22,9 @@
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:context="http://www.springframework.org/schema/context"
        xsi:schemaLocation="http://www.springframework.org/schema/beans
-           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+           http://www.springframework.org/schema/beans/spring-beans.xsd
            http://www.springframework.org/schema/context
-           http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+           http://www.springframework.org/schema/context/spring-context.xsd"
        default-lazy-init="true">
 
   <context:annotation-config/>
index c19b3e8678ab1def119f144d3d01158fcc03a287..7afd4a42282f2122610a9354d3ef2984639a08f7 100644 (file)
 
 <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xmlns:context="http://www.springframework.org/schema/context"
        xsi:schemaLocation="http://www.springframework.org/schema/beans
-           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
-           http://www.springframework.org/schema/context
-           http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+           http://www.springframework.org/schema/beans/spring-beans.xsd"
        default-lazy-init="true">
 
   <bean name="wagon#file" scope="prototype" class="org.apache.maven.wagon.providers.file.FileWagon"/>
index 08226d2e8df47f59bcbc7b39ef6b0ed16221dc0b..4d0a9a810fe81685b8ee604df115a90a33c0c818 100644 (file)
@@ -120,7 +120,7 @@ public abstract class AbstractProxyTestCase
     protected ManagedRepositoryAdmin managedRepositoryAdmin;
 
     @Inject
-    protected PlexusSisuBridge plexusSisuBridge;
+    protected NexusIndexer nexusIndexer;
 
     @Before
     public void setUp()
@@ -198,7 +198,6 @@ public abstract class AbstractProxyTestCase
     protected void removeMavenIndexes()
         throws Exception
     {
-        NexusIndexer nexusIndexer = plexusSisuBridge.lookup( NexusIndexer.class );
 
         for ( IndexingContext indexingContext : nexusIndexer.getIndexingContexts().values() )
         {
index d1ca7d768b473f68231d4c831da5bf8a4b9c9382..b7e8ad21a33252a65dee054816600cb4cc6a8489 100644 (file)
@@ -44,6 +44,7 @@
     <dependency>
       <groupId>org.apache.maven.indexer</groupId>
       <artifactId>indexer-core</artifactId>
+      <classifier>shaded-lucene</classifier>
       <exclusions>
         <exclusion>
           <groupId>org.codehaus.plexus</groupId>
index 44a2d7beb5b569ada74581f5c322fb6305cf2eb7..23494f02f178ab2be55e573aa9b3dc59e7936f7d 100644 (file)
@@ -40,6 +40,7 @@
     <dependency>
       <groupId>org.apache.maven.indexer</groupId>
       <artifactId>indexer-core</artifactId>
+      <classifier>shaded-lucene</classifier>
     </dependency>
     <dependency>
       <groupId>com.google.guava</groupId>
index 7d235758dff42e2e53b3627f273f72ca1c0a36e2..ad90b4e8227b230fad3e0217a3bb7c579b6f22d4 100644 (file)
@@ -95,9 +95,6 @@ public class DefaultManagedRepositoryAdmin
     @Inject
     private RepositoryStatisticsManager repositoryStatisticsManager;
 
-    @Inject
-    private PlexusSisuBridge plexusSisuBridge;
-
     @Inject
     private MavenIndexerUtils mavenIndexerUtils;
 
@@ -369,20 +366,14 @@ public class DefaultManagedRepositoryAdmin
 
         try
         {
-            NexusIndexer nexusIndexer = plexusSisuBridge.lookup( NexusIndexer.class );
-
-            IndexingContext context = nexusIndexer.getIndexingContexts().get( repository.getId() );
+            IndexingContext context = indexer.getIndexingContexts().get( repository.getId() );
             if ( context != null )
             {
                 // delete content only if directory exists
-                nexusIndexer.removeIndexingContext( context,
+                indexer.removeIndexingContext( context,
                                                     deleteContent && context.getIndexDirectoryFile().exists() );
             }
         }
-        catch ( PlexusSisuBridgeException e )
-        {
-            throw new RepositoryAdminException( e.getMessage(), e );
-        }
         catch ( IOException e )
         {
             throw new RepositoryAdminException( e.getMessage(), e );
@@ -826,16 +817,6 @@ public class DefaultManagedRepositoryAdmin
         this.repositoryTaskScheduler = repositoryTaskScheduler;
     }
 
-    public PlexusSisuBridge getPlexusSisuBridge()
-    {
-        return plexusSisuBridge;
-    }
-
-    public void setPlexusSisuBridge( PlexusSisuBridge plexusSisuBridge )
-    {
-        this.plexusSisuBridge = plexusSisuBridge;
-    }
-
     public MavenIndexerUtils getMavenIndexerUtils()
     {
         return mavenIndexerUtils;
index aa4743ccc76a7b48d5a2d0903d659eab8fc5606e..15d377058846137b1081f2d9d57206c7a50edad7 100644 (file)
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:context="http://www.springframework.org/schema/context"
        xsi:schemaLocation="http://www.springframework.org/schema/beans
-           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+           http://www.springframework.org/schema/beans/spring-beans.xsd
            http://www.springframework.org/schema/context 
-           http://www.springframework.org/schema/context/spring-context-3.0.xsd" default-lazy-init="true">
-
+           http://www.springframework.org/schema/context/spring-context.xsd"
+       default-lazy-init="true">
 
   <context:annotation-config />
-  <context:component-scan
-    base-package="org.apache.archiva.admin.repository"/>
+  <context:component-scan base-package="org.apache.archiva.admin.repository"/>
 
   <alias name="redbackRuntimeConfigurationAdmin#default" alias="userConfiguration#archiva"/>
 
index 2901cbb46c38bdbcbcf8454142bfcdf9a5e5a4db..84adf6d01783c08c415baf03c8d00c029edbffb9 100644 (file)
   -->
 <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:tx="http://www.springframework.org/schema/tx"
        xsi:schemaLocation="http://www.springframework.org/schema/beans
-           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+           http://www.springframework.org/schema/beans/spring-beans.xsd
            http://www.springframework.org/schema/context 
-           http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd"
+           http://www.springframework.org/schema/context/spring-context.xsd
+           http://www.springframework.org/schema/tx
+           http://www.springframework.org/schema/tx/spring-tx.xsd"
        default-lazy-init="true">
 
   <context:annotation-config/>
index 58a5f5bb15cdfc742c29fd46bda7d4fac701e89e..2f2c6244e34dc5f41ad1d58ca42cbd68d5645c3d 100644 (file)
     <dependency>
       <groupId>org.apache.maven.indexer</groupId>
       <artifactId>indexer-core</artifactId>
-      <exclusions>
-        <exclusion>
-          <groupId>org.apache.lucene</groupId>
-          <artifactId>lucene-queryparser</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>org.apache.lucene</groupId>
-          <artifactId>lucene-analyzers-common</artifactId>
-        </exclusion>
-      </exclusions>
+      <classifier>shaded-lucene</classifier>
     </dependency>
     <dependency>
       <groupId>com.google.guava</groupId>
index 71fb584605ed38b730f2894d8d9bcf84b00a605e..b585fb7826ca6c52b5fd992a691354c664598605 100644 (file)
@@ -23,13 +23,9 @@ package org.apache.archiva.scheduler.indexing;
 import org.apache.archiva.admin.model.RepositoryAdminException;
 import org.apache.archiva.admin.model.beans.ManagedRepository;
 import org.apache.archiva.admin.model.managed.ManagedRepositoryAdmin;
-import org.apache.archiva.common.plexusbridge.PlexusSisuBridge;
-import org.apache.archiva.common.plexusbridge.PlexusSisuBridgeException;
 import org.apache.archiva.redback.components.taskqueue.Task;
 import org.apache.archiva.redback.components.taskqueue.execution.TaskExecutionException;
 import org.apache.archiva.redback.components.taskqueue.execution.TaskExecutor;
-import org.apache.lucene.search.BooleanClause;
-import org.apache.lucene.search.BooleanQuery;
 import org.apache.maven.index.ArtifactContext;
 import org.apache.maven.index.ArtifactContextProducer;
 import org.apache.maven.index.FlatSearchRequest;
@@ -40,11 +36,12 @@ import org.apache.maven.index.context.IndexingContext;
 import org.apache.maven.index.expr.SourcedSearchExpression;
 import org.apache.maven.index.packer.IndexPacker;
 import org.apache.maven.index.packer.IndexPackingRequest;
+import org.apache.maven.index.shaded.lucene.search.BooleanClause;
+import org.apache.maven.index.shaded.lucene.search.BooleanQuery;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Service;
 
-import javax.annotation.PostConstruct;
 import javax.inject.Inject;
 import java.io.File;
 import java.io.IOException;
@@ -60,31 +57,18 @@ public class ArchivaIndexingTaskExecutor
 {
     private Logger log = LoggerFactory.getLogger( ArchivaIndexingTaskExecutor.class );
 
+    @Inject
     private IndexPacker indexPacker;
 
-    private ArtifactContextProducer artifactContextProducer;
-
     @Inject
-    private PlexusSisuBridge plexusSisuBridge;
+    private ArtifactContextProducer artifactContextProducer;
 
     @Inject
     private ManagedRepositoryAdmin managedRepositoryAdmin;
 
+    @Inject
     private NexusIndexer nexusIndexer;
 
-    @PostConstruct
-    public void initialize()
-        throws PlexusSisuBridgeException
-    {
-        log.info( "Initialized {}", this.getClass().getName() );
-
-        artifactContextProducer = plexusSisuBridge.lookup( ArtifactContextProducer.class );
-
-        indexPacker = plexusSisuBridge.lookup( IndexPacker.class, "default" );
-
-        nexusIndexer = plexusSisuBridge.lookup( NexusIndexer.class );
-
-    }
 
     /**
      * depending on current {@link Task} you have.
@@ -162,9 +146,9 @@ public class ArchivaIndexingTaskExecutor
                         // TODO make that configurable?
                         if ( artifactFile.getPath().endsWith( ".pom" ) )
                         {
-                            ac.getArtifactInfo().fextension = "pom";
-                            ac.getArtifactInfo().packaging = "pom";
-                            ac.getArtifactInfo().classifier = "pom";
+                            ac.getArtifactInfo().setFileExtension( "pom" );
+                            ac.getArtifactInfo().setPackaging( "pom" );
+                            ac.getArtifactInfo().setClassifier( "pom" );
                         }
                         if ( indexingTask.getAction().equals( ArtifactIndexingTask.Action.ADD ) )
                         {
@@ -174,20 +158,20 @@ public class ArchivaIndexingTaskExecutor
 
                             BooleanQuery q = new BooleanQuery();
                             q.add( nexusIndexer.constructQuery( MAVEN.GROUP_ID, new SourcedSearchExpression(
-                                ac.getArtifactInfo().groupId ) ), BooleanClause.Occur.MUST );
+                                ac.getArtifactInfo().getGroupId() ) ), BooleanClause.Occur.MUST );
                             q.add( nexusIndexer.constructQuery( MAVEN.ARTIFACT_ID, new SourcedSearchExpression(
-                                ac.getArtifactInfo().artifactId ) ), BooleanClause.Occur.MUST );
+                                ac.getArtifactInfo().getArtifactId() ) ), BooleanClause.Occur.MUST );
                             q.add( nexusIndexer.constructQuery( MAVEN.VERSION, new SourcedSearchExpression(
-                                ac.getArtifactInfo().version ) ), BooleanClause.Occur.MUST );
-                            if ( ac.getArtifactInfo().classifier != null )
+                                ac.getArtifactInfo().getVersion() ) ), BooleanClause.Occur.MUST );
+                            if ( ac.getArtifactInfo().getClassifier() != null )
                             {
                                 q.add( nexusIndexer.constructQuery( MAVEN.CLASSIFIER, new SourcedSearchExpression(
-                                    ac.getArtifactInfo().classifier ) ), BooleanClause.Occur.MUST );
+                                    ac.getArtifactInfo().getClassifier() ) ), BooleanClause.Occur.MUST );
                             }
-                            if ( ac.getArtifactInfo().packaging != null )
+                            if ( ac.getArtifactInfo().getPackaging() != null )
                             {
                                 q.add( nexusIndexer.constructQuery( MAVEN.PACKAGING, new SourcedSearchExpression(
-                                    ac.getArtifactInfo().packaging ) ), BooleanClause.Occur.MUST );
+                                    ac.getArtifactInfo().getPackaging() ) ), BooleanClause.Occur.MUST );
                             }
                             FlatSearchRequest flatSearchRequest = new FlatSearchRequest( q, context );
                             FlatSearchResponse flatSearchResponse = nexusIndexer.searchFlat( flatSearchRequest );
@@ -272,13 +256,4 @@ public class ArchivaIndexingTaskExecutor
         this.indexPacker = indexPacker;
     }
 
-    public PlexusSisuBridge getPlexusSisuBridge()
-    {
-        return plexusSisuBridge;
-    }
-
-    public void setPlexusSisuBridge( PlexusSisuBridge plexusSisuBridge )
-    {
-        this.plexusSisuBridge = plexusSisuBridge;
-    }
 }
index c2453c8eb5bf924598835930736395e30e89c6b4..c633adb0cb90c13e1db7d79628275b9b3578f601 100644 (file)
@@ -37,7 +37,7 @@ public class MavenIndexerCleaner
     Logger log = LoggerFactory.getLogger( getClass() );
 
     @Inject
-    private PlexusSisuBridge plexusSisuBridge;
+    private NexusIndexer nexusIndexer;
 
     @PreDestroy
     public void shutdown()
@@ -45,7 +45,6 @@ public class MavenIndexerCleaner
     {
 
         log.info( "cleanup IndexingContext" );
-        NexusIndexer nexusIndexer = plexusSisuBridge.lookup( NexusIndexer.class );
         for ( IndexingContext context : nexusIndexer.getIndexingContexts().values() )
         {
             nexusIndexer.removeIndexingContext( context, true );
index bdb0b6b68d132a93feef8fee962a1cdf42bb0b3f..82395d710e5342c9a1cfe27b1daf8ba59af87948 100644 (file)
     <dependency>
       <groupId>org.apache.maven.indexer</groupId>
       <artifactId>indexer-core</artifactId>
+      <classifier>shaded-lucene</classifier>
       <exclusions>
         <exclusion>
           <groupId>org.codehaus.plexus</groupId>
diff --git a/pom.xml b/pom.xml
index 8abfddf47c08e7ee1d9a56f883eb961ab74d9b69..48fbb9cb7d6038d8e31aa311eb9bde429c7953ca 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -71,7 +71,7 @@
     <slf4j.version>1.7.25</slf4j.version>
     <log4j.version>2.8.2</log4j.version>
 
-    <spring.version>4.3.8.RELEASE</spring.version>
+    <spring.version>4.3.9.RELEASE</spring.version>
 
     <javax.jcr.version>2.0</javax.jcr.version>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <artifactId>archiva-indexer</artifactId>
         <version>${project.version}</version>
       </dependency>
+      <dependency>
+        <groupId>org.apache.maven.indexer</groupId>
+        <artifactId>indexer-reader</artifactId>
+        <version>${maven.indexer.version}</version>
+      </dependency>
       <dependency>
         <groupId>org.apache.maven.indexer</groupId>
         <artifactId>indexer-core</artifactId>
         <version>${maven.indexer.version}</version>
+        <classifier>shaded-lucene</classifier>
         <exclusions>
+          <exclusion>
+            <groupId>org.apache.lucene</groupId>
+            <artifactId>*</artifactId>
+          </exclusion>
           <exclusion>
             <groupId>org.codehaus.plexus</groupId>
             <artifactId>plexus-container-default</artifactId>