From 7d2cc26b4bf41a5e9429aba3a54665669cf6cf79 Mon Sep 17 00:00:00 2001 From: Martin Stockhammer Date: Wed, 21 Jun 2017 23:52:17 +0200 Subject: Adding jcr oak implementation --- .../archiva-lucene-consumers/pom.xml | 35 ++++++++++++---------- .../src/test/resources/spring-context.xml | 3 +- .../archiva-base/archiva-indexer/pom.xml | 10 +++++++ .../archiva-base/archiva-plexus-bridge/pom.xml | 10 +++++++ .../archiva-repository-admin-api/pom.xml | 8 +++++ 5 files changed, 50 insertions(+), 16 deletions(-) (limited to 'archiva-modules/archiva-base') diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/pom.xml b/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/pom.xml index 6eed0b863..e8b970b3e 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/pom.xml +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/pom.xml @@ -66,10 +66,30 @@ commons-io commons-io + + + org.apache.lucene + lucene-queryparser + + + org.apache.lucene + lucene-analyzers-common + + org.apache.maven.indexer indexer-core + + + org.apache.lucene + lucene-queryparser + + + org.apache.lucene + lucene-analyzers-common + + javax.inject @@ -110,21 +130,6 @@ metadata-store-jcr test - - org.apache.jackrabbit - jackrabbit-core - test - - - commons-logging - commons-logging - - - org.slf4j - jcl-over-slf4j - - - xerces xercesImpl diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/resources/spring-context.xml b/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/resources/spring-context.xml index db01db735..a89137295 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/resources/spring-context.xml +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/resources/spring-context.xml @@ -59,6 +59,7 @@ + \ No newline at end of file diff --git a/archiva-modules/archiva-base/archiva-indexer/pom.xml b/archiva-modules/archiva-base/archiva-indexer/pom.xml index 5695593b7..eae5642a9 100644 --- a/archiva-modules/archiva-base/archiva-indexer/pom.xml +++ b/archiva-modules/archiva-base/archiva-indexer/pom.xml @@ -85,6 +85,16 @@ org.apache.maven.indexer indexer-core + + + org.apache.lucene + lucene-queryparser + + + org.apache.lucene + lucene-analyzers-common + + org.eclipse.sisu diff --git a/archiva-modules/archiva-base/archiva-plexus-bridge/pom.xml b/archiva-modules/archiva-base/archiva-plexus-bridge/pom.xml index fe40f6284..d8b477e3f 100644 --- a/archiva-modules/archiva-base/archiva-plexus-bridge/pom.xml +++ b/archiva-modules/archiva-base/archiva-plexus-bridge/pom.xml @@ -58,6 +58,16 @@ org.apache.maven.indexer indexer-core + + + org.apache.lucene + lucene-queryparser + + + org.apache.lucene + lucene-analyzers-common + + org.codehaus.plexus diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/pom.xml b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/pom.xml index a57c21fb2..d1ca7d768 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/pom.xml +++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/pom.xml @@ -73,6 +73,14 @@ com.google.code.atinject atinject + + org.apache.lucene + lucene-queryparser + + + org.apache.lucene + lucene-analyzers-common + -- cgit v1.2.3 From f0ba11a2f8f3505dc5550d213c63270b25e29d94 Mon Sep 17 00:00:00 2001 From: olivier lamy Date: Sat, 24 Jun 2017 08:42:26 +1000 Subject: indexer is not using plexus bridge anymore Signed-off-by: olivier lamy --- .../archiva-repository-admin-default/pom.xml | 20 ++++++++++++++++-- .../managed/DefaultManagedRepositoryAdmin.java | 24 ++++++++++++---------- .../src/main/resources/META-INF/spring-context.xml | 2 +- pom.xml | 5 +++++ 4 files changed, 37 insertions(+), 14 deletions(-) (limited to 'archiva-modules/archiva-base') diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/pom.xml b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/pom.xml index 06fe2e4db..4b164e7c6 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/pom.xml +++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/pom.xml @@ -37,6 +37,24 @@ org.apache.archiva archiva-security-common + + org.apache.maven.indexer + indexer-core + + + org.sonatype.sisu + sisu-guava + + + org.sonatype.sisu + sisu-guice + + + + + org.apache.maven.archetype + archetype-common + org.apache.archiva archiva-scheduler-repository-api @@ -109,7 +127,6 @@ org.springframework spring-context-support - ${spring.version} commons-logging @@ -120,7 +137,6 @@ org.springframework spring-context - ${spring.version} commons-logging diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/managed/DefaultManagedRepositoryAdmin.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/managed/DefaultManagedRepositoryAdmin.java index f398bca26..7d235758d 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/managed/DefaultManagedRepositoryAdmin.java +++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/managed/DefaultManagedRepositoryAdmin.java @@ -109,23 +109,25 @@ public class DefaultManagedRepositoryAdmin private Cache> namespacesCache; // fields - List indexCreators; + @Inject + private List indexCreators; - NexusIndexer indexer; + @Inject + private NexusIndexer indexer; @PostConstruct public void initialize() throws RepositoryAdminException, RoleManagerException { - try - { - indexCreators = mavenIndexerUtils.getAllIndexCreators(); - indexer = plexusSisuBridge.lookup( NexusIndexer.class ); - } - catch ( PlexusSisuBridgeException e ) - { - throw new RepositoryAdminException( e.getMessage(), e ); - } +// try +// { +// indexCreators = mavenIndexerUtils.getAllIndexCreators(); +// indexer = plexusSisuBridge.lookup( NexusIndexer.class ); +// } +// catch ( PlexusSisuBridgeException e ) +// { +// throw new RepositoryAdminException( e.getMessage(), e ); +// } // initialize index context on start and check roles here for ( ManagedRepository managedRepository : getManagedRepositories() ) { diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/resources/META-INF/spring-context.xml b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/resources/META-INF/spring-context.xml index aa4743ccc..04e14fb3b 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/resources/META-INF/spring-context.xml +++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/resources/META-INF/spring-context.xml @@ -29,7 +29,7 @@ + base-package="org.apache.archiva.admin.repository,org.apache.maven.index"/> diff --git a/pom.xml b/pom.xml index f335da7f4..bbaf7f839 100644 --- a/pom.xml +++ b/pom.xml @@ -320,6 +320,11 @@ + + org.apache.maven.archetype + archetype-common + 3.0.1 + org.apache.archiva -- cgit v1.2.3 From 0bfead8264c924e832a9672f85516e0bf69c5cd8 Mon Sep 17 00:00:00 2001 From: olivier lamy Date: Sat, 24 Jun 2017 09:33:50 +1000 Subject: some progress on new indexer Signed-off-by: olivier lamy --- .../common/plexusbridge/MavenIndexerUtils.java | 31 +++------------------- .../src/main/resources/META-INF/spring-context.xml | 2 +- .../archiva-repository-admin-default/pom.xml | 14 +++------- .../remote/DefaultRemoteRepositoryAdmin.java | 21 ++------------- .../src/main/resources/META-INF/spring-context.xml | 2 +- .../repository/jcr/JcrMetadataRepositoryTest.java | 1 + pom.xml | 20 +++++++++++++- 7 files changed, 31 insertions(+), 60 deletions(-) (limited to 'archiva-modules/archiva-base') 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 448851ee7..dc94ad5fe 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 @@ -20,18 +20,11 @@ package org.apache.archiva.common.plexusbridge; */ import org.apache.maven.index.context.IndexCreator; -import org.apache.maven.index.creator.JarFileContentsIndexCreator; -import org.apache.maven.index.creator.MavenArchetypeArtifactInfoIndexCreator; -import org.apache.maven.index.creator.MavenPluginArtifactInfoIndexCreator; -import org.apache.maven.index.creator.MinimalArtifactInfoIndexCreator; -import org.apache.maven.index.creator.OsgiArtifactIndexCreator; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; import javax.inject.Inject; -import java.util.ArrayList; -import java.util.Arrays; import java.util.List; /** @@ -44,32 +37,14 @@ public class MavenIndexerUtils private Logger log = LoggerFactory.getLogger( getClass() ); + @Inject private List allIndexCreators; - @Inject - public MavenIndexerUtils( PlexusSisuBridge plexusSisuBridge ) - throws PlexusSisuBridgeException + public MavenIndexerUtils() { - allIndexCreators = new ArrayList( plexusSisuBridge.lookupList( IndexCreator.class ) ); - - if ( allIndexCreators == null || allIndexCreators.isEmpty() ) - { - // olamy when the TCL is not a URLClassLoader lookupList fail ! - // when using tomcat maven plugin so adding a simple hack - log.warn( "using lookupList from sisu plexus failed so build indexCreator manually" ); - - allIndexCreators = - 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" ); + throw new RuntimeException( "cannot initiliaze IndexCreators" ); } log.debug( "allIndexCreators {}", allIndexCreators ); diff --git a/archiva-modules/archiva-base/archiva-plexus-bridge/src/main/resources/META-INF/spring-context.xml b/archiva-modules/archiva-base/archiva-plexus-bridge/src/main/resources/META-INF/spring-context.xml index 41188dcd8..cd6acffd9 100644 --- a/archiva-modules/archiva-base/archiva-plexus-bridge/src/main/resources/META-INF/spring-context.xml +++ b/archiva-modules/archiva-base/archiva-plexus-bridge/src/main/resources/META-INF/spring-context.xml @@ -28,5 +28,5 @@ default-lazy-init="true"> - + \ No newline at end of file diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/pom.xml b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/pom.xml index 4b164e7c6..44a2d7beb 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/pom.xml +++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/pom.xml @@ -40,16 +40,10 @@ org.apache.maven.indexer indexer-core - - - org.sonatype.sisu - sisu-guava - - - org.sonatype.sisu - sisu-guice - - + + + com.google.guava + guava org.apache.maven.archetype diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/remote/DefaultRemoteRepositoryAdmin.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/remote/DefaultRemoteRepositoryAdmin.java index 8f390530b..bf8d88b18 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/remote/DefaultRemoteRepositoryAdmin.java +++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/remote/DefaultRemoteRepositoryAdmin.java @@ -23,9 +23,6 @@ import org.apache.archiva.admin.model.RepositoryAdminException; import org.apache.archiva.admin.model.beans.RemoteRepository; import org.apache.archiva.admin.model.remote.RemoteRepositoryAdmin; import org.apache.archiva.admin.repository.AbstractRepositoryAdmin; -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.configuration.Configuration; import org.apache.archiva.configuration.ProxyConnectorConfiguration; import org.apache.archiva.configuration.RemoteRepositoryConfiguration; @@ -60,29 +57,15 @@ public class DefaultRemoteRepositoryAdmin { @Inject - private PlexusSisuBridge plexusSisuBridge; - - @Inject - private MavenIndexerUtils mavenIndexerUtils; - - // fields private List indexCreators; + @Inject private NexusIndexer indexer; @PostConstruct private void initialize() throws RepositoryAdminException { - try - { - indexCreators = mavenIndexerUtils.getAllIndexCreators(); - indexer = plexusSisuBridge.lookup( NexusIndexer.class ); - } - catch ( PlexusSisuBridgeException e ) - { - throw new RepositoryAdminException( e.getMessage(), e ); - } for ( RemoteRepository remoteRepository : getRemoteRepositories() ) { createIndexContext( remoteRepository ); @@ -323,7 +306,7 @@ public class DefaultRemoteRepositoryAdmin } return indexer.addIndexingContext( contextKey, remoteRepository.getId(), repoDir, indexDirectory, remoteRepository.getUrl(), calculateIndexRemoteUrl( remoteRepository ), - mavenIndexerUtils.getAllIndexCreators() ); + indexCreators ); } catch ( MalformedURLException e ) { diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/resources/META-INF/spring-context.xml b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/resources/META-INF/spring-context.xml index 04e14fb3b..aa4743ccc 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/resources/META-INF/spring-context.xml +++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/resources/META-INF/spring-context.xml @@ -29,7 +29,7 @@ + base-package="org.apache.archiva.admin.repository"/> diff --git a/archiva-modules/plugins/metadata-store-jcr/src/test/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepositoryTest.java b/archiva-modules/plugins/metadata-store-jcr/src/test/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepositoryTest.java index debf5c907..a232391f0 100644 --- a/archiva-modules/plugins/metadata-store-jcr/src/test/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepositoryTest.java +++ b/archiva-modules/plugins/metadata-store-jcr/src/test/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepositoryTest.java @@ -19,6 +19,7 @@ package org.apache.archiva.metadata.repository.jcr; * under the License. */ +import com.google.common.base.Objects; import org.apache.archiva.metadata.model.MetadataFacetFactory; import org.apache.archiva.metadata.repository.AbstractMetadataRepositoryTest; import org.apache.commons.io.FileUtils; diff --git a/pom.xml b/pom.xml index bbaf7f839..8abfddf47 100644 --- a/pom.xml +++ b/pom.xml @@ -86,7 +86,7 @@ 1.4 9.4.7-SNAPSHOT - 22.0 + 15.0 2.4.1 @@ -318,12 +318,30 @@ com.google.code.atinject atinject + + org.sonatype.sisu + sisu-guava + + + org.sonatype.sisu + sisu-guice + org.apache.maven.archetype archetype-common 3.0.1 + + + org.apache.maven + * + + + org.sonatype.sisu + * + + -- cgit v1.2.3 From 58ac86f011603664b34dfc5089c1a998d7fdbbc9 Mon Sep 17 00:00:00 2001 From: olivier lamy Date: Sat, 24 Jun 2017 10:21:14 +1000 Subject: force jcr save Signed-off-by: olivier lamy --- archiva-modules/archiva-base/archiva-proxy-common/pom.xml | 4 ++++ archiva-modules/plugins/metadata-store-jcr/pom.xml | 2 +- .../metadata/repository/jcr/JcrMetadataRepositoryTest.java | 9 ++++----- 3 files changed, 9 insertions(+), 6 deletions(-) (limited to 'archiva-modules/archiva-base') diff --git a/archiva-modules/archiva-base/archiva-proxy-common/pom.xml b/archiva-modules/archiva-base/archiva-proxy-common/pom.xml index 5fa20f65d..42226575f 100644 --- a/archiva-modules/archiva-base/archiva-proxy-common/pom.xml +++ b/archiva-modules/archiva-base/archiva-proxy-common/pom.xml @@ -36,6 +36,10 @@ org.apache.archiva archiva-repository-admin-api + + org.apache.maven.archetype + archetype-common + org.apache.maven.wagon wagon-provider-api diff --git a/archiva-modules/plugins/metadata-store-jcr/pom.xml b/archiva-modules/plugins/metadata-store-jcr/pom.xml index 831b639b0..94eba17a2 100644 --- a/archiva-modules/plugins/metadata-store-jcr/pom.xml +++ b/archiva-modules/plugins/metadata-store-jcr/pom.xml @@ -29,7 +29,7 @@ bundle Archiva Core Plugins :: JCR Storage for Metadata - 1.7.1 + 1.7.2 diff --git a/archiva-modules/plugins/metadata-store-jcr/src/test/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepositoryTest.java b/archiva-modules/plugins/metadata-store-jcr/src/test/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepositoryTest.java index a232391f0..e87d53f98 100644 --- a/archiva-modules/plugins/metadata-store-jcr/src/test/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepositoryTest.java +++ b/archiva-modules/plugins/metadata-store-jcr/src/test/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepositoryTest.java @@ -19,7 +19,6 @@ package org.apache.archiva.metadata.repository.jcr; * under the License. */ -import com.google.common.base.Objects; import org.apache.archiva.metadata.model.MetadataFacetFactory; import org.apache.archiva.metadata.repository.AbstractMetadataRepositoryTest; import org.apache.commons.io.FileUtils; @@ -29,13 +28,13 @@ import org.junit.Before; import org.junit.BeforeClass; import org.springframework.context.ApplicationContext; -import java.io.File; -import java.io.IOException; -import java.util.Map; import javax.inject.Inject; import javax.jcr.Repository; import javax.jcr.RepositoryException; import javax.jcr.Session; +import java.io.File; +import java.io.IOException; +import java.util.Map; public class JcrMetadataRepositoryTest extends AbstractMetadataRepositoryTest @@ -58,7 +57,6 @@ public class JcrMetadataRepositoryTest RepositoryFactory factory = new RepositoryFactory(); factory.setRepositoryPath( directory.getPath() ); jcrRepository = factory.createRepository(); - } @Before @@ -83,6 +81,7 @@ public class JcrMetadataRepositoryTest // removing content is faster than deleting and re-copying the files from target/jcr session.getRootNode().getNode( "repositories" ).remove(); + session.save(); } catch ( RepositoryException e ) { -- cgit v1.2.3 From 22430044a4626cafb3bf9f2d3c9cafa2e0e679fd Mon Sep 17 00:00:00 2001 From: olivier lamy Date: Fri, 7 Jul 2017 17:20:47 +1000 Subject: push work started with shaded lucene Signed-off-by: olivier lamy --- .../core/AbstractArtifactConsumerTest.java | 3 +- .../repository/AbstractRepositoryPurgeTest.java | 3 +- .../archiva-lucene-consumers/pom.xml | 1 + .../consumers/lucene/NexusIndexerConsumer.java | 7 +- .../archiva-base/archiva-indexer/pom.xml | 13 +-- .../archiva/indexer/merger/DefaultIndexMerger.java | 11 +- .../indexer/merger/TemporaryGroupIndexCleaner.java | 26 +++-- .../indexer/search/MavenRepositorySearch.java | 115 +++++++++++---------- .../search/NoClassifierArtifactInfoFilter.java | 2 +- .../search/AbstractMavenRepositorySearch.java | 24 +++-- .../archiva-base/archiva-plexus-bridge/pom.xml | 11 +- .../common/plexusbridge/MavenIndexerUtils.java | 19 +++- .../src/main/resources/META-INF/spring-context.xml | 39 ++++++- .../src/main/resources/META-INF/spring-context.xml | 4 +- .../src/test/resources/META-INF/spring-context.xml | 5 +- .../archiva/proxy/AbstractProxyTestCase.java | 3 +- .../archiva-repository-admin-api/pom.xml | 1 + .../archiva-repository-admin-default/pom.xml | 1 + .../managed/DefaultManagedRepositoryAdmin.java | 23 +---- .../src/main/resources/META-INF/spring-context.xml | 9 +- .../src/test/resources/spring-context.xml | 9 +- .../archiva-scheduler-indexing/pom.xml | 11 +- .../indexing/ArchivaIndexingTaskExecutor.java | 55 +++------- .../rest/services/utils/MavenIndexerCleaner.java | 3 +- archiva-modules/archiva-web/archiva-webapp/pom.xml | 1 + pom.xml | 12 ++- 26 files changed, 204 insertions(+), 207 deletions(-) (limited to 'archiva-modules/archiva-base') diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/consumers/core/AbstractArtifactConsumerTest.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/consumers/core/AbstractArtifactConsumerTest.java index 1176bc59c..715dc684c 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/consumers/core/AbstractArtifactConsumerTest.java +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/consumers/core/AbstractArtifactConsumerTest.java @@ -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 ); diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/consumers/core/repository/AbstractRepositoryPurgeTest.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/consumers/core/repository/AbstractRepositoryPurgeTest.java index 9412ac73c..f51753328 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/consumers/core/repository/AbstractRepositoryPurgeTest.java +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/consumers/core/repository/AbstractRepositoryPurgeTest.java @@ -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 ); diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/pom.xml b/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/pom.xml index e8b970b3e..208825140 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/pom.xml +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/pom.xml @@ -80,6 +80,7 @@ org.apache.maven.indexer indexer-core + shaded-lucene org.apache.lucene diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/archiva/consumers/lucene/NexusIndexerConsumer.java b/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/archiva/consumers/lucene/NexusIndexerConsumer.java index aa999bd6f..c85a8fbea 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/archiva/consumers/lucene/NexusIndexerConsumer.java +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/archiva/consumers/lucene/NexusIndexerConsumer.java @@ -88,14 +88,13 @@ public class NexusIndexerConsumer public NexusIndexerConsumer( @Named( value = "archivaTaskScheduler#indexing" ) ArchivaTaskScheduler 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; } diff --git a/archiva-modules/archiva-base/archiva-indexer/pom.xml b/archiva-modules/archiva-base/archiva-indexer/pom.xml index eae5642a9..a9f24ef0e 100644 --- a/archiva-modules/archiva-base/archiva-indexer/pom.xml +++ b/archiva-modules/archiva-base/archiva-indexer/pom.xml @@ -48,14 +48,6 @@ spring-context-support - - org.apache.lucene - lucene-core - - - org.apache.lucene - lucene-queries - org.codehaus.plexus plexus-utils @@ -82,9 +74,14 @@ commons-io commons-io + + org.apache.maven.indexer + indexer-reader + org.apache.maven.indexer indexer-core + shaded-lucene org.apache.lucene diff --git a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/merger/DefaultIndexMerger.java b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/merger/DefaultIndexMerger.java index 225cc78e8..663f0b63a 100644 --- a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/merger/DefaultIndexMerger.java +++ b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/merger/DefaultIndexMerger.java @@ -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 runningGroups = new CopyOnWriteArrayList(); @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 ); } diff --git a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/merger/TemporaryGroupIndexCleaner.java b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/merger/TemporaryGroupIndexCleaner.java index 322d82e06..dc7f5c03a 100644 --- a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/merger/TemporaryGroupIndexCleaner.java +++ b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/merger/TemporaryGroupIndexCleaner.java @@ -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 ); - } - } + } + } + ); } } diff --git a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/MavenRepositorySearch.java b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/MavenRepositorySearch.java index 848ca78c1..64db78594 100644 --- a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/MavenRepositorySearch.java +++ b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/MavenRepositorySearch.java @@ -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 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(); diff --git a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/NoClassifierArtifactInfoFilter.java b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/NoClassifierArtifactInfoFilter.java index 6068aa720..49feb2d81 100644 --- a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/NoClassifierArtifactInfoFilter.java +++ b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/NoClassifierArtifactInfoFilter.java @@ -38,6 +38,6 @@ public class NoClassifierArtifactInfoFilter @Override public boolean addArtifactInResult( ArtifactInfo artifact, Map currentResult ) { - return StringUtils.isBlank( artifact.classifier ); + return StringUtils.isBlank( artifact.getClassifier() ); } } diff --git a/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/archiva/indexer/search/AbstractMavenRepositorySearch.java b/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/archiva/indexer/search/AbstractMavenRepositorySearch.java index 461a4d76b..58fdf68d5 100644 --- a/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/archiva/indexer/search/AbstractMavenRepositorySearch.java +++ b/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/archiva/indexer/search/AbstractMavenRepositorySearch.java @@ -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 ); diff --git a/archiva-modules/archiva-base/archiva-plexus-bridge/pom.xml b/archiva-modules/archiva-base/archiva-plexus-bridge/pom.xml index d8b477e3f..3e85ac5a5 100644 --- a/archiva-modules/archiva-base/archiva-plexus-bridge/pom.xml +++ b/archiva-modules/archiva-base/archiva-plexus-bridge/pom.xml @@ -58,16 +58,7 @@ org.apache.maven.indexer indexer-core - - - org.apache.lucene - lucene-queryparser - - - org.apache.lucene - lucene-analyzers-common - - + shaded-lucene org.codehaus.plexus 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 dc94ad5fe..7f86da4ff 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 @@ -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 allIndexCreators; - public MavenIndexerUtils() + private ApplicationContext applicationContext; + + @Inject + public MavenIndexerUtils(ApplicationContext applicationContext, Map 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" ); diff --git a/archiva-modules/archiva-base/archiva-plexus-bridge/src/main/resources/META-INF/spring-context.xml b/archiva-modules/archiva-base/archiva-plexus-bridge/src/main/resources/META-INF/spring-context.xml index cd6acffd9..9c12ec813 100644 --- a/archiva-modules/archiva-base/archiva-plexus-bridge/src/main/resources/META-INF/spring-context.xml +++ b/archiva-modules/archiva-base/archiva-plexus-bridge/src/main/resources/META-INF/spring-context.xml @@ -21,12 +21,43 @@ + 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"> - + + + + + + \ No newline at end of file diff --git a/archiva-modules/archiva-base/archiva-proxy-common/src/main/resources/META-INF/spring-context.xml b/archiva-modules/archiva-base/archiva-proxy-common/src/main/resources/META-INF/spring-context.xml index 217a33d3b..7374f3685 100644 --- a/archiva-modules/archiva-base/archiva-proxy-common/src/main/resources/META-INF/spring-context.xml +++ b/archiva-modules/archiva-base/archiva-proxy-common/src/main/resources/META-INF/spring-context.xml @@ -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"> diff --git a/archiva-modules/archiva-base/archiva-proxy-common/src/test/resources/META-INF/spring-context.xml b/archiva-modules/archiva-base/archiva-proxy-common/src/test/resources/META-INF/spring-context.xml index c19b3e867..7afd4a422 100644 --- a/archiva-modules/archiva-base/archiva-proxy-common/src/test/resources/META-INF/spring-context.xml +++ b/archiva-modules/archiva-base/archiva-proxy-common/src/test/resources/META-INF/spring-context.xml @@ -20,11 +20,8 @@ diff --git a/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/AbstractProxyTestCase.java b/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/AbstractProxyTestCase.java index 08226d2e8..4d0a9a810 100644 --- a/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/AbstractProxyTestCase.java +++ b/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/AbstractProxyTestCase.java @@ -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() ) { diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/pom.xml b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/pom.xml index d1ca7d768..b7e8ad21a 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/pom.xml +++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/pom.xml @@ -44,6 +44,7 @@ org.apache.maven.indexer indexer-core + shaded-lucene org.codehaus.plexus diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/pom.xml b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/pom.xml index 44a2d7beb..23494f02f 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/pom.xml +++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/pom.xml @@ -40,6 +40,7 @@ org.apache.maven.indexer indexer-core + shaded-lucene com.google.guava diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/managed/DefaultManagedRepositoryAdmin.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/managed/DefaultManagedRepositoryAdmin.java index 7d235758d..ad90b4e82 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/managed/DefaultManagedRepositoryAdmin.java +++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/managed/DefaultManagedRepositoryAdmin.java @@ -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; diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/resources/META-INF/spring-context.xml b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/resources/META-INF/spring-context.xml index aa4743ccc..15d377058 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/resources/META-INF/spring-context.xml +++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/resources/META-INF/spring-context.xml @@ -22,14 +22,13 @@ 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"> - + diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/resources/spring-context.xml b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/resources/spring-context.xml index 2901cbb46..84adf6d01 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/resources/spring-context.xml +++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/resources/spring-context.xml @@ -20,11 +20,14 @@ --> diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/pom.xml b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/pom.xml index 58a5f5bb1..2f2c6244e 100644 --- a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/pom.xml +++ b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/pom.xml @@ -44,16 +44,7 @@ org.apache.maven.indexer indexer-core - - - org.apache.lucene - lucene-queryparser - - - org.apache.lucene - lucene-analyzers-common - - + shaded-lucene com.google.guava diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/ArchivaIndexingTaskExecutor.java b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/ArchivaIndexingTaskExecutor.java index 71fb58460..b585fb782 100644 --- a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/ArchivaIndexingTaskExecutor.java +++ b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/ArchivaIndexingTaskExecutor.java @@ -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; - } } diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/utils/MavenIndexerCleaner.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/utils/MavenIndexerCleaner.java index c2453c8eb..c633adb0c 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/utils/MavenIndexerCleaner.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/utils/MavenIndexerCleaner.java @@ -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 ); diff --git a/archiva-modules/archiva-web/archiva-webapp/pom.xml b/archiva-modules/archiva-web/archiva-webapp/pom.xml index bdb0b6b68..82395d710 100644 --- a/archiva-modules/archiva-web/archiva-webapp/pom.xml +++ b/archiva-modules/archiva-web/archiva-webapp/pom.xml @@ -255,6 +255,7 @@ org.apache.maven.indexer indexer-core + shaded-lucene org.codehaus.plexus diff --git a/pom.xml b/pom.xml index 8abfddf47..48fbb9cb7 100644 --- a/pom.xml +++ b/pom.xml @@ -71,7 +71,7 @@ 1.7.25 2.8.2 - 4.3.8.RELEASE + 4.3.9.RELEASE 2.0 UTF-8 @@ -285,11 +285,21 @@ archiva-indexer ${project.version} + + org.apache.maven.indexer + indexer-reader + ${maven.indexer.version} + org.apache.maven.indexer indexer-core ${maven.indexer.version} + shaded-lucene + + org.apache.lucene + * + org.codehaus.plexus plexus-container-default -- cgit v1.2.3 From 7480b7ffe247268dc434a3eb079cb1e34c6bb73b Mon Sep 17 00:00:00 2001 From: olivier lamy Date: Mon, 17 Jul 2017 18:41:14 +1000 Subject: some progress Signed-off-by: olivier lamy --- .../archiva/indexer/search/AbstractMavenRepositorySearch.java | 9 ++++++--- .../archiva/scheduler/indexing/ArchivaIndexingTaskExecutor.java | 4 +++- archiva-modules/plugins/problem-reports/pom.xml | 2 +- archiva-modules/plugins/stage-repository-merge/pom.xml | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) (limited to 'archiva-modules/archiva-base') diff --git a/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/archiva/indexer/search/AbstractMavenRepositorySearch.java b/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/archiva/indexer/search/AbstractMavenRepositorySearch.java index 58fdf68d5..cab896bdb 100644 --- a/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/archiva/indexer/search/AbstractMavenRepositorySearch.java +++ b/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/archiva/indexer/search/AbstractMavenRepositorySearch.java @@ -38,6 +38,7 @@ 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.apache.maven.index.shaded.lucene.index.IndexUpgrader; import org.easymock.EasyMock; import org.easymock.IMocksControl; import org.junit.After; @@ -242,13 +243,13 @@ public abstract class AbstractMavenRepositorySearch @Override public void scanningStarted( IndexingContext ctx ) { - + // } @Override public void scanningFinished( IndexingContext ctx, ScanningResult result ) { - + // no op } @Override @@ -260,7 +261,9 @@ public abstract class AbstractMavenRepositorySearch @Override public void artifactDiscovered( ArtifactContext ac ) { - log.debug( "artifactDiscovered {}:{}", ac.getArtifact().getPath(), ac.getArtifactInfo() ); + log.debug( "artifactDiscovered {}:{}", // + ac.getArtifact() == null ? "" : ac.getArtifact().getPath(), // + ac.getArtifact() == null ? "" : ac.getArtifactInfo() ); } } diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/ArchivaIndexingTaskExecutor.java b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/ArchivaIndexingTaskExecutor.java index b585fb782..478473e9a 100644 --- a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/ArchivaIndexingTaskExecutor.java +++ b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/ArchivaIndexingTaskExecutor.java @@ -232,7 +232,9 @@ public class ArchivaIndexingTaskExecutor if ( !repository.isSkipPackedIndexCreation() ) { - IndexPackingRequest request = new IndexPackingRequest( context, context.getIndexDirectoryFile() ); + IndexPackingRequest request = new IndexPackingRequest( context, // + context.acquireIndexSearcher().getIndexReader(), // + context.getIndexDirectoryFile() ); indexPacker.packIndex( request ); context.updateTimestamp( true ); diff --git a/archiva-modules/plugins/problem-reports/pom.xml b/archiva-modules/plugins/problem-reports/pom.xml index 20db52b92..d08bccb6b 100644 --- a/archiva-modules/plugins/problem-reports/pom.xml +++ b/archiva-modules/plugins/problem-reports/pom.xml @@ -112,7 +112,7 @@ test-repository - generate-test-resources + process-test-classes unpack-dependencies diff --git a/archiva-modules/plugins/stage-repository-merge/pom.xml b/archiva-modules/plugins/stage-repository-merge/pom.xml index d425434e0..4023b24a1 100644 --- a/archiva-modules/plugins/stage-repository-merge/pom.xml +++ b/archiva-modules/plugins/stage-repository-merge/pom.xml @@ -153,7 +153,7 @@ test-repository - generate-test-resources + process-test-classes unpack-dependencies -- cgit v1.2.3 From 003d5794a823d57b58ec26663fe145f31649ce31 Mon Sep 17 00:00:00 2001 From: olivier lamy Date: Mon, 24 Jul 2017 10:12:23 +1000 Subject: more progress on new maven indexer version Signed-off-by: olivier lamy --- .../consumers/lucene/NexusIndexerConsumerTest.java | 14 +- .../indexer/search/MavenRepositorySearchTest.java | 23 +- .../src/test/repo-release/.index/_7.fdt | Bin 358889 -> 0 bytes .../src/test/repo-release/.index/_7.fdx | Bin 3324 -> 0 bytes .../src/test/repo-release/.index/_7.fnm | 5 - .../src/test/repo-release/.index/_7.frq | 262 --------------------- .../src/test/repo-release/.index/_7.nrm | 1 - .../src/test/repo-release/.index/_7.prx | Bin 48973 -> 0 bytes .../src/test/repo-release/.index/_7.tii | Bin 852 -> 0 bytes .../src/test/repo-release/.index/_7.tis | Bin 67003 -> 0 bytes .../src/test/repo-release/.index/_8.fdt | Bin 0 -> 86211 bytes .../src/test/repo-release/.index/_8.fdx | Bin 0 -> 114 bytes .../src/test/repo-release/.index/_8.fnm | Bin 0 -> 2157 bytes .../src/test/repo-release/.index/_8.nvd | Bin 0 -> 2330 bytes .../src/test/repo-release/.index/_8.nvm | Bin 0 -> 261 bytes .../src/test/repo-release/.index/_8.si | Bin 0 -> 371 bytes .../src/test/repo-release/.index/_8_Lucene41_0.doc | Bin 0 -> 21619 bytes .../src/test/repo-release/.index/_8_Lucene41_0.pos | Bin 0 -> 40037 bytes .../src/test/repo-release/.index/_8_Lucene41_0.tim | Bin 0 -> 91607 bytes .../src/test/repo-release/.index/_8_Lucene41_0.tip | Bin 0 -> 1250 bytes .../src/test/repo-release/.index/segments.gen | Bin 20 -> 36 bytes .../src/test/repo-release/.index/segments_8 | Bin 279 -> 0 bytes .../src/test/repo-release/.index/segments_9 | Bin 0 -> 102 bytes .../indexing/ArchivaIndexingTaskExecutor.java | 13 +- .../scheduler/indexing/ArtifactIndexingTask.java | 8 +- .../DefaultDownloadRemoteIndexScheduler.java | 29 +-- .../indexing/DefaultIndexUpdateSideEffect.java | 47 ++++ .../indexing/DownloadRemoteIndexTask.java | 27 +-- .../indexing/ArchivaIndexingTaskExecutorTest.java | 91 +++---- .../indexing/DownloadRemoteIndexTaskTest.java | 7 +- .../apache/archiva/web/startup/ArchivaStartup.java | 12 +- archiva-modules/archiva-web/archiva-webdav/pom.xml | 4 + archiva-modules/plugins/maven2-repository/pom.xml | 2 +- archiva-modules/plugins/metadata-store-jcr/pom.xml | 7 +- .../jcr/JcrRepositorySessionFactory.java | 8 +- .../filtered-resources/META-INF/spring-context.xml | 4 +- pom.xml | 34 ++- 37 files changed, 180 insertions(+), 418 deletions(-) delete mode 100644 archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_7.fdt delete mode 100644 archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_7.fdx delete mode 100644 archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_7.fnm delete mode 100644 archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_7.frq delete mode 100644 archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_7.nrm delete mode 100644 archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_7.prx delete mode 100644 archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_7.tii delete mode 100644 archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_7.tis create mode 100644 archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_8.fdt create mode 100644 archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_8.fdx create mode 100644 archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_8.fnm create mode 100644 archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_8.nvd create mode 100644 archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_8.nvm create mode 100644 archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_8.si create mode 100644 archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_8_Lucene41_0.doc create mode 100644 archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_8_Lucene41_0.pos create mode 100644 archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_8_Lucene41_0.tim create mode 100644 archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_8_Lucene41_0.tip delete mode 100644 archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/segments_8 create mode 100644 archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/segments_9 create mode 100644 archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/DefaultIndexUpdateSideEffect.java (limited to 'archiva-modules/archiva-base') diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/java/org/apache/archiva/consumers/lucene/NexusIndexerConsumerTest.java b/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/java/org/apache/archiva/consumers/lucene/NexusIndexerConsumerTest.java index 5ce2781cd..b5e688b88 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/java/org/apache/archiva/consumers/lucene/NexusIndexerConsumerTest.java +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/java/org/apache/archiva/consumers/lucene/NexusIndexerConsumerTest.java @@ -23,13 +23,14 @@ import junit.framework.TestCase; import org.apache.archiva.admin.model.beans.ManagedRepository; import org.apache.archiva.admin.model.managed.ManagedRepositoryAdmin; import org.apache.archiva.common.plexusbridge.MavenIndexerUtils; -import org.apache.archiva.common.plexusbridge.PlexusSisuBridge; import org.apache.archiva.configuration.ArchivaConfiguration; import org.apache.archiva.configuration.FileTypes; +import org.apache.archiva.redback.components.taskqueue.TaskQueueException; import org.apache.archiva.scheduler.ArchivaTaskScheduler; import org.apache.archiva.scheduler.indexing.ArtifactIndexingTask; +import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner; import org.apache.commons.io.FileUtils; -import org.apache.archiva.redback.components.taskqueue.TaskQueueException; +import org.apache.maven.index.NexusIndexer; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -45,7 +46,6 @@ import java.util.Date; import java.util.HashSet; import java.util.List; import java.util.Set; -import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner; /** * NexusIndexerConsumerTest @@ -58,7 +58,7 @@ public class NexusIndexerConsumerTest private final class ArchivaTaskSchedulerStub implements ArchivaTaskScheduler { - Set indexed = new HashSet(); + Set indexed = new HashSet<>(); @Override public void queueTask( ArtifactIndexingTask task ) @@ -96,7 +96,7 @@ public class NexusIndexerConsumerTest private ApplicationContext applicationContext; @Inject - private PlexusSisuBridge plexusSisuBridge; + private NexusIndexer nexusIndexer; @Inject private MavenIndexerUtils mavenIndexerUtils; @@ -119,8 +119,8 @@ public class NexusIndexerConsumerTest FileTypes filetypes = applicationContext.getBean( FileTypes.class ); nexusIndexerConsumer = - new NexusIndexerConsumer( scheduler, configuration, filetypes, plexusSisuBridge, mavenIndexerUtils, - managedRepositoryAdmin ); + new NexusIndexerConsumer( scheduler, configuration, filetypes, mavenIndexerUtils, + managedRepositoryAdmin, nexusIndexer ); // initialize to set the file types to be processed ( (NexusIndexerConsumer) nexusIndexerConsumer ).initialize(); diff --git a/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/archiva/indexer/search/MavenRepositorySearchTest.java b/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/archiva/indexer/search/MavenRepositorySearchTest.java index 4b0d993ef..8fb372850 100644 --- a/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/archiva/indexer/search/MavenRepositorySearchTest.java +++ b/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/archiva/indexer/search/MavenRepositorySearchTest.java @@ -22,6 +22,7 @@ package org.apache.archiva.indexer.search; import org.apache.archiva.common.utils.FileUtil; import org.apache.archiva.indexer.util.SearchUtil; import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner; +import org.apache.maven.index.shaded.lucene.index.IndexUpgrader; import org.codehaus.plexus.util.FileUtils; import org.easymock.EasyMock; import org.junit.Test; @@ -29,10 +30,7 @@ import org.junit.runner.RunWith; import org.springframework.test.context.ContextConfiguration; import java.io.File; -import java.nio.file.Files; -import java.nio.file.Path; import java.nio.file.Paths; -import java.nio.file.StandardCopyOption; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -40,8 +38,8 @@ import java.util.Collections; import java.util.List; -@RunWith(ArchivaSpringJUnit4ClassRunner.class) -@ContextConfiguration(locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context.xml" }) +@RunWith( ArchivaSpringJUnit4ClassRunner.class ) +@ContextConfiguration( locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context.xml" } ) public class MavenRepositorySearchTest extends AbstractMavenRepositorySearch { @@ -290,13 +288,13 @@ public class MavenRepositorySearchTest archivaConfigControl.replay(); - SearchResults results = search.search( "user", selectedRepos, "org", limits, Collections.emptyList() ); + SearchResults results = search.search( "user", selectedRepos, "org", limits, Collections.emptyList() ); archivaConfigControl.verify(); assertNotNull( results ); assertEquals( 1, results.getHits().size() ); - assertEquals( "total hits not 8 for page1 " + results, 8, results.getTotalHits() ); + assertEquals( "total hits not 9 for page1 " + results, 9, results.getTotalHits() ); assertEquals( "returned hits not 1 for page1 " + results, 1, results.getReturnedHitsCount() ); assertEquals( limits, results.getLimits() ); @@ -317,7 +315,7 @@ public class MavenRepositorySearchTest assertNotNull( results ); assertEquals( "hits not 1", 1, results.getHits().size() ); - assertEquals( "total hits not 8 for page 2 " + results, 8, results.getTotalHits() ); + assertEquals( "total hits not 9 for page 2 " + results, 9, results.getTotalHits() ); assertEquals( "returned hits not 1 for page2 " + results, 1, results.getReturnedHitsCount() ); assertEquals( limits, results.getLimits() ); } @@ -873,7 +871,9 @@ public class MavenRepositorySearchTest File indexDirectory = new File( repo, ".index" ); FileUtils.copyDirectoryStructure( new File( "src/test/repo-release" ), repo ); - createIndex( "repo-release", Collections.emptyList(), false ); + IndexUpgrader.main( new String[]{indexDirectory.getAbsolutePath()} ); + + createIndex( "repo-release", Collections.emptyList(), false ); nexusIndexer.addIndexingContext( REPO_RELEASE, REPO_RELEASE, repo, indexDirectory, repo.toURI().toURL().toExternalForm(), @@ -886,8 +886,9 @@ public class MavenRepositorySearchTest archivaConfigControl.replay(); - SearchResults searchResults = search.search( null, Arrays.asList( REPO_RELEASE ), "org.example", limits, - Collections.emptyList() ); + SearchResults searchResults = search.search( null, Arrays.asList( REPO_RELEASE ), // + "org.example", limits, // + Collections.emptyList() ); log.info( "results: {}", searchResults.getHits().size() ); diff --git a/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_7.fdt b/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_7.fdt deleted file mode 100644 index 9c708cae2..000000000 Binary files a/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_7.fdt and /dev/null differ diff --git a/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_7.fdx b/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_7.fdx deleted file mode 100644 index 9c6ebd91b..000000000 Binary files a/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_7.fdx and /dev/null differ diff --git a/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_7.fnm b/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_7.fnm deleted file mode 100644 index b57e72100..000000000 --- a/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_7.fnm +++ /dev/null @@ -1,5 +0,0 @@ -þÿÿÿ -DESCRIPTORIDXINFOumigavgroupId -artifactIdversionp1c -classnamesBundle-SymbolicNameBundle-VersionExport-PackageExport-Service Bundle-NameImport-PackageRequire-Bundle -rootGroupsrootGroupsList allGroups allGroupsList \ No newline at end of file diff --git a/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_7.frq b/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_7.frq deleted file mode 100644 index d966170eb..000000000 --- a/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_7.frq +++ /dev/null @@ -1,262 +0,0 @@ -‡‹Y·%…5¥ÕõÙ‰ÃÕyq‘Ù•ãu•W£ …µù˧åÁ硽«¥£©õݹÃIñűµÓïû•å¡íãᣗÉ_óŸŸ›…#ës›§¯×ëŸû§¿³ÿÑ·Ñ+½­‰Õljõý—¿­‹1?©·¥—÷Çí;w奱‡ëÕ¯ñ…ͳūíßÓÝóÁ‡i§ƒgÉ‘K!µ)Í›ÉÇí­U¿ýÿÇ—Óé÷ÿ•§çõÝ×AÉ3¯±Ïû»½¯'ý{·«­“ÙË㩛뙓óù£‰¹“‘Ë9÷ùý±…ß“™£¡¥éÿëÏmÛ›·åßÕͽ™íÛ‘Ÿßáቅóïñ×=¹ÇQÏËeɃÁÇû÷±¿•™³ãçï‰û}ñÛëÓãÛÙ›«Á­7E¯÷‡ó£éõ½¡µ©­©ÅMÏkñͱ絋·Ã¹‹éѳ-“»Ñ³©ŸÅµ»¥Ý/ùÓ‘ÑÍGOááé]—»cËÅùÙ¯o¿ýC«§ÿ׃ïϹ‡×ƒ‘[™ Á“ ³Så‹ß‹ç¡—ÝŸ•»Ûƒ™µ‡  ©± 1e   åK^X¥••™…ù‘ 1e   åK^X¡í çåµß×ÑËÿ·½¯‘§¡™•‘…ùíçáÙÕÓÑÍ™·¯§ŸÉÅÁ½™‰…ýùõñíéåáÝÙÕÑÍÉÅÁ½¹µ­±©¡™•‘‰…ýùóëÛϽ “‡¥ õéãáÝ•…{Õɽ±£si_[W¥•OIC;3+#%    7/ 1 3  1u§ %    7        J]9$/@µ‡  ©± 1e   åK^X¥••™…ù‘ 1e   åK^X¡í çåµß×ÑËÿ·½¯‘§¡™•‘…ùíçáÙÕÓÑ™‰áÃ1“WëÍ™·¯§ŸÉÅÁ½™‰…ýùõñíéåáÝÙÕÑÍÉÅÁ½¹µ­±©¡™•‘‰…ýùóëÛϽ “‡¥ õéãáÝ•…{Õɽ±£si_[ËW#      5         '>"7,%%*(¥•OIC;3+# -        AÁ )  `L     / + )    1YO¯              'G?+ (,<½         3     )((  ! !1   7AÇ 9  |æ%    7/ 1 3   1u§       7     9MF$#5:!1   7AÇ 9  |æ%    7/ 1 3  1u§ %    7        J]9$/@µ‡ 9 ±`†t(6àI* P„E       =      9SV*64ç u77â*Šç u77â*Šæt.6âK* P†H¥••™…ù‘sßrÃœ¡'% _% = óeIŒí çsßåµç u77â*Šµß×ÑËÿ·½‘a‡ u17à*ˆ -       <      9-S%V*64rÞ§'1_% = ó{Iª¡™•‘…ùíçÙÕÓç u77â*Š™‰áÃ1“WëÍ '$ _% = ; ( tlM* `i:ç u77â*Š™·¯§ŸÉÅÁ½™‰…ýùõñíéåáÝÙÕÑÍÉÅÁ½¹µ­±©¡™•‘‰…ý       =      9SV*64ùrÞóÛÏ“‡õéãáÝ•…Õɱ£s'1_% = ó{Iª      = ­  # 1BnŒË       =      9SV*64W'1_% = ó{Iª !       3          .%(*$ "#¥•OI;3#       =      9SV*64ç u77â*Š'$ _% = ódIŒ -&0^$ <  :!7!†\*~µ‡ 9 ±         3     )((  ! ¥••™…ù‘¡í çåµß×ÑËÿ·½‘        3«    --$(q 1§¡™•‘…ùíçÙÕÓ         3     )((  ! Í™·¯§ŸÉÅÁ½ç u75Ô X™‰…ýùõñíéåáÝÙÕÑÍÉÅÁ½¹µ­±©¡™•‘‰…ý         3     )((  ! ùóÛÏ“‡õéãáÝ•…Õɱ£s         3     )((  !          3     )((  ! W         3     )((  ! ¥•OI;3#æ  ## ###t64Ô« ùX ü 1e    9(&4>h0 PL - - 1e    - - - - - - - - - -   - -   - - - - - - - - - - - - - - - - - - - - -    -9( - - - - - -& - -4 - - - - - - - - - ->!h0’ ¢PLŽ 1e    9(&4>h0r €PdLráç u75Ô X¢ Yæt64Ôx €X €¦       =      9SV* 64Ÿ qW÷™Vö˜Ý §§W÷™£ç u77â* Š §§ '1_% =   !!†N 'XVöZ8¦§¦  F - - - - - - - -           -                   4 - -      c    4 - -       d %m#•/ ¶ À!††%ê"         3     )((   ! W÷™§¦¦¦¦§0>   rÚ   "> 1¹2§§Vö˜§§§§Vö˜1 ?   sç! u ¹ ! ?   s#! ! z\ 6Z"¦W÷™ç u15Ô X ¦W÷[9§Þ§W÷™§ç u/5Ô X§§1 ?   sÛ ! #? 1¹×  -       <                                                     95S H ƒ ª' •1 J< yW÷[?¦Í™ßVçq(W÷™ 1e   åC ^XW÷[?¦VöZ01 ?   sÛ ! "? 1¹1 ?   sÚ ! "" 0 ¹W÷[?0>   rÏ  "R ¹-¦   >   r 4    1  zc^$ P2F.§IË $ 9A 1) „!W÷[?W÷[?½VöZ>0>   rË  9< ¹PW÷[?§         -   -  -    -  -       ,(    -  - !   -  - !9!(,d8$V1"./9+:W÷™§§ßy 7?1 ?   sç! #S 1¹§W÷™§§W÷™µÌ ˜ §W÷™       =         9S.V * 6!4$ -       <     94S :V >* @6 84 =1 ?   sç! [ ¹V -ö -Z> -¦W÷[?¦W÷[?Í™§¦§W÷[?0"   rÛ   #+ €-ÞW÷™µ 1e   6 Y=K^XVöZ9§W÷™Q§W÷Z?Í™¦s´+W0>   ræ  t 0 ¹.1 ?   sÚ ! #> 1¹¦¡ ) !ùˆ§ç u /7â* ˆ´¦9§¦Í™D£  A)Ò %oW÷™Vö˜§§§§½¦Ž¦0W÷Z?W÷™¦9W÷Z9Q¦0>   rG„   "# 0¹J0>   rF•   a ¹<§Wö[>Qñ§žpD‡ 4A+ )ÑV"J7W÷™§§§§¦1 ?   sç! "S 0¹WÉ k/W÷™      =      9SV* 64&W÷™´§Vö˜§¦W÷™§     - -     /               - - - - - - - - - - - - -  - -  - - - - - - - - - - - -&      - - - - - -J - &   - - - - - - - - - -#v‚C  ‚.!j „ ž£t¾ q ˜1 ?   sç! u ¹´§rÊt1 ?   sç! u ¹Vö˜W÷™Vö˜W÷[?¦W÷Z?V -ö -˜ -W÷™§¦ ÞW÷[?V† dZ>W÷™W÷™ 1e   åK^Xá¦W÷™Vö˜¦WË[ß1 ?   sç! #S ¹W÷Z8¦ '1_% = ; 0 †N BX ¦§¦1§W÷™W÷™sßµ§9ç u17â* ˆ!W÷[?W÷™§¦µ§ ! ?   s 4 ! 1  z"^ P"H!W÷[?§VÈj.ç u17â* ˆ    -  - - - -       - - - -%+$  $%+#§1 ?   sç! u ¹W÷[?̘§Vö˜W÷Z?§Vö˜§1 ?   sÛ ! a ¹áµ´¦ -¦µÞE£ 5A1)Ò VJ§¦¦Ì˜Í™Vö˜¦ ŽÌ˜§Vö˜W÷™   )   =  5   ?k, =CVöZ(Q1 ?   s­  ! " ( 0¹§W÷Z?¦Vö˜W÷™§¦W÷[?¦1 - 11¿ - 111111111120´111Ä%2´11[†)!ð( Ä Š( c' §* å î!!À"!«!Ò ò        € -   - - -   - -   -                   n     - -Ð -  n   - --¤ Þ%“#Á6J ¡ ²!òô%¦"…§ 1e     (  (=h/* 0'(C+W÷™Í™¦W÷™W÷“Wã•™§       =      9SV*64§§W÷™§¦Vö˜Vö˜§¦§¦æt06â-* 1ˆ 4W÷™§W÷™W÷™Wã•™rÊt§Vö’¦Þ̘¦ŽVöZ>Qצ§µW÷[)§W÷™1 - 11¿ - 111111111120´111Ä%2´11[†)!ð( Ä Š( c' §* ã î!!À"!«!Ò òµVö[>§§         3     )((   ! µrÊue§VöZ0QW÷™£¦§§µ      =    9SV* 64'µ0>   ræ  "R 0¹.¦                          ! %@B/9#! $!5B..Í™Vö˜ßVö[> 1e     9) '5>h0 PJ$£ ]0>   rÚ   "8 0¹!§¦§ç u5Ö  X Þ -  - 2  $* &( & &( #  3%%!"µ¦W÷[?Q¦      =    9SH '1:%§Vö˜V ö Z>        =      9SV*641 ?   s­  ! #( 1¹§¦§'1_% = ó{Iª )   I¬ ") 0jɧ       =           9S$V* 6 45VöZ>VöZ8         3     )((   ! W÷[9 1e    9) '7>h: * |W÷Z9W÷Z9ßVö’¦§Vö˜§1 ?   sÚ ! "8 ¹#§W÷Z?Q       < ¬   "  0Bn'£0§1 ?   sË ! ") ¹ 1 ?   sË! 9= ¹W÷™      =     9SV* 64¦Ž¦W÷™§§×W÷[9Qµ1  ?   s­ ! "(  0¹)W÷[?W÷“ 1e   åC ^X¦¦§Vö˜¦Ž - - 1e    - - - - - - - - - -   - -   - - - - - - - - - - - - - - - - - - - - -    -9( - - - - - -& - -4 - - - - - - - - - ->!h0’ ¢PLŽç u15Ô X      =      9SV* 64¦¦W÷™W÷™W÷™Í™§´§ -    & '"  (+§0>   ræ  t 0 -¹[´ 1 ?   sç! u ¹Í[?§¦Vö˜1 ?   sç! u ¹                            ,    RM0 T W'I [ mUN C hW÷Z -?§§Vö“¦D£ 4A)à!* ‚'W÷™§Vö“¦t 1e   åK^X -    - -  - -  - -     9 - -  - -%!!/*+  @-!u 1e   åK^X                  Ý  '  /($/@"  - -  - -2ô - -6 - -.D8/´æt64Ô X u 1e   åK^X 1e   åK^X 1e     9)'5>h0 PL                 Ý  '  /($/@#      3õ  7  /D8/´uu%      5õ  7   /S1°Jutu 1e   åK^X -  - - - - -  - - 8 - -  - -%.! :/ 3 . ;  @+-' 1e   åK^Xuut -0däJ^X "  - -  - -2ô - -6 - -.D8/´u -0däJ^-X 0·µ³±¯­«©§¥£¡Ÿ›™—•“‘‹…ÿùóíçåãßÛ×ÓÑÏËÇÿ½»·³¯«§£¡Ÿ›™—•“‘‹…ÿùóíçáÛÙ×ÕÓÑÏÍËÉÇÅÃÁ¿½»·³¯«§£Ÿ›™—•“‘‹‰‡…ƒÿýûù÷õóñïíëéçåãáßÝÛÙ×ÕÓÑÏÍËÉÇÅÃÁ¿½»¹·µ³±¯­«©§¡›™—•“‘‹‰‡…ƒÿýûù÷óïëçáÛÕÏÉý·±«¥Ÿ™“‡ûõïéãáßÝÛÕÏÉý·±«¥Ÿ›•‹…{wsoica_][YWUOIC=;93-+)# »³‡   ¯ 1e   åK^X£“ ‹“—ÿó 1e   åK^XŸí çã          !   !       ,%'+," ( (³ÛÓÏÇÿ³»«‹£Ÿ›—“‹ÿóíçÛ×ÕÓϛˋ›—³«£›Çÿ»—‡ƒ‹ÿû÷óïëçãßÛ×ÓÏËÇÿ»·³«¯§›—“‹‡ƒÿû÷ïçÛÏ·“‡ŸûïéãßÛ›‹…wÏ÷«oca]YU£“OI=9-)#™™••‘‘‰‰×קååáᥥÁWˉýñëÍÅÁ‰ýñë¥åßÙÓ—‘‹…ùí癉ƒÙ͵©SM7'!·‡ûïéáÙÿ¹‡ûïé¹±©¡£õãÝ×Ñ›•‰ƒ÷ëå—‡×˳§uQK5%µ±±­­©©¡¡™™••‘‘…ùí çåßÑ·½©¡¡™™••‘‘…ùíçÙÕÓÍ·¯§ŸÉŽ™™‰‰……••‘‘ýýùùõõññííééÝÝÙÙÕÕÑÑÍÍÉÉÅÅÁÁ½½¹¹µµ­­±±©©¡¡……ýýùùóáÛÕÏ™“‡õéãáÝ•…Õɱ¥sOI;3#         3    )((  ! !1   7AÇ 9  |æ%    7/ 1 3   1u§       7    9MF$ #5:!1   7AÇ 9  |æ%    7/ 1 3  1u§ %    7      J]9$ /@´†8°¤”Œ”˜„ø ì -æä´ÞÖÐʾ¶¼Œ¦ œ˜”Œ„øìæØÔÒœ˜ˆàÃ0’WëÌŒœ˜¶®¦žÈÄÀ¼˜ˆ„Œ€üøôðìèäàÜØÔÐÌÈÄÀ¼¸´¬°¨ ˜”Œˆ„€üøòÚÎ’†€ôèâàÜœ”„~ÔÈ°¢rËç u77Ø XV !       3         .%(*$ "#¤”NH:2"þÿÿ0þÿÿ0þÿÿ0                         a          !   !       ,%'+," ( (¹³·µ¯±«­§©£¥Ÿ¡›—™“•‘‹ƒÿ‰‡…÷õóýûùñïíëéçãåÝÛáßÕÓÙ×ÏÑÉÇÍËÅÃÁ¿»½µ³¹·±¯­«£¥§©Ÿ¡›—™“•‘‹ƒÿ‰‡…÷õóýûùñïíëéçåãáßÝÛ×ÙÕÓÑÏËÍÇÉÃÅ¿Á»½µ³¹·­«±¯¥£©§›¡Ÿ—™“‘•‹‡‰ƒ…ÿûý÷ùóõïñëíçéãåßáÛÝ×ÙÓÕÏÑËÍÇÉÃÅ¿Á»½·¹³µ¯±«­§©Ÿ›¥£¡—™“•‘‹‡‰ƒ…ÿûý÷ùñïõóíëéçßÝÛåãáÓÑÏÙ×ÕÍËÉÇÅÃÁ¿½»¹·µ³±¯­«©§¥£¡Ÿ—•“›™‹‰‡‘ÿýû…ƒóñïù÷õíëéçåãßáÛÝÓÑÏÙ×ÕÇÅÃÍËÉÁ¿½»¹·¯­«µ³±£¡Ÿ©§¥›“‘™—•‹‰‡…ƒ}{ywqousmkigeca_][YUWSQOMKIGECA?=9;1/-753+)'%#!       ;»%A80·    ){%%  1;70tI¥   *(/'þþþ0                            ;»%A80·    ){%%  1;70tI   *(/( \ No newline at end of file diff --git a/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_7.nrm b/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_7.nrm deleted file mode 100644 index 6579c2991..000000000 --- a/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_7.nrm +++ /dev/null @@ -1 +0,0 @@ -NRMÿ|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy|||xx||||y|y|yyxx||||||yxyyy|||y|yyyxxx||||||y|yxyx|yyyxxxyy||yyxx||||||yxyyy|||y|yyy|||yyy|||yyyxxxyyy|||yyy|||y|y|||||||yyy|||yyy|||yyy|||yyy|||xxxxxxyyyxxxxxxxxxyyyxxxyyy|||yyy|||yyxxyy||y|y|y|y|y|y|y|y|y|yyy|||y|y|y|y|y|y|y|y|y|y|y|y|y|y|y|y|y|y|y|y|y|y|y|y|y|xyxyxyy|yy||yy||yy||yy||y|y|y|y|y|yx||y|yyyxxx||||||yyy|||yyy|||y|y|y|y|y|y|yy||yyxxyy||y|||||yy||y|yy||yy||y|||||||yyy|||yyy|||xyxyxyxyxyxyxyxyxyy|xyy|||xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxyxyxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||y|y||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||y|y|y|y|y|y|y|y|y|||y|||y|y|y|y|y|y|y|y|y|y|y|y|y|y|y|y|y|y|y|y|y|y|y|y|y|y|y|y|y|||||||||||||||||||||||||||||||||||||||||||||||||||||||||y|y|y|y|y|y||||||||||||||||||||||||||y||||||||||||||||||||||||||y|y|y|y|y|y|y|y|y|y|||||||uvvvv|u|u||||vvvvvv|||||vvv|v||||||vvvvvv|w|||||||||||||vv||||vvvvvv|||||vvv|v|||vvv|||vvv|||||||||vvv|||vvv|v|vvvvvvv|||vvv|||vvvuuuvvvuuuvvv||||||||||||||||||||||||uuuvvvuuuvvv||||||vv|t|t|t|t|u|u|u|u|u|||tvv|t|t|t|t|t|t|t|t|t|t|t|t|t|t|u|u|t|t|t|t|t|t|t|t|t|t|t|t|t||vv||vv||vv||vv|v|w|v|v|v||vv|v||||||vvvvvv|||vvv|||vvv|t|t|t|t|t|t||wv||||||vv|vvvvv||wv|v||uv||vv|vvvvvvv|||vvv|||vvv|t|t|t|t|t|t|t|t|t|t|uu||||wxxxx|y|y||xxxx|xx||x|||xx||x|||xxxxx|xx||y|x|x||||xxx||xx||xxxx|xx||x|||xx||x|||xx||||xx||||xxx|||xx||||xx||x|xxx|xx||||xx||||xx|xxyxx|xxyxx||||xxx|||xxx|||xxx|||xxxxxyxx|xxyxx|||xx||xx|x|x|x|x|y|y|y|y|y|||xx||x|x|x|x|x|x|x|x|x|x|x|x|x|x|y|y|x|x|x|x|x|x|x|x|x|x|x|x|x||xx||xx||xx||xx|x|y|x|x|x|xxx|x|||xxxxx|xx||||xx||||xx||x|x|x|x|x|x||yx||xx||xx|xx|x|||y||x||yx||xx|xxx|xx||||xx||||xx||x|x|x|x|x|x|x|x|x|x|xx||||xxxxx|x|x||xxxyxxyx|x|||xxx|x|||xxxxyxxyx|x|x|x||||xxx||xx||xxxyxxyx|x|||xxx|x|||xxx|||xxx|||xxx|||xxx|||xxx|x|xxyxxyx|||xxx|||xxxyyxxyxyyxxyx|||xxx|||xxx|||xxx|||xxxyyxxyxyyxxyx||xx||xx|x|x|x|x|x|x|x|x|x|||xyx|x|x|x|x|x|x|x|x|x|x|x|x|x|x|x|x|x|x|x|x|x|x|x|x|x|x|x|x|x||xx||xx||xx||xx|x|x|x|x|x|xxx|x|||xxxxyxxyx|||xxx|||xxx|x|x|x|x|x|x||xy||xx||xx|xyxyx||xx|x||xy||xx|xxyxxyx|||xxx|||xxx|x|x|x|x|x|x|x|x|x|x|xy||||trrrr|q|q||||rwwrww|||||tww|t||||||rwwrww|u|||||||||||||qw||||rwwrww|||||tww|t|||tww|||tww|||||||||tww|||tww|t|trwwrww|||tww|||twwvvvrwwvvvrww||||||||||||||||||||||||vvvrwwvvvrww||||||tw|q|q|q|q|x|x|x|x|x|||qww|q|q|q|q|q|q|q|q|w|w|w|w|w|q|q|q|q|q|q|q|q|q|q|q|q|q|q|q|q||tw||tw||tw||tw|t|u|t|t|t||rr|t||||||rwwrww|||tww|||tww|q|q|q|q|q|q||tt||||||tw|twwww||xw|q||qw||tw|trwwrww|||tww|||tww|q|q|q|q|q|q|q|q|q|q|rv||||uuuuu|u|u||||uuuuuu|||||uuu|u||||||uuuuuu|u|||||||||||||uu||||uuuuuu|||||uuu|u|||uuu|||uuu|||||||||uuu|||uuu|u|uuuuuuu|||uuu|||uuuuuuuuuuuuuuu||||||||||||||||||||||||uuuuuuuuuuuu||||||uu|u|u|u|u|u|u|u|u|u|||uuu|u|u|u|u|u|u|u|u|u|u|u|u|u|u|u|u|u|u|u|u|u|u|u|u|u|u|u|u|u||uu||uu||uu||uu|u|u|u|u|u||uu|u||||||uuuuuu|||uuu|||uuu|u|u|u|u|u|u||uu||||||uu|uuuuu||uu|u||uu||uu|uuuuuuu|||uuu|||uuu|u|u|u|u|u|u|u|u|u|u|uu||||x||||||||||xx|||||||x|||||||||||xxx|||||||||x|x||||xxx||||||xx|||||||x|||||||||||||||||||||||xxx||||||||||||||||||||||||||||||||||yyy|||yyy||||||xxx|||xxx|||xxx|||xxxyyy|||yyy|||||xx|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||y|y|y|||||||||||||||||||||||||||||x|||||||xxx||||||||||||||||||||||||||||||||||||xx|||||||||||||||||||||||||||||||||||||||||||||y|y|y|y|y|y|y|y|y|||yy||||knnnn|l|l||rrnrtnrt|r|||krt|k|||rrrnrtnrt|g|r|r||||rrr||mr||rrnrtnrt|r|||krt|k|||krt|||krt|||rrr|||krt|||krt|k|knrtnrt|||krt|||krtrrtnrtrrtnrt|||rrr|||rrr|||rrr|||rrrrrtnrtrrtnrt||rr||kr|l|l|l|l|m|m|m|m|m|||lmm|l|l|l|l|l|l|l|l|m|m|m|m|m|l|l|l|l|l|l|l|l|l|l|l|l|l|l|l|l||mr||mr||mr||mr|m|m|n|n|g|rnn|k|||rrrnrtnrt|||krt|||krt|l|l|l|l|l|l||eo||rr||mr|lrtrt||tt|m||lm||kr|gnrtnrt|||krt|||krt|l|l|l|l|l|l|l|l|l|l|ir||||||||||w|w||ss|tt|tu|s||||tt|||||sss|tt|tu|||s|s||||sss|||p||ss|tt|tu|s||||tt||||||tt||||tt|||sss||||tt||||tt|||||tt|tu||||tt||||ttttt|ttttu|tu|||sss|||sss|||sss|||sssttt|ttttu|tu||ss|||t|w|w|w|w|w|w|w|w|w|||www|w|w|w|w|w|w|w|w|w|w|w|w|w|w|w|w|w|w|w|w|w|w|w|w|w|w|w|w|w|||||||||||||||||||||||||||s|||||||sss|tt|tu||||tt||||tt|w|w|w|w|w|w||||||ss||||||tttu||tt||||ww|||||||tt|tu||||tt||||tt|w|w|w|w|w|w|w|w|w|w||s||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| \ No newline at end of file diff --git a/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_7.prx b/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_7.prx deleted file mode 100644 index 601fb22d7..000000000 Binary files a/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_7.prx and /dev/null differ diff --git a/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_7.tii b/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_7.tii deleted file mode 100644 index 52941c7db..000000000 Binary files a/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_7.tii and /dev/null differ diff --git a/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_7.tis b/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_7.tis deleted file mode 100644 index d018fa672..000000000 Binary files a/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_7.tis and /dev/null differ diff --git a/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_8.fdt b/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_8.fdt new file mode 100644 index 000000000..9ab6d4d90 Binary files /dev/null and b/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_8.fdt differ diff --git a/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_8.fdx b/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_8.fdx new file mode 100644 index 000000000..a26fbfa6b Binary files /dev/null and b/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_8.fdx differ diff --git a/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_8.fnm b/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_8.fnm new file mode 100644 index 000000000..b9f92430c Binary files /dev/null and b/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_8.fnm differ diff --git a/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_8.nvd b/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_8.nvd new file mode 100644 index 000000000..d832c2f6f Binary files /dev/null and b/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_8.nvd differ diff --git a/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_8.nvm b/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_8.nvm new file mode 100644 index 000000000..a27cff81a Binary files /dev/null and b/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_8.nvm differ diff --git a/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_8.si b/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_8.si new file mode 100644 index 000000000..2539c768d Binary files /dev/null and b/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_8.si differ diff --git a/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_8_Lucene41_0.doc b/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_8_Lucene41_0.doc new file mode 100644 index 000000000..0a2394bd2 Binary files /dev/null and b/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_8_Lucene41_0.doc differ diff --git a/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_8_Lucene41_0.pos b/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_8_Lucene41_0.pos new file mode 100644 index 000000000..4d9bbaad5 Binary files /dev/null and b/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_8_Lucene41_0.pos differ diff --git a/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_8_Lucene41_0.tim b/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_8_Lucene41_0.tim new file mode 100644 index 000000000..ac8475263 Binary files /dev/null and b/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_8_Lucene41_0.tim differ diff --git a/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_8_Lucene41_0.tip b/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_8_Lucene41_0.tip new file mode 100644 index 000000000..d94d9c92b Binary files /dev/null and b/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_8_Lucene41_0.tip differ diff --git a/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/segments.gen b/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/segments.gen index e76c9033a..077a451a0 100644 Binary files a/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/segments.gen and b/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/segments.gen differ diff --git a/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/segments_8 b/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/segments_8 deleted file mode 100644 index 8d4ef95e8..000000000 Binary files a/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/segments_8 and /dev/null differ diff --git a/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/segments_9 b/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/segments_9 new file mode 100644 index 000000000..a01b84fd7 Binary files /dev/null and b/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/segments_9 differ diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/ArchivaIndexingTaskExecutor.java b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/ArchivaIndexingTaskExecutor.java index 478473e9a..67d05d1b5 100644 --- a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/ArchivaIndexingTaskExecutor.java +++ b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/ArchivaIndexingTaskExecutor.java @@ -51,7 +51,7 @@ import java.io.IOException; * all performed by this executor. Add and update artifact in index tasks are added in the indexing task queue by the * NexusIndexerConsumer while remove artifact from index tasks are added by the LuceneCleanupRemoveIndexedConsumer. */ -@Service ( "taskExecutor#indexing" ) +@Service( "taskExecutor#indexing" ) public class ArchivaIndexingTaskExecutor implements TaskExecutor { @@ -112,9 +112,10 @@ public class ArchivaIndexingTaskExecutor { try { - log.debug( "Creating indexing context on resource: {}", ( indexingTask.getResourceFile() == null - ? "none" - : indexingTask.getResourceFile().getPath() ) ); + log.debug( "Creating indexing context on resource: {}", // + ( indexingTask.getResourceFile() == null + ? "none" + : indexingTask.getResourceFile().getPath() ) ); context = managedRepositoryAdmin.createIndexContext( repository ); } catch ( RepositoryAdminException e ) @@ -233,8 +234,10 @@ public class ArchivaIndexingTaskExecutor { IndexPackingRequest request = new IndexPackingRequest( context, // - context.acquireIndexSearcher().getIndexReader(), // + context.acquireIndexSearcher().getIndexReader(), + // context.getIndexDirectoryFile() ); + indexPacker.packIndex( request ); context.updateTimestamp( true ); diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/ArtifactIndexingTask.java b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/ArtifactIndexingTask.java index 0029bc096..2da5ab779 100644 --- a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/ArtifactIndexingTask.java +++ b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/ArtifactIndexingTask.java @@ -20,8 +20,8 @@ package org.apache.archiva.scheduler.indexing; */ import org.apache.archiva.admin.model.beans.ManagedRepository; -import org.apache.maven.index.context.IndexingContext; import org.apache.archiva.redback.components.taskqueue.Task; +import org.apache.maven.index.context.IndexingContext; import java.io.File; @@ -79,8 +79,14 @@ public class ArtifactIndexingTask } public void setExecuteOnEntireRepo( boolean executeOnEntireRepo ) + { + this.executeOnEntireRepo( executeOnEntireRepo ); + } + + public ArtifactIndexingTask executeOnEntireRepo( boolean executeOnEntireRepo ) { this.executeOnEntireRepo = executeOnEntireRepo; + return this; } @Override diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/DefaultDownloadRemoteIndexScheduler.java b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/DefaultDownloadRemoteIndexScheduler.java index 42a6b72a6..a3930c6d5 100644 --- a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/DefaultDownloadRemoteIndexScheduler.java +++ b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/DefaultDownloadRemoteIndexScheduler.java @@ -57,7 +57,7 @@ import java.util.concurrent.CopyOnWriteArrayList; * @author Olivier Lamy * @since 1.4-M1 */ -@Service ("downloadRemoteIndexScheduler#default") +@Service( "downloadRemoteIndexScheduler#default" ) public class DefaultDownloadRemoteIndexScheduler implements ConfigurationListener, DownloadRemoteIndexScheduler { @@ -65,7 +65,7 @@ public class DefaultDownloadRemoteIndexScheduler private Logger log = LoggerFactory.getLogger( getClass() ); @Inject - @Named (value = "taskScheduler#indexDownloadRemote") + @Named( value = "taskScheduler#indexDownloadRemote" ) private TaskScheduler taskScheduler; @Inject @@ -83,16 +83,16 @@ public class DefaultDownloadRemoteIndexScheduler @Inject private NetworkProxyAdmin networkProxyAdmin; - @Inject - private PlexusSisuBridge plexusSisuBridge; - @Inject private MavenIndexerUtils mavenIndexerUtils; + @Inject private NexusIndexer nexusIndexer; + @Inject private IndexUpdater indexUpdater; + @Inject private IndexPacker indexPacker; // store ids about currently running remote download : updated in DownloadRemoteIndexTask @@ -106,12 +106,6 @@ public class DefaultDownloadRemoteIndexScheduler archivaConfiguration.addListener( this ); // TODO add indexContexts even if null - nexusIndexer = plexusSisuBridge.lookup( NexusIndexer.class ); - - indexUpdater = plexusSisuBridge.lookup( IndexUpdater.class ); - - this.indexPacker = plexusSisuBridge.lookup( IndexPacker.class ); - for ( RemoteRepository remoteRepository : remoteRepositoryAdmin.getRemoteRepositories() ) { String contextKey = "remote-" + remoteRepository.getId(); @@ -180,11 +174,14 @@ public class DefaultDownloadRemoteIndexScheduler } } - DownloadRemoteIndexTaskRequest downloadRemoteIndexTaskRequest = - new DownloadRemoteIndexTaskRequest().setRemoteRepository( remoteRepository ).setNetworkProxy( - networkProxy ).setFullDownload( fullDownload ).setWagonFactory( - wagonFactory ).setRemoteRepositoryAdmin( remoteRepositoryAdmin ).setIndexUpdater( - indexUpdater ).setIndexPacker( this.indexPacker ); + DownloadRemoteIndexTaskRequest downloadRemoteIndexTaskRequest = new DownloadRemoteIndexTaskRequest() // + .setRemoteRepository( remoteRepository ) // + .setNetworkProxy( networkProxy ) // + .setFullDownload( fullDownload ) // + .setWagonFactory( wagonFactory ) // + .setRemoteRepositoryAdmin( remoteRepositoryAdmin ) // + .setIndexUpdater( indexUpdater ) // + .setIndexPacker( this.indexPacker ); if ( now ) { diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/DefaultIndexUpdateSideEffect.java b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/DefaultIndexUpdateSideEffect.java new file mode 100644 index 000000000..d6a29c9c7 --- /dev/null +++ b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/DefaultIndexUpdateSideEffect.java @@ -0,0 +1,47 @@ +package org.apache.archiva.scheduler.indexing; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import org.apache.maven.index.context.IndexingContext; +import org.apache.maven.index.shaded.lucene.store.Directory; +import org.apache.maven.index.updater.IndexUpdateSideEffect; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; + +/** + * Not doing much but required at least one implementation + * + * @since 3.0.0 + */ +@Service +public class DefaultIndexUpdateSideEffect + implements IndexUpdateSideEffect +{ + private static final Logger LOGGER = LoggerFactory.getLogger( DefaultIndexUpdateSideEffect.class ); + + @Override + public void updateIndex( Directory directory, IndexingContext indexingContext, boolean b ) + { + LOGGER.info( "updating index: {} with directory: {}", // + indexingContext.getId(), // + directory.toString() ); + } +} diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/DownloadRemoteIndexTask.java b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/DownloadRemoteIndexTask.java index f8fd42a24..436e7bb0b 100644 --- a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/DownloadRemoteIndexTask.java +++ b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/DownloadRemoteIndexTask.java @@ -196,32 +196,7 @@ public class DownloadRemoteIndexTask indexingContext.updateTimestamp( true ); } - catch ( MalformedURLException e ) - { - log.error( e.getMessage(), e ); - throw new RuntimeException( e.getMessage(), e ); - } - catch ( WagonFactoryException e ) - { - log.error( e.getMessage(), e ); - throw new RuntimeException( e.getMessage(), e ); - } - catch ( ConnectionException e ) - { - log.error( e.getMessage(), e ); - throw new RuntimeException( e.getMessage(), e ); - } - catch ( AuthenticationException e ) - { - log.error( e.getMessage(), e ); - throw new RuntimeException( e.getMessage(), e ); - } - catch ( IOException e ) - { - log.error( e.getMessage(), e ); - throw new RuntimeException( e.getMessage(), e ); - } - catch ( RepositoryAdminException e ) + catch ( Exception e ) { log.error( e.getMessage(), e ); throw new RuntimeException( e.getMessage(), e ); diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/test/java/org/apache/archiva/scheduler/indexing/ArchivaIndexingTaskExecutorTest.java b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/test/java/org/apache/archiva/scheduler/indexing/ArchivaIndexingTaskExecutorTest.java index 1f07c52ac..044ed87fd 100644 --- a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/test/java/org/apache/archiva/scheduler/indexing/ArchivaIndexingTaskExecutorTest.java +++ b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/test/java/org/apache/archiva/scheduler/indexing/ArchivaIndexingTaskExecutorTest.java @@ -25,10 +25,6 @@ import org.apache.archiva.admin.model.managed.ManagedRepositoryAdmin; import org.apache.archiva.common.plexusbridge.MavenIndexerUtils; import org.apache.archiva.common.plexusbridge.PlexusSisuBridge; import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner; -import org.apache.lucene.search.BooleanClause.Occur; -import org.apache.lucene.search.BooleanQuery; -import org.apache.lucene.search.IndexSearcher; -import org.apache.lucene.search.TopDocs; import org.apache.maven.index.ArtifactInfo; import org.apache.maven.index.FlatSearchRequest; import org.apache.maven.index.FlatSearchResponse; @@ -37,6 +33,12 @@ import org.apache.maven.index.NexusIndexer; import org.apache.maven.index.context.IndexingContext; import org.apache.maven.index.expr.SourcedSearchExpression; import org.apache.maven.index.expr.StringSearchExpression; +import org.apache.maven.index.shaded.lucene.search.BooleanClause; +import org.apache.maven.index.shaded.lucene.search.BooleanQuery; +import org.apache.maven.index.shaded.lucene.search.IndexSearcher; +import org.apache.maven.index.shaded.lucene.search.TopDocs; +import org.apache.maven.index.updater.IndexUpdateRequest; +import org.assertj.core.api.Assertions; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -54,6 +56,7 @@ import java.io.OutputStream; import java.nio.file.Files; import java.nio.file.Paths; import java.util.Set; +import java.util.zip.GZIPInputStream; import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; @@ -70,10 +73,8 @@ public class ArchivaIndexingTaskExecutorTest private ManagedRepository repositoryConfig; - private NexusIndexer indexer; - @Inject - PlexusSisuBridge plexusSisuBridge; + private NexusIndexer indexer; @Inject MavenIndexerUtils mavenIndexerUtils; @@ -98,8 +99,6 @@ public class ArchivaIndexingTaskExecutorTest repositoryConfig.setSnapshots( false ); repositoryConfig.setReleases( true ); - indexer = plexusSisuBridge.lookup( NexusIndexer.class ); - managedRepositoryAdmin.createIndexContext( repositoryConfig ); } @@ -147,10 +146,10 @@ public class ArchivaIndexingTaskExecutorTest BooleanQuery q = new BooleanQuery(); q.add( indexer.constructQuery( MAVEN.GROUP_ID, new StringSearchExpression( "org.apache.archiva" ) ), - Occur.SHOULD ); + BooleanClause.Occur.SHOULD ); q.add( indexer.constructQuery( MAVEN.ARTIFACT_ID, new StringSearchExpression( "archiva-index-methods-jar-test" ) ), - Occur.SHOULD ); + BooleanClause.Occur.SHOULD ); if ( !indexer.getIndexingContexts().containsKey( repositoryConfig.getId() ) ) { @@ -173,9 +172,9 @@ public class ArchivaIndexingTaskExecutorTest Set results = response.getResults(); ArtifactInfo artifactInfo = results.iterator().next(); - assertEquals( "org.apache.archiva", artifactInfo.groupId ); - assertEquals( "archiva-index-methods-jar-test", artifactInfo.artifactId ); - assertEquals( "test-repo", artifactInfo.repository ); + assertEquals( "org.apache.archiva", artifactInfo.getGroupId() ); + assertEquals( "archiva-index-methods-jar-test", artifactInfo.getArtifactId() ); + assertEquals( "test-repo", artifactInfo.getRepository() ); } @@ -195,10 +194,10 @@ public class ArchivaIndexingTaskExecutorTest BooleanQuery q = new BooleanQuery(); q.add( indexer.constructQuery( MAVEN.GROUP_ID, new StringSearchExpression( "org.apache.archiva" ) ), - Occur.SHOULD ); + BooleanClause.Occur.SHOULD ); q.add( indexer.constructQuery( MAVEN.ARTIFACT_ID, new StringSearchExpression( "archiva-index-methods-jar-test" ) ), - Occur.SHOULD ); + BooleanClause.Occur.SHOULD ); IndexingContext ctx = indexer.getIndexingContexts().get( repositoryConfig.getId() ); @@ -231,7 +230,7 @@ public class ArchivaIndexingTaskExecutorTest BooleanQuery q = new BooleanQuery(); q.add( indexer.constructQuery( MAVEN.GROUP_ID, new SourcedSearchExpression( "org.apache.archiva" ) ), - Occur.SHOULD ); + BooleanClause.Occur.SHOULD ); //q.add( // indexer.constructQuery( MAVEN.ARTIFACT_ID, new SourcedSearchExpression( "archiva-index-methods-jar-test" ) ), // Occur.SHOULD ); @@ -258,9 +257,10 @@ public class ArchivaIndexingTaskExecutorTest q = new BooleanQuery(); q.add( indexer.constructQuery( MAVEN.GROUP_ID, new SourcedSearchExpression( "org.apache.archiva" ) ), - Occur.SHOULD ); + BooleanClause.Occur.SHOULD ); q.add( indexer.constructQuery( MAVEN.ARTIFACT_ID, - new SourcedSearchExpression( "archiva-index-methods-jar-test" ) ), Occur.SHOULD + new SourcedSearchExpression( "archiva-index-methods-jar-test" ) ), + BooleanClause.Occur.SHOULD ); assertTrue( new File( repositoryConfig.getLocation(), ".indexer" ).exists() ); @@ -315,20 +315,26 @@ public class ArchivaIndexingTaskExecutorTest assertTrue( indexerDirectory.exists() ); // test packed index file creation - assertTrue( new File( indexerDirectory, "nexus-maven-repository-index.zip" ).exists() ); - assertTrue( new File( indexerDirectory, "nexus-maven-repository-index.properties" ).exists() ); - assertTrue( new File( indexerDirectory, "nexus-maven-repository-index.gz" ).exists() ); + //no more zip + //Assertions.assertThat(new File( indexerDirectory, "nexus-maven-repository-index.zip" )).exists(); + Assertions.assertThat(new File( indexerDirectory, "nexus-maven-repository-index.properties" )).exists(); + Assertions.assertThat(new File( indexerDirectory, "nexus-maven-repository-index.gz" )).exists(); // unpack .zip index File destDir = new File( repositoryConfig.getLocation(), ".indexer/tmp" ); unzipIndex( indexerDirectory.getPath(), destDir.getPath() ); + TrackingFetcher fetcher = new TrackingFetcher( remoteRepo ); + updateRequest = new IndexUpdateRequest( testContext, fetcher ); + updateRequest.setLocalIndexCacheDir( localCacheDir ); + updater.fetchAndUpdateIndex( updateRequest ); + BooleanQuery q = new BooleanQuery(); q.add( indexer.constructQuery( MAVEN.GROUP_ID, new StringSearchExpression( "org.apache.archiva" ) ), - Occur.SHOULD ); + BooleanClause.Occur.SHOULD ); q.add( indexer.constructQuery( MAVEN.ARTIFACT_ID, new StringSearchExpression( "archiva-index-methods-jar-test" ) ), - Occur.SHOULD ); + BooleanClause.Occur.SHOULD ); FlatSearchRequest request = new FlatSearchRequest( q, getIndexingContext() ); FlatSearchResponse response = indexer.searchFlat( request ); @@ -336,42 +342,11 @@ public class ArchivaIndexingTaskExecutorTest Set results = response.getResults(); ArtifactInfo artifactInfo = results.iterator().next(); - assertEquals( "org.apache.archiva", artifactInfo.groupId ); - assertEquals( "archiva-index-methods-jar-test", artifactInfo.artifactId ); - assertEquals( "test-repo", artifactInfo.repository ); + assertEquals( "org.apache.archiva", artifactInfo.getGroupId() ); + assertEquals( "archiva-index-methods-jar-test", artifactInfo.getArtifactId() ); + assertEquals( "test-repo", artifactInfo.getRepository() ); assertEquals( 1, response.getTotalHits() ); } - private void unzipIndex( String indexDir, String destDir ) - throws IOException - { - final int buff = 2048; - - Files.createDirectories( Paths.get( destDir ) ); - - try (InputStream fin = Files.newInputStream( Paths.get( indexDir, "nexus-maven-repository-index.zip" ) )) - { - ZipInputStream in = new ZipInputStream( new BufferedInputStream( fin ) ); - ZipEntry entry; - - while ( ( entry = in.getNextEntry() ) != null ) - { - int count; - byte data[] = new byte[buff]; - try (OutputStream fout = Files.newOutputStream( Paths.get( destDir, entry.getName() ) )) - { - try (BufferedOutputStream out = new BufferedOutputStream( fout, buff )) - { - - while ( ( count = in.read( data, 0, buff ) ) != -1 ) - { - out.write( data, 0, count ); - } - } - } - } - - } - } } diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/test/java/org/apache/archiva/scheduler/indexing/DownloadRemoteIndexTaskTest.java b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/test/java/org/apache/archiva/scheduler/indexing/DownloadRemoteIndexTaskTest.java index 7e95b4f26..c74c4957d 100644 --- a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/test/java/org/apache/archiva/scheduler/indexing/DownloadRemoteIndexTaskTest.java +++ b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/test/java/org/apache/archiva/scheduler/indexing/DownloadRemoteIndexTaskTest.java @@ -23,13 +23,13 @@ import org.apache.archiva.admin.model.remote.RemoteRepositoryAdmin; import org.apache.archiva.common.plexusbridge.PlexusSisuBridge; import org.apache.archiva.common.utils.FileUtil; import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner; -import org.apache.lucene.search.BooleanClause; -import org.apache.lucene.search.BooleanQuery; import org.apache.maven.index.FlatSearchRequest; import org.apache.maven.index.FlatSearchResponse; import org.apache.maven.index.MAVEN; import org.apache.maven.index.NexusIndexer; import org.apache.maven.index.expr.StringSearchExpression; +import org.apache.maven.index.shaded.lucene.search.BooleanClause; +import org.apache.maven.index.shaded.lucene.search.BooleanQuery; import org.eclipse.jetty.server.HttpConnectionFactory; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.ServerConnector; @@ -75,8 +75,6 @@ public class DownloadRemoteIndexTaskTest DefaultDownloadRemoteIndexScheduler downloadRemoteIndexScheduler; @Inject - PlexusSisuBridge plexusSisuBridge; - NexusIndexer nexusIndexer; @Before @@ -90,7 +88,6 @@ public class DownloadRemoteIndexTaskTest this.server.start(); this.port = serverConnector.getLocalPort(); log.info( "start server on port {}", this.port ); - nexusIndexer = plexusSisuBridge.lookup( NexusIndexer.class ); } protected void createContext( Server server, File repositoryDirectory ) diff --git a/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/startup/ArchivaStartup.java b/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/startup/ArchivaStartup.java index f82304243..1da71bc89 100644 --- a/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/startup/ArchivaStartup.java +++ b/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/startup/ArchivaStartup.java @@ -53,8 +53,6 @@ public class ArchivaStartup private DefaultRepositoryArchivaTaskScheduler repositoryTaskScheduler; - private PlexusSisuBridge plexusSisuBridge; - private NexusIndexer nexusIndexer; @Override @@ -74,16 +72,8 @@ public class ArchivaStartup tqeIndexing = wac.getBean( "taskQueueExecutor#indexing", ThreadedTaskQueueExecutor.class ); - plexusSisuBridge = wac.getBean( PlexusSisuBridge.class ); + nexusIndexer = wac.getBean( NexusIndexer.class ); - try - { - nexusIndexer = plexusSisuBridge.lookup( NexusIndexer.class ); - } - catch ( PlexusSisuBridgeException e ) - { - throw new RuntimeException( "Unable to get NexusIndexer: " + e.getMessage(), e ); - } try { securitySync.startup(); diff --git a/archiva-modules/archiva-web/archiva-webdav/pom.xml b/archiva-modules/archiva-web/archiva-webdav/pom.xml index 044b964e8..1a2887918 100644 --- a/archiva-modules/archiva-web/archiva-webdav/pom.xml +++ b/archiva-modules/archiva-web/archiva-webdav/pom.xml @@ -102,6 +102,10 @@ org.springframework spring-web + + org.apache.jackrabbit + jackrabbit-webdav + commons-io commons-io diff --git a/archiva-modules/plugins/maven2-repository/pom.xml b/archiva-modules/plugins/maven2-repository/pom.xml index 4c978436b..ab01552b5 100644 --- a/archiva-modules/plugins/maven2-repository/pom.xml +++ b/archiva-modules/plugins/maven2-repository/pom.xml @@ -277,7 +277,7 @@ test-repository - generate-test-resources + process-test-classes unpack-dependencies diff --git a/archiva-modules/plugins/metadata-store-jcr/pom.xml b/archiva-modules/plugins/metadata-store-jcr/pom.xml index 94eba17a2..fc6976c08 100644 --- a/archiva-modules/plugins/metadata-store-jcr/pom.xml +++ b/archiva-modules/plugins/metadata-store-jcr/pom.xml @@ -28,9 +28,6 @@ metadata-store-jcr bundle Archiva Core Plugins :: JCR Storage for Metadata - - 1.7.2 - org.apache.archiva @@ -65,12 +62,10 @@ org.apache.jackrabbit oak-jcr - ${jcr-oak.version} org.apache.jackrabbit oak-segment-tar - ${jcr-oak.version} org.apache.jackrabbit @@ -124,6 +119,7 @@ xercesImpl test + org.apache.lucene lucene-core @@ -169,6 +165,7 @@ lucene-analyzers-common ${lucene.version} + diff --git a/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrRepositorySessionFactory.java b/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrRepositorySessionFactory.java index 1c51dfc73..ed864639d 100644 --- a/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrRepositorySessionFactory.java +++ b/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrRepositorySessionFactory.java @@ -36,6 +36,8 @@ import javax.annotation.PostConstruct; import javax.inject.Inject; import javax.jcr.Repository; import javax.jcr.RepositoryException; +import java.nio.file.Path; +import java.nio.file.Paths; import java.util.HashMap; import java.util.Map; @@ -54,7 +56,6 @@ public class JcrRepositorySessionFactory private Map metadataFacetFactories; - @Inject private Repository repository; // Lazy evaluation to avoid problems with circular dependencies during initialization @@ -123,6 +124,11 @@ public class JcrRepositorySessionFactory JcrMetadataRepository metadataRepository = null; try { + RepositoryFactory factory = new RepositoryFactory(); + // FIXME this need to be configurable + Path directoryPath = Paths.get(System.getProperty( "appserver.base" ), "data/jcr"); + factory.setRepositoryPath( directoryPath ); + repository = factory.createRepository(); metadataRepository = new JcrMetadataRepository( metadataFacetFactories, repository ); JcrMetadataRepository.initialize( metadataRepository.getJcrSession() ); } diff --git a/archiva-modules/plugins/metadata-store-jcr/src/test/filtered-resources/META-INF/spring-context.xml b/archiva-modules/plugins/metadata-store-jcr/src/test/filtered-resources/META-INF/spring-context.xml index e3fa80bf2..c07cc52d5 100644 --- a/archiva-modules/plugins/metadata-store-jcr/src/test/filtered-resources/META-INF/spring-context.xml +++ b/archiva-modules/plugins/metadata-store-jcr/src/test/filtered-resources/META-INF/spring-context.xml @@ -19,8 +19,8 @@ --> + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> \ No newline at end of file diff --git a/pom.xml b/pom.xml index 48fbb9cb7..8d0e5424d 100644 --- a/pom.xml +++ b/pom.xml @@ -77,7 +77,9 @@ UTF-8 true 4.10.4 - 2.14.1 + + 1.7.2 + 2.15.4 3.0.3 10.13.1.1 @@ -285,6 +287,36 @@ archiva-indexer ${project.version} + + org.apache.jackrabbit + oak-jcr + ${jcr-oak.version} + + + org.apache.jackrabbit + oak-segment-tar + ${jcr-oak.version} + + + org.apache.jackrabbit + oak-lucene + ${jcr-oak.version} + + + org.apache.lucene + lucene-misc + + + org.apache.lucene + lucene-facet + + + + + org.apache.jackrabbit + jackrabbit-webdav + ${jackrabbit.version} + org.apache.maven.indexer indexer-reader -- cgit v1.2.3 From 8a76b9964151f850885e4d784fa86358d0148199 Mon Sep 17 00:00:00 2001 From: olivier lamy Date: Mon, 24 Jul 2017 14:56:21 +1000 Subject: more progress on oak lucene shaded Signed-off-by: olivier lamy --- .../consumers/lucene/NexusIndexerConsumer.java | 12 ++-- .../consumers/lucene/NexusIndexerConsumerTest.java | 8 +-- .../archiva/indexer/merger/DefaultIndexMerger.java | 24 +++---- .../indexer/search/MavenRepositorySearch.java | 64 ++++++------------ .../search/AbstractMavenRepositorySearch.java | 17 ++--- .../indexer/search/MavenRepositorySearchTest.java | 4 +- .../common/plexusbridge/MavenIndexerUtils.java | 77 ---------------------- .../managed/DefaultManagedRepositoryAdmin.java | 25 ------- .../DefaultDownloadRemoteIndexScheduler.java | 5 -- .../indexing/ArchivaIndexingTaskExecutorTest.java | 50 +++++++------- .../rest/services/DefaultRepositoriesService.java | 6 +- .../resources/META-INF/spring-context-test.xml | 2 + .../test/resources/spring-context-test-common.xml | 2 + .../src/test/resources/spring-context-with-jcr.xml | 2 + .../archiva/webdav/util/MavenIndexerCleaner.java | 14 +--- .../jcr/JcrRepositorySessionFactory.java | 2 +- .../src/test/resources/log4j2-test.xml | 9 +-- pom.xml | 6 ++ 18 files changed, 89 insertions(+), 240 deletions(-) delete mode 100644 archiva-modules/archiva-base/archiva-plexus-bridge/src/main/java/org/apache/archiva/common/plexusbridge/MavenIndexerUtils.java (limited to 'archiva-modules/archiva-base') diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/archiva/consumers/lucene/NexusIndexerConsumer.java b/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/archiva/consumers/lucene/NexusIndexerConsumer.java index c85a8fbea..69b9ba5b8 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/archiva/consumers/lucene/NexusIndexerConsumer.java +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/archiva/consumers/lucene/NexusIndexerConsumer.java @@ -22,9 +22,6 @@ package org.apache.archiva.consumers.lucene; 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.MavenIndexerUtils; -import org.apache.archiva.common.plexusbridge.PlexusSisuBridge; -import org.apache.archiva.common.plexusbridge.PlexusSisuBridgeException; import org.apache.archiva.configuration.ArchivaConfiguration; import org.apache.archiva.configuration.ConfigurationNames; import org.apache.archiva.configuration.FileTypes; @@ -32,13 +29,13 @@ import org.apache.archiva.consumers.AbstractMonitoredConsumer; import org.apache.archiva.consumers.ConsumerException; import org.apache.archiva.consumers.KnownRepositoryContentConsumer; import org.apache.archiva.redback.components.registry.Registry; +import org.apache.archiva.redback.components.registry.RegistryListener; +import org.apache.archiva.redback.components.taskqueue.TaskQueueException; import org.apache.archiva.scheduler.ArchivaTaskScheduler; import org.apache.archiva.scheduler.indexing.ArtifactIndexingTask; import org.apache.maven.index.NexusIndexer; import org.apache.maven.index.context.IndexCreator; import org.apache.maven.index.context.IndexingContext; -import org.apache.archiva.redback.components.registry.RegistryListener; -import org.apache.archiva.redback.components.taskqueue.TaskQueueException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.context.annotation.Scope; @@ -88,14 +85,13 @@ public class NexusIndexerConsumer public NexusIndexerConsumer( @Named( value = "archivaTaskScheduler#indexing" ) ArchivaTaskScheduler scheduler, @Named( value = "archivaConfiguration" ) ArchivaConfiguration configuration, FileTypes filetypes, - MavenIndexerUtils mavenIndexerUtils, - ManagedRepositoryAdmin managedRepositoryAdmin, NexusIndexer nexusIndexer ) + List indexCreators, ManagedRepositoryAdmin managedRepositoryAdmin, NexusIndexer nexusIndexer ) { this.configuration = configuration; this.filetypes = filetypes; this.scheduler = scheduler; this.nexusIndexer = nexusIndexer; - this.allIndexCreators = mavenIndexerUtils.getAllIndexCreators(); + this.allIndexCreators = indexCreators; this.managedRepositoryAdmin = managedRepositoryAdmin; } diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/java/org/apache/archiva/consumers/lucene/NexusIndexerConsumerTest.java b/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/java/org/apache/archiva/consumers/lucene/NexusIndexerConsumerTest.java index b5e688b88..91d0c107c 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/java/org/apache/archiva/consumers/lucene/NexusIndexerConsumerTest.java +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/java/org/apache/archiva/consumers/lucene/NexusIndexerConsumerTest.java @@ -22,7 +22,6 @@ package org.apache.archiva.consumers.lucene; import junit.framework.TestCase; import org.apache.archiva.admin.model.beans.ManagedRepository; import org.apache.archiva.admin.model.managed.ManagedRepositoryAdmin; -import org.apache.archiva.common.plexusbridge.MavenIndexerUtils; import org.apache.archiva.configuration.ArchivaConfiguration; import org.apache.archiva.configuration.FileTypes; import org.apache.archiva.redback.components.taskqueue.TaskQueueException; @@ -31,6 +30,7 @@ import org.apache.archiva.scheduler.indexing.ArtifactIndexingTask; import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner; import org.apache.commons.io.FileUtils; import org.apache.maven.index.NexusIndexer; +import org.apache.maven.index.context.IndexCreator; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -99,7 +99,7 @@ public class NexusIndexerConsumerTest private NexusIndexer nexusIndexer; @Inject - private MavenIndexerUtils mavenIndexerUtils; + private List indexCreators; @Inject private ManagedRepositoryAdmin managedRepositoryAdmin; @@ -119,11 +119,11 @@ public class NexusIndexerConsumerTest FileTypes filetypes = applicationContext.getBean( FileTypes.class ); nexusIndexerConsumer = - new NexusIndexerConsumer( scheduler, configuration, filetypes, mavenIndexerUtils, + new NexusIndexerConsumer( scheduler, configuration, filetypes, indexCreators, managedRepositoryAdmin, nexusIndexer ); // initialize to set the file types to be processed - ( (NexusIndexerConsumer) nexusIndexerConsumer ).initialize(); + nexusIndexerConsumer.initialize(); repositoryConfig = new ManagedRepository(); repositoryConfig.setId( "test-repo" ); diff --git a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/merger/DefaultIndexMerger.java b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/merger/DefaultIndexMerger.java index 663f0b63a..de9342c74 100644 --- a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/merger/DefaultIndexMerger.java +++ b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/merger/DefaultIndexMerger.java @@ -18,11 +18,10 @@ package org.apache.archiva.indexer.merger; * under the License. */ -import org.apache.archiva.common.plexusbridge.MavenIndexerUtils; -import org.apache.archiva.common.plexusbridge.PlexusSisuBridgeException; import org.apache.commons.io.FileUtils; import org.apache.commons.lang.time.StopWatch; import org.apache.maven.index.NexusIndexer; +import org.apache.maven.index.context.IndexCreator; import org.apache.maven.index.context.IndexingContext; import org.apache.maven.index.context.UnsupportedExistingLuceneIndexException; import org.apache.maven.index.packer.IndexPacker; @@ -50,23 +49,22 @@ public class DefaultIndexMerger private Logger log = LoggerFactory.getLogger( getClass() ); - private MavenIndexerUtils mavenIndexerUtils; + private final NexusIndexer indexer; - private NexusIndexer indexer; + private final IndexPacker indexPacker; - private IndexPacker indexPacker; + private final List indexCreators; private List temporaryGroupIndexes = new CopyOnWriteArrayList<>(); - private List runningGroups = new CopyOnWriteArrayList(); + private List runningGroups = new CopyOnWriteArrayList<>(); @Inject - public DefaultIndexMerger( NexusIndexer nexusIndexer, IndexPacker indexPacker, MavenIndexerUtils mavenIndexerUtils ) - throws PlexusSisuBridgeException + public DefaultIndexMerger( NexusIndexer nexusIndexer, IndexPacker indexPacker, List indexCreators ) { this.indexer = nexusIndexer; - this.mavenIndexerUtils = mavenIndexerUtils; this.indexPacker = indexPacker; + this.indexCreators = indexCreators; } @Override @@ -96,7 +94,7 @@ public class DefaultIndexMerger File indexLocation = new File( mergedIndexDirectory, indexMergerRequest.getMergedIndexPath() ); IndexingContext indexingContext = indexer.addIndexingContext( tempRepoId, tempRepoId, mergedIndexDirectory, indexLocation, null, null, - mavenIndexerUtils.getAllIndexCreators() ); + indexCreators ); for ( String repoId : indexMergerRequest.getRepositoriesIds() ) { @@ -127,11 +125,7 @@ public class DefaultIndexMerger stopWatch.getTime() ); return indexingContext; } - catch ( IOException e ) - { - throw new IndexMergerException( e.getMessage(), e ); - } - catch ( UnsupportedExistingLuceneIndexException e ) + catch ( IOException | UnsupportedExistingLuceneIndexException e ) { throw new IndexMergerException( e.getMessage(), e ); } diff --git a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/MavenRepositorySearch.java b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/MavenRepositorySearch.java index 64db78594..827eda035 100644 --- a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/MavenRepositorySearch.java +++ b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/MavenRepositorySearch.java @@ -24,11 +24,9 @@ import org.apache.archiva.admin.model.beans.ManagedRepository; 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.PlexusSisuBridgeException; import org.apache.archiva.indexer.util.SearchUtil; import org.apache.commons.lang.StringUtils; - import org.apache.maven.index.ArtifactInfo; import org.apache.maven.index.FlatSearchRequest; import org.apache.maven.index.FlatSearchResponse; @@ -77,8 +75,6 @@ public class MavenRepositorySearch private ProxyConnectorAdmin proxyConnectorAdmin; - private MavenIndexerUtils mavenIndexerUtils; - protected MavenRepositorySearch() { // for test purpose @@ -86,14 +82,12 @@ public class MavenRepositorySearch @Inject public MavenRepositorySearch( NexusIndexer nexusIndexer, ManagedRepositoryAdmin managedRepositoryAdmin, - MavenIndexerUtils mavenIndexerUtils, ProxyConnectorAdmin proxyConnectorAdmin, - QueryCreator queryCreator) + ProxyConnectorAdmin proxyConnectorAdmin, QueryCreator queryCreator ) throws PlexusSisuBridgeException { this.indexer = nexusIndexer; this.queryCreator = queryCreator; this.managedRepositoryAdmin = managedRepositoryAdmin; - this.mavenIndexerUtils = mavenIndexerUtils; this.proxyConnectorAdmin = proxyConnectorAdmin; } @@ -162,11 +156,9 @@ public class MavenRepositorySearch BooleanQuery q = new BooleanQuery(); if ( StringUtils.isNotBlank( searchFields.getGroupId() ) ) { - q.add( indexer.constructQuery( MAVEN.GROUP_ID, searchFields.isExactSearch() - ? new SourcedSearchExpression( searchFields.getGroupId() ) - : new UserInputSearchExpression( searchFields.getGroupId() ) - ), BooleanClause.Occur.MUST - ); + q.add( indexer.constructQuery( MAVEN.GROUP_ID, searchFields.isExactSearch() ? new SourcedSearchExpression( + searchFields.getGroupId() ) : new UserInputSearchExpression( searchFields.getGroupId() ) ), + BooleanClause.Occur.MUST ); } if ( StringUtils.isNotBlank( searchFields.getArtifactId() ) ) @@ -174,69 +166,64 @@ public class MavenRepositorySearch q.add( indexer.constructQuery( MAVEN.ARTIFACT_ID, searchFields.isExactSearch() ? new SourcedSearchExpression( searchFields.getArtifactId() ) - : new UserInputSearchExpression( searchFields.getArtifactId() ) - ), BooleanClause.Occur.MUST - ); + : new UserInputSearchExpression( searchFields.getArtifactId() ) ), + BooleanClause.Occur.MUST ); } if ( StringUtils.isNotBlank( searchFields.getVersion() ) ) { q.add( indexer.constructQuery( MAVEN.VERSION, searchFields.isExactSearch() ? new SourcedSearchExpression( - searchFields.getVersion() ) : new SourcedSearchExpression( searchFields.getVersion() ) ), BooleanClause.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() ) ), - BooleanClause.Occur.MUST - ); + BooleanClause.Occur.MUST ); } if ( StringUtils.isNotBlank( searchFields.getClassName() ) ) { q.add( indexer.constructQuery( MAVEN.CLASSNAMES, - new UserInputSearchExpression( searchFields.getClassName() ) ), BooleanClause.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() ) ), - BooleanClause.Occur.MUST - ); + BooleanClause.Occur.MUST ); } if ( StringUtils.isNotBlank( searchFields.getBundleVersion() ) ) { q.add( indexer.constructQuery( OSGI.VERSION, new UserInputSearchExpression( searchFields.getBundleVersion() ) ), - BooleanClause.Occur.MUST - ); + BooleanClause.Occur.MUST ); } if ( StringUtils.isNotBlank( searchFields.getBundleExportPackage() ) ) { q.add( indexer.constructQuery( OSGI.EXPORT_PACKAGE, new UserInputSearchExpression( searchFields.getBundleExportPackage() ) ), - Occur.MUST - ); + Occur.MUST ); } if ( StringUtils.isNotBlank( searchFields.getBundleExportService() ) ) { q.add( indexer.constructQuery( OSGI.EXPORT_SERVICE, new UserInputSearchExpression( searchFields.getBundleExportService() ) ), - Occur.MUST - ); + Occur.MUST ); } if ( StringUtils.isNotBlank( searchFields.getBundleImportPackage() ) ) { q.add( indexer.constructQuery( OSGI.IMPORT_PACKAGE, new UserInputSearchExpression( searchFields.getBundleImportPackage() ) ), - Occur.MUST - ); + Occur.MUST ); } if ( StringUtils.isNotBlank( searchFields.getBundleName() ) ) @@ -249,24 +236,21 @@ public class MavenRepositorySearch { q.add( indexer.constructQuery( OSGI.IMPORT_PACKAGE, new UserInputSearchExpression( searchFields.getBundleImportPackage() ) ), - Occur.MUST - ); + Occur.MUST ); } if ( StringUtils.isNotBlank( searchFields.getBundleRequireBundle() ) ) { q.add( indexer.constructQuery( OSGI.REQUIRE_BUNDLE, new UserInputSearchExpression( searchFields.getBundleRequireBundle() ) ), - Occur.MUST - ); + Occur.MUST ); } if ( StringUtils.isNotBlank( searchFields.getClassifier() ) ) { q.add( indexer.constructQuery( MAVEN.CLASSIFIER, searchFields.isExactSearch() ? new SourcedSearchExpression( searchFields.getClassifier() ) : new UserInputSearchExpression( searchFields.getClassifier() ) ), - Occur.MUST - ); + Occur.MUST ); } else if ( searchFields.isExactSearch() ) { @@ -283,7 +267,8 @@ public class MavenRepositorySearch searchFields.getRepositories(), searchFields.isIncludePomArtifacts() ); } - private static class NullSearch implements SearchTyped, SearchExpression + private static class NullSearch + implements SearchTyped, SearchExpression { private static final NullSearch INSTANCE = new NullSearch(); @@ -476,13 +461,6 @@ public class MavenRepositorySearch } - - protected List getAllIndexCreators() - { - return mavenIndexerUtils.getAllIndexCreators(); - } - - private SearchResults convertToSearchResults( FlatSearchResponse response, SearchResultLimits limits, List artifactInfoFilters, List selectedRepos, boolean includePoms ) diff --git a/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/archiva/indexer/search/AbstractMavenRepositorySearch.java b/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/archiva/indexer/search/AbstractMavenRepositorySearch.java index cab896bdb..e3b96f043 100644 --- a/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/archiva/indexer/search/AbstractMavenRepositorySearch.java +++ b/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/archiva/indexer/search/AbstractMavenRepositorySearch.java @@ -22,7 +22,6 @@ package org.apache.archiva.indexer.search; import junit.framework.TestCase; import org.apache.archiva.admin.repository.managed.DefaultManagedRepositoryAdmin; import org.apache.archiva.admin.repository.proxyconnector.DefaultProxyConnectorAdmin; -import org.apache.archiva.common.plexusbridge.MavenIndexerUtils; import org.apache.archiva.common.plexusbridge.PlexusSisuBridge; import org.apache.archiva.common.utils.FileUtil; import org.apache.archiva.configuration.ArchivaConfiguration; @@ -37,8 +36,8 @@ 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.IndexCreator; import org.apache.maven.index.context.IndexingContext; -import org.apache.maven.index.shaded.lucene.index.IndexUpgrader; import org.easymock.EasyMock; import org.easymock.IMocksControl; import org.junit.After; @@ -85,7 +84,7 @@ public abstract class AbstractMavenRepositorySearch PlexusSisuBridge plexusSisuBridge; @Inject - MavenIndexerUtils mavenIndexerUtils; + List indexCreators; @Inject NexusIndexer nexusIndexer; @@ -106,7 +105,7 @@ public abstract class AbstractMavenRepositorySearch FileUtils.deleteDirectory( new File( FileUtil.getBasedir(), "/target/repos/" + TEST_REPO_2 + "/.indexer" ) ); assertFalse( new File( FileUtil.getBasedir(), "/target/repos/" + TEST_REPO_2 + "/.indexer" ).exists() ); - archivaConfigControl = EasyMock.createControl( ); + archivaConfigControl = EasyMock.createControl(); archivaConfig = archivaConfigControl.createMock( ArchivaConfiguration.class ); @@ -116,12 +115,11 @@ public abstract class AbstractMavenRepositorySearch DefaultProxyConnectorAdmin defaultProxyConnectorAdmin = new DefaultProxyConnectorAdmin(); defaultProxyConnectorAdmin.setArchivaConfiguration( archivaConfig ); - search = new MavenRepositorySearch( nexusIndexer, defaultManagedRepositoryAdmin, mavenIndexerUtils, - defaultProxyConnectorAdmin, queryCreator ); + search = new MavenRepositorySearch( nexusIndexer, defaultManagedRepositoryAdmin, defaultProxyConnectorAdmin, + queryCreator ); - defaultManagedRepositoryAdmin.setMavenIndexerUtils( mavenIndexerUtils ); defaultManagedRepositoryAdmin.setIndexer( nexusIndexer ); - defaultManagedRepositoryAdmin.setIndexCreators( mavenIndexerUtils.getAllIndexCreators() ); + defaultManagedRepositoryAdmin.setIndexCreators( indexCreators ); config = new Configuration(); config.addManagedRepository( createRepositoryConfig( TEST_REPO_1 ) ); @@ -204,8 +202,7 @@ public abstract class AbstractMavenRepositorySearch context = nexusIndexer.addIndexingContext( repository, repository, repo, indexDirectory, repo.toURI().toURL().toExternalForm(), - indexDirectory.toURI().toURL().toString(), - search.getAllIndexCreators() ); + indexDirectory.toURI().toURL().toString(), indexCreators ); // minimize datas in memory // context.getIndexWriter().setMaxBufferedDocs( -1 ); diff --git a/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/archiva/indexer/search/MavenRepositorySearchTest.java b/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/archiva/indexer/search/MavenRepositorySearchTest.java index 8fb372850..77cddb8ee 100644 --- a/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/archiva/indexer/search/MavenRepositorySearchTest.java +++ b/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/archiva/indexer/search/MavenRepositorySearchTest.java @@ -871,13 +871,13 @@ public class MavenRepositorySearchTest File indexDirectory = new File( repo, ".index" ); FileUtils.copyDirectoryStructure( new File( "src/test/repo-release" ), repo ); - IndexUpgrader.main( new String[]{indexDirectory.getAbsolutePath()} ); + IndexUpgrader.main( new String[]{ indexDirectory.getAbsolutePath() } ); createIndex( "repo-release", Collections.emptyList(), false ); nexusIndexer.addIndexingContext( REPO_RELEASE, REPO_RELEASE, repo, indexDirectory, repo.toURI().toURL().toExternalForm(), - indexDirectory.toURI().toURL().toString(), search.getAllIndexCreators() ); + indexDirectory.toURI().toURL().toString(), indexCreators ); SearchResultLimits limits = new SearchResultLimits( SearchResultLimits.ALL_PAGES ); limits.setPageSize( 300 ); 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 deleted file mode 100644 index 7f86da4ff..000000000 --- a/archiva-modules/archiva-base/archiva-plexus-bridge/src/main/java/org/apache/archiva/common/plexusbridge/MavenIndexerUtils.java +++ /dev/null @@ -1,77 +0,0 @@ -package org.apache.archiva.common.plexusbridge; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -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 - * @since 1.4-M1 - */ -@Service( "mavenIndexerUtils" ) -public class MavenIndexerUtils -{ - - private Logger log = LoggerFactory.getLogger( getClass() ); - - private List allIndexCreators; - - private ApplicationContext applicationContext; - - @Inject - public MavenIndexerUtils(ApplicationContext applicationContext, Map 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" ); - } - - log.debug( "allIndexCreators {}", allIndexCreators ); - } - - public List getAllIndexCreators() - { - return allIndexCreators; - } - - public void setAllIndexCreators( List allIndexCreators ) - { - this.allIndexCreators = allIndexCreators; - } -} diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/managed/DefaultManagedRepositoryAdmin.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/managed/DefaultManagedRepositoryAdmin.java index ad90b4e82..7ba503cfb 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/managed/DefaultManagedRepositoryAdmin.java +++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/managed/DefaultManagedRepositoryAdmin.java @@ -23,9 +23,6 @@ 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.admin.repository.AbstractRepositoryAdmin; -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.configuration.Configuration; import org.apache.archiva.configuration.ManagedRepositoryConfiguration; import org.apache.archiva.configuration.ProxyConnectorConfiguration; @@ -95,9 +92,6 @@ public class DefaultManagedRepositoryAdmin @Inject private RepositoryStatisticsManager repositoryStatisticsManager; - @Inject - private MavenIndexerUtils mavenIndexerUtils; - @Inject protected RoleManager roleManager; @@ -116,15 +110,6 @@ public class DefaultManagedRepositoryAdmin public void initialize() throws RepositoryAdminException, RoleManagerException { -// try -// { -// indexCreators = mavenIndexerUtils.getAllIndexCreators(); -// indexer = plexusSisuBridge.lookup( NexusIndexer.class ); -// } -// catch ( PlexusSisuBridgeException e ) -// { -// throw new RepositoryAdminException( e.getMessage(), e ); -// } // initialize index context on start and check roles here for ( ManagedRepository managedRepository : getManagedRepositories() ) { @@ -817,16 +802,6 @@ public class DefaultManagedRepositoryAdmin this.repositoryTaskScheduler = repositoryTaskScheduler; } - public MavenIndexerUtils getMavenIndexerUtils() - { - return mavenIndexerUtils; - } - - public void setMavenIndexerUtils( MavenIndexerUtils mavenIndexerUtils ) - { - this.mavenIndexerUtils = mavenIndexerUtils; - } - public NexusIndexer getIndexer() { return indexer; diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/DefaultDownloadRemoteIndexScheduler.java b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/DefaultDownloadRemoteIndexScheduler.java index a3930c6d5..b1f39558b 100644 --- a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/DefaultDownloadRemoteIndexScheduler.java +++ b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/DefaultDownloadRemoteIndexScheduler.java @@ -25,8 +25,6 @@ import org.apache.archiva.admin.model.networkproxy.NetworkProxyAdmin; import org.apache.archiva.admin.model.proxyconnector.ProxyConnectorAdmin; import org.apache.archiva.admin.model.remote.RemoteRepositoryAdmin; import org.apache.archiva.common.ArchivaException; -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.configuration.ArchivaConfiguration; import org.apache.archiva.configuration.ConfigurationEvent; @@ -83,9 +81,6 @@ public class DefaultDownloadRemoteIndexScheduler @Inject private NetworkProxyAdmin networkProxyAdmin; - @Inject - private MavenIndexerUtils mavenIndexerUtils; - @Inject private NexusIndexer nexusIndexer; diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/test/java/org/apache/archiva/scheduler/indexing/ArchivaIndexingTaskExecutorTest.java b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/test/java/org/apache/archiva/scheduler/indexing/ArchivaIndexingTaskExecutorTest.java index 044ed87fd..b9ad48c68 100644 --- a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/test/java/org/apache/archiva/scheduler/indexing/ArchivaIndexingTaskExecutorTest.java +++ b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/test/java/org/apache/archiva/scheduler/indexing/ArchivaIndexingTaskExecutorTest.java @@ -22,14 +22,13 @@ package org.apache.archiva.scheduler.indexing; import junit.framework.TestCase; import org.apache.archiva.admin.model.beans.ManagedRepository; import org.apache.archiva.admin.model.managed.ManagedRepositoryAdmin; -import org.apache.archiva.common.plexusbridge.MavenIndexerUtils; -import org.apache.archiva.common.plexusbridge.PlexusSisuBridge; import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner; import org.apache.maven.index.ArtifactInfo; import org.apache.maven.index.FlatSearchRequest; import org.apache.maven.index.FlatSearchResponse; import org.apache.maven.index.MAVEN; import org.apache.maven.index.NexusIndexer; +import org.apache.maven.index.context.IndexCreator; import org.apache.maven.index.context.IndexingContext; import org.apache.maven.index.expr.SourcedSearchExpression; import org.apache.maven.index.expr.StringSearchExpression; @@ -37,7 +36,9 @@ import org.apache.maven.index.shaded.lucene.search.BooleanClause; import org.apache.maven.index.shaded.lucene.search.BooleanQuery; import org.apache.maven.index.shaded.lucene.search.IndexSearcher; import org.apache.maven.index.shaded.lucene.search.TopDocs; +import org.apache.maven.index.updater.DefaultIndexUpdater; import org.apache.maven.index.updater.IndexUpdateRequest; +import org.apache.maven.index.updater.IndexUpdater; import org.assertj.core.api.Assertions; import org.junit.After; import org.junit.Before; @@ -46,19 +47,10 @@ import org.junit.runner.RunWith; import org.springframework.test.context.ContextConfiguration; import javax.inject.Inject; -import java.io.BufferedInputStream; -import java.io.BufferedOutputStream; import java.io.File; import java.io.FilenameFilter; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.nio.file.Files; -import java.nio.file.Paths; +import java.util.List; import java.util.Set; -import java.util.zip.GZIPInputStream; -import java.util.zip.ZipEntry; -import java.util.zip.ZipInputStream; /** * ArchivaIndexingTaskExecutorTest @@ -77,11 +69,14 @@ public class ArchivaIndexingTaskExecutorTest private NexusIndexer indexer; @Inject - MavenIndexerUtils mavenIndexerUtils; + List indexCreators; @Inject ManagedRepositoryAdmin managedRepositoryAdmin; + @Inject + private IndexUpdater indexUpdater; + @Before @Override public void setUp() @@ -153,12 +148,12 @@ public class ArchivaIndexingTaskExecutorTest if ( !indexer.getIndexingContexts().containsKey( repositoryConfig.getId() ) ) { - IndexingContext context = indexer.addIndexingContext( repositoryConfig.getId(), repositoryConfig.getId(), - new File( repositoryConfig.getLocation() ), - new File( repositoryConfig.getLocation(), - ".indexer" ), null, null, - mavenIndexerUtils.getAllIndexCreators() - ); + IndexingContext context = indexer.addIndexingContext( repositoryConfig.getId(), // + repositoryConfig.getId(), // + new File( repositoryConfig.getLocation() ), // + new File( repositoryConfig.getLocation(), ".indexer" ) + // + , null, null, indexCreators ); context.setSearchable( true ); } @@ -260,8 +255,7 @@ public class ArchivaIndexingTaskExecutorTest BooleanClause.Occur.SHOULD ); q.add( indexer.constructQuery( MAVEN.ARTIFACT_ID, new SourcedSearchExpression( "archiva-index-methods-jar-test" ) ), - BooleanClause.Occur.SHOULD - ); + BooleanClause.Occur.SHOULD ); assertTrue( new File( repositoryConfig.getLocation(), ".indexer" ).exists() ); assertFalse( new File( repositoryConfig.getLocation(), ".index" ).exists() ); @@ -317,17 +311,17 @@ public class ArchivaIndexingTaskExecutorTest // test packed index file creation //no more zip //Assertions.assertThat(new File( indexerDirectory, "nexus-maven-repository-index.zip" )).exists(); - Assertions.assertThat(new File( indexerDirectory, "nexus-maven-repository-index.properties" )).exists(); - Assertions.assertThat(new File( indexerDirectory, "nexus-maven-repository-index.gz" )).exists(); + Assertions.assertThat( new File( indexerDirectory, "nexus-maven-repository-index.properties" ) ).exists(); + Assertions.assertThat( new File( indexerDirectory, "nexus-maven-repository-index.gz" ) ).exists(); // unpack .zip index File destDir = new File( repositoryConfig.getLocation(), ".indexer/tmp" ); - unzipIndex( indexerDirectory.getPath(), destDir.getPath() ); + //unzipIndex( indexerDirectory.getPath(), destDir.getPath() ); - TrackingFetcher fetcher = new TrackingFetcher( remoteRepo ); - updateRequest = new IndexUpdateRequest( testContext, fetcher ); - updateRequest.setLocalIndexCacheDir( localCacheDir ); - updater.fetchAndUpdateIndex( updateRequest ); + DefaultIndexUpdater.FileFetcher fetcher = new DefaultIndexUpdater.FileFetcher( indexerDirectory ); + IndexUpdateRequest updateRequest = new IndexUpdateRequest( getIndexingContext(), fetcher ); + //updateRequest.setLocalIndexCacheDir( indexerDirectory ); + indexUpdater.fetchAndUpdateIndex( updateRequest ); BooleanQuery q = new BooleanQuery(); q.add( indexer.constructQuery( MAVEN.GROUP_ID, new StringSearchExpression( "org.apache.archiva" ) ), diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoriesService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoriesService.java index e0660c269..bbb7416ce 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoriesService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoriesService.java @@ -23,16 +23,15 @@ import org.apache.archiva.admin.model.RepositoryAdminException; import org.apache.archiva.admin.model.admin.ArchivaAdministration; import org.apache.archiva.admin.model.beans.ManagedRepository; import org.apache.archiva.admin.model.managed.ManagedRepositoryAdmin; -import org.apache.archiva.metadata.model.facets.AuditEvent; import org.apache.archiva.checksum.ChecksumAlgorithm; import org.apache.archiva.checksum.ChecksummedFile; -import org.apache.archiva.common.plexusbridge.MavenIndexerUtils; import org.apache.archiva.common.plexusbridge.PlexusSisuBridge; import org.apache.archiva.common.utils.VersionComparator; import org.apache.archiva.common.utils.VersionUtil; import org.apache.archiva.maven2.metadata.MavenMetadataReader; import org.apache.archiva.maven2.model.Artifact; import org.apache.archiva.metadata.model.ArtifactMetadata; +import org.apache.archiva.metadata.model.facets.AuditEvent; import org.apache.archiva.metadata.model.maven2.MavenArtifactFacet; import org.apache.archiva.metadata.repository.MetadataRepository; import org.apache.archiva.metadata.repository.MetadataRepositoryException; @@ -125,9 +124,6 @@ public class DefaultRepositoriesService @Inject private PlexusSisuBridge plexusSisuBridge; - @Inject - private MavenIndexerUtils mavenIndexerUtils; - @Inject private SecuritySystem securitySystem; diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/resources/META-INF/spring-context-test.xml b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/resources/META-INF/spring-context-test.xml index 49c0748e1..830a3e6e3 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/resources/META-INF/spring-context-test.xml +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/resources/META-INF/spring-context-test.xml @@ -75,6 +75,7 @@ + diff --git a/archiva-modules/archiva-web/archiva-web-common/src/test/resources/spring-context-test-common.xml b/archiva-modules/archiva-web/archiva-web-common/src/test/resources/spring-context-test-common.xml index 3e8195d6a..d62446b45 100644 --- a/archiva-modules/archiva-web/archiva-web-common/src/test/resources/spring-context-test-common.xml +++ b/archiva-modules/archiva-web/archiva-web-common/src/test/resources/spring-context-test-common.xml @@ -72,6 +72,7 @@ + diff --git a/archiva-modules/archiva-web/archiva-web-common/src/test/resources/spring-context-with-jcr.xml b/archiva-modules/archiva-web/archiva-web-common/src/test/resources/spring-context-with-jcr.xml index 1e02fbcc7..6b72d332a 100644 --- a/archiva-modules/archiva-web/archiva-web-common/src/test/resources/spring-context-with-jcr.xml +++ b/archiva-modules/archiva-web/archiva-web-common/src/test/resources/spring-context-with-jcr.xml @@ -28,6 +28,7 @@ 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" default-lazy-init="true"> + diff --git a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/util/MavenIndexerCleaner.java b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/util/MavenIndexerCleaner.java index 079828fbe..cd59302e7 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/util/MavenIndexerCleaner.java +++ b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/util/MavenIndexerCleaner.java @@ -18,23 +18,18 @@ package org.apache.archiva.webdav.util; * under the License. */ -import org.apache.archiva.common.plexusbridge.PlexusSisuBridge; -import org.apache.archiva.common.plexusbridge.PlexusSisuBridgeException; import org.apache.maven.index.NexusIndexer; import org.apache.maven.index.context.IndexingContext; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.context.ApplicationContext; import org.springframework.stereotype.Service; -import org.springframework.web.context.WebApplicationContext; -import org.springframework.web.context.support.WebApplicationContextUtils; import javax.annotation.PostConstruct; import javax.annotation.PreDestroy; import javax.inject.Inject; import javax.servlet.ServletContextEvent; import javax.servlet.ServletContextListener; -import java.io.IOException; /** * @author Olivier Lamy @@ -46,15 +41,16 @@ public class MavenIndexerCleaner Logger log = LoggerFactory.getLogger( getClass() ); - private PlexusSisuBridge plexusSisuBridge; @Inject private ApplicationContext applicationContext; + @Inject + NexusIndexer nexusIndexer; + @PostConstruct public void startup() { - plexusSisuBridge = applicationContext.getBean( PlexusSisuBridge.class ); cleanupIndex(); } @@ -70,9 +66,6 @@ public class MavenIndexerCleaner { try { - WebApplicationContext wacu = - WebApplicationContextUtils.getRequiredWebApplicationContext( servletContextEvent.getServletContext() ); - plexusSisuBridge = wacu.getBean( PlexusSisuBridge.class ); cleanupIndex(); } @@ -103,7 +96,6 @@ public class MavenIndexerCleaner log.info( "cleanup IndexingContext" ); try { - NexusIndexer nexusIndexer = plexusSisuBridge.lookup( NexusIndexer.class ); for ( IndexingContext context : nexusIndexer.getIndexingContexts().values() ) { nexusIndexer.removeIndexingContext( context, true ); diff --git a/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrRepositorySessionFactory.java b/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrRepositorySessionFactory.java index ed864639d..fa502798d 100644 --- a/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrRepositorySessionFactory.java +++ b/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrRepositorySessionFactory.java @@ -98,7 +98,7 @@ public class JcrRepositorySessionFactory throws Exception { - // skip initialisation if not cassandra + // skip initialisation if not jcr if ( !StringUtils.equals( repositorySessionFactoryBean.getId(), "jcr" ) ) { return; diff --git a/archiva-modules/plugins/metadata-store-jcr/src/test/resources/log4j2-test.xml b/archiva-modules/plugins/metadata-store-jcr/src/test/resources/log4j2-test.xml index 74dd0773f..50dab921b 100644 --- a/archiva-modules/plugins/metadata-store-jcr/src/test/resources/log4j2-test.xml +++ b/archiva-modules/plugins/metadata-store-jcr/src/test/resources/log4j2-test.xml @@ -19,7 +19,7 @@ --> - + @@ -31,11 +31,8 @@ - - - - - + + diff --git a/pom.xml b/pom.xml index 8d0e5424d..46a0022d5 100644 --- a/pom.xml +++ b/pom.xml @@ -291,6 +291,12 @@ org.apache.jackrabbit oak-jcr ${jcr-oak.version} + + + ch.qos.logback + logback-classic + + org.apache.jackrabbit -- cgit v1.2.3 From 623eb062dab2b15b528707083f3b120217b5e8a3 Mon Sep 17 00:00:00 2001 From: olivier lamy Date: Fri, 28 Jul 2017 21:10:24 +1000 Subject: shaded package changed Signed-off-by: olivier lamy --- .../archiva-filelock/src/test/resources/log4j2-test.xml | 14 ++------------ .../archiva/indexer/search/MavenRepositorySearch.java | 7 +++---- .../archiva/indexer/search/MavenRepositorySearchTest.java | 2 +- .../scheduler/indexing/ArchivaIndexingTaskExecutor.java | 4 ++-- .../scheduler/indexing/DefaultIndexUpdateSideEffect.java | 2 +- .../indexing/ArchivaIndexingTaskExecutorTest.java | 8 ++++---- .../scheduler/indexing/DownloadRemoteIndexTaskTest.java | 5 ++--- 7 files changed, 15 insertions(+), 27 deletions(-) (limited to 'archiva-modules/archiva-base') diff --git a/archiva-modules/archiva-base/archiva-filelock/src/test/resources/log4j2-test.xml b/archiva-modules/archiva-base/archiva-filelock/src/test/resources/log4j2-test.xml index 93e519df7..f915e53b0 100644 --- a/archiva-modules/archiva-base/archiva-filelock/src/test/resources/log4j2-test.xml +++ b/archiva-modules/archiva-base/archiva-filelock/src/test/resources/log4j2-test.xml @@ -16,25 +16,15 @@ ~ KIND, either express or implied. See the License for the ~ specific language governing permissions and limitations ~ under the License. - --> - - +--> - - - - - - - - - + diff --git a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/MavenRepositorySearch.java b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/MavenRepositorySearch.java index 827eda035..0e4101648 100644 --- a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/MavenRepositorySearch.java +++ b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/MavenRepositorySearch.java @@ -35,15 +35,14 @@ import org.apache.maven.index.NexusIndexer; import org.apache.maven.index.OSGI; import org.apache.maven.index.QueryCreator; import org.apache.maven.index.SearchType; -import org.apache.maven.index.context.IndexCreator; import org.apache.maven.index.context.IndexingContext; 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.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; diff --git a/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/archiva/indexer/search/MavenRepositorySearchTest.java b/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/archiva/indexer/search/MavenRepositorySearchTest.java index 77cddb8ee..6d4f6acab 100644 --- a/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/archiva/indexer/search/MavenRepositorySearchTest.java +++ b/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/archiva/indexer/search/MavenRepositorySearchTest.java @@ -22,7 +22,7 @@ package org.apache.archiva.indexer.search; import org.apache.archiva.common.utils.FileUtil; import org.apache.archiva.indexer.util.SearchUtil; import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner; -import org.apache.maven.index.shaded.lucene.index.IndexUpgrader; +import org.apache.maven.index_shaded.lucene.index.IndexUpgrader; import org.codehaus.plexus.util.FileUtils; import org.easymock.EasyMock; import org.junit.Test; diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/ArchivaIndexingTaskExecutor.java b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/ArchivaIndexingTaskExecutor.java index 67d05d1b5..813f2c9b1 100644 --- a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/ArchivaIndexingTaskExecutor.java +++ b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/ArchivaIndexingTaskExecutor.java @@ -36,8 +36,8 @@ 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.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; diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/DefaultIndexUpdateSideEffect.java b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/DefaultIndexUpdateSideEffect.java index d6a29c9c7..0dcadd9d7 100644 --- a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/DefaultIndexUpdateSideEffect.java +++ b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/DefaultIndexUpdateSideEffect.java @@ -20,7 +20,7 @@ package org.apache.archiva.scheduler.indexing; */ import org.apache.maven.index.context.IndexingContext; -import org.apache.maven.index.shaded.lucene.store.Directory; +import org.apache.maven.index_shaded.lucene.store.Directory; import org.apache.maven.index.updater.IndexUpdateSideEffect; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/test/java/org/apache/archiva/scheduler/indexing/ArchivaIndexingTaskExecutorTest.java b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/test/java/org/apache/archiva/scheduler/indexing/ArchivaIndexingTaskExecutorTest.java index b9ad48c68..14bf7fc50 100644 --- a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/test/java/org/apache/archiva/scheduler/indexing/ArchivaIndexingTaskExecutorTest.java +++ b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/test/java/org/apache/archiva/scheduler/indexing/ArchivaIndexingTaskExecutorTest.java @@ -32,10 +32,10 @@ import org.apache.maven.index.context.IndexCreator; import org.apache.maven.index.context.IndexingContext; import org.apache.maven.index.expr.SourcedSearchExpression; import org.apache.maven.index.expr.StringSearchExpression; -import org.apache.maven.index.shaded.lucene.search.BooleanClause; -import org.apache.maven.index.shaded.lucene.search.BooleanQuery; -import org.apache.maven.index.shaded.lucene.search.IndexSearcher; -import org.apache.maven.index.shaded.lucene.search.TopDocs; +import org.apache.maven.index_shaded.lucene.search.BooleanClause; +import org.apache.maven.index_shaded.lucene.search.BooleanQuery; +import org.apache.maven.index_shaded.lucene.search.IndexSearcher; +import org.apache.maven.index_shaded.lucene.search.TopDocs; import org.apache.maven.index.updater.DefaultIndexUpdater; import org.apache.maven.index.updater.IndexUpdateRequest; import org.apache.maven.index.updater.IndexUpdater; diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/test/java/org/apache/archiva/scheduler/indexing/DownloadRemoteIndexTaskTest.java b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/test/java/org/apache/archiva/scheduler/indexing/DownloadRemoteIndexTaskTest.java index c74c4957d..ef0dd86ed 100644 --- a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/test/java/org/apache/archiva/scheduler/indexing/DownloadRemoteIndexTaskTest.java +++ b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/test/java/org/apache/archiva/scheduler/indexing/DownloadRemoteIndexTaskTest.java @@ -20,7 +20,6 @@ package org.apache.archiva.scheduler.indexing; import org.apache.archiva.admin.model.beans.RemoteRepository; import org.apache.archiva.admin.model.remote.RemoteRepositoryAdmin; -import org.apache.archiva.common.plexusbridge.PlexusSisuBridge; import org.apache.archiva.common.utils.FileUtil; import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner; import org.apache.maven.index.FlatSearchRequest; @@ -28,8 +27,8 @@ import org.apache.maven.index.FlatSearchResponse; import org.apache.maven.index.MAVEN; import org.apache.maven.index.NexusIndexer; import org.apache.maven.index.expr.StringSearchExpression; -import org.apache.maven.index.shaded.lucene.search.BooleanClause; -import org.apache.maven.index.shaded.lucene.search.BooleanQuery; +import org.apache.maven.index_shaded.lucene.search.BooleanClause; +import org.apache.maven.index_shaded.lucene.search.BooleanQuery; import org.eclipse.jetty.server.HttpConnectionFactory; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.ServerConnector; -- cgit v1.2.3 From 789f879c3bba01a8188416b7adf11d89291356f0 Mon Sep 17 00:00:00 2001 From: olivier lamy Date: Mon, 14 Aug 2017 17:20:12 +1000 Subject: fixing test for rest services, correctly close jcr repo Signed-off-by: olivier lamy --- .../apache/archiva/mock/MockRepositorySessionFactory.java | 6 ++++++ .../archiva-rest/archiva-rest-services/pom.xml | 3 ++- .../archiva/rest/services/AbstractArchivaRestTest.java | 3 +++ .../webtest/memory/TestRepositorySessionFactory.java | 6 ++++++ .../metadata/repository/RepositorySessionFactory.java | 2 ++ .../cassandra/CassandraRepositorySessionFactory.java | 6 ++++++ .../repository/file/FileRepositorySessionFactory.java | 15 ++++++--------- archiva-modules/plugins/metadata-store-jcr/pom.xml | 6 +++++- .../metadata/repository/jcr/RepositoryFactory.java | 8 ++++++-- .../metadata-store-jcr/src/test/resources/log4j2-test.xml | 4 +--- pom.xml | 2 +- 11 files changed, 44 insertions(+), 17 deletions(-) (limited to 'archiva-modules/archiva-base') diff --git a/archiva-modules/archiva-base/archiva-mock/src/main/java/org/apache/archiva/mock/MockRepositorySessionFactory.java b/archiva-modules/archiva-base/archiva-mock/src/main/java/org/apache/archiva/mock/MockRepositorySessionFactory.java index a1a27dcb9..d293d5247 100644 --- a/archiva-modules/archiva-base/archiva-mock/src/main/java/org/apache/archiva/mock/MockRepositorySessionFactory.java +++ b/archiva-modules/archiva-base/archiva-mock/src/main/java/org/apache/archiva/mock/MockRepositorySessionFactory.java @@ -73,4 +73,10 @@ public class MockRepositorySessionFactory } }; } + + @Override + public void close() + { + // no op + } } diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/pom.xml b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/pom.xml index f69d776d2..fd293fa26 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/pom.xml +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/pom.xml @@ -435,11 +435,12 @@ org.apache.maven.plugins maven-surefire-plugin + false **/*Tests.java **/*Test.java - -Xms1024m -Xmx2048m -server -XX:MaxPermSize=256m @{jacocoproperty} + -Xms1024m -Xmx3072m -server -XX:MaxPermSize=256m @{jacocoproperty} ${project.build.directory}/appserver-base ${project.build.directory}/appserver-base diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/AbstractArchivaRestTest.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/AbstractArchivaRestTest.java index 0d924f723..bc1b545ab 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/AbstractArchivaRestTest.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/AbstractArchivaRestTest.java @@ -45,6 +45,7 @@ import org.apache.commons.io.FileUtils; import org.apache.commons.lang.StringUtils; import org.apache.cxf.jaxrs.client.JAXRSClientFactory; import org.apache.cxf.jaxrs.client.WebClient; +import org.junit.After; import org.junit.Assume; import org.junit.Before; import org.junit.BeforeClass; @@ -77,6 +78,7 @@ public abstract class AbstractArchivaRestTest // END SNIPPET: authz-header + @BeforeClass public static void chekRepo() { @@ -102,6 +104,7 @@ public abstract class AbstractArchivaRestTest super.startServer(); } + private void removeAppsubFolder( File appServerBase, String folder ) throws Exception { diff --git a/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/webtest/memory/TestRepositorySessionFactory.java b/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/webtest/memory/TestRepositorySessionFactory.java index 0e10a5254..31e5a299a 100644 --- a/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/webtest/memory/TestRepositorySessionFactory.java +++ b/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/webtest/memory/TestRepositorySessionFactory.java @@ -55,4 +55,10 @@ public class TestRepositorySessionFactory { return this; } + + @Override + public void close() + { + // no op + } } diff --git a/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/RepositorySessionFactory.java b/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/RepositorySessionFactory.java index ff6be9517..ba2c585d8 100644 --- a/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/RepositorySessionFactory.java +++ b/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/RepositorySessionFactory.java @@ -22,4 +22,6 @@ package org.apache.archiva.metadata.repository; public interface RepositorySessionFactory { RepositorySession createSession(); + + void close(); } diff --git a/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraRepositorySessionFactory.java b/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraRepositorySessionFactory.java index d45e2cb10..2e434fc6e 100644 --- a/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraRepositorySessionFactory.java +++ b/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraRepositorySessionFactory.java @@ -82,4 +82,10 @@ public class CassandraRepositorySessionFactory return new RepositorySession( metadataRepository, metadataResolver ); } + + @Override + public void close() + { + cassandraArchivaManager.shutdown(); + } } diff --git a/archiva-modules/plugins/metadata-store-file/src/main/java/org/apache/archiva/metadata/repository/file/FileRepositorySessionFactory.java b/archiva-modules/plugins/metadata-store-file/src/main/java/org/apache/archiva/metadata/repository/file/FileRepositorySessionFactory.java index 0d63f4ee9..ce640fe1d 100644 --- a/archiva-modules/plugins/metadata-store-file/src/main/java/org/apache/archiva/metadata/repository/file/FileRepositorySessionFactory.java +++ b/archiva-modules/plugins/metadata-store-file/src/main/java/org/apache/archiva/metadata/repository/file/FileRepositorySessionFactory.java @@ -42,21 +42,12 @@ import java.util.Map; public class FileRepositorySessionFactory implements RepositorySessionFactory { - /** - * - */ private Map metadataFacetFactories; - /** - * - */ @Inject @Named( value = "archivaConfiguration#default" ) private ArchivaConfiguration configuration; - /** - * - */ @Inject private MetadataResolver metadataResolver; @@ -87,4 +78,10 @@ public class FileRepositorySessionFactory return new RepositorySession( metadataRepository, metadataResolver ); } + + @Override + public void close() + { + // no op + } } diff --git a/archiva-modules/plugins/metadata-store-jcr/pom.xml b/archiva-modules/plugins/metadata-store-jcr/pom.xml index fc6976c08..43522a0cd 100644 --- a/archiva-modules/plugins/metadata-store-jcr/pom.xml +++ b/archiva-modules/plugins/metadata-store-jcr/pom.xml @@ -165,7 +165,11 @@ lucene-analyzers-common ${lucene.version} - + + io.dropwizard.metrics + metrics-core + 3.1.0 + diff --git a/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/RepositoryFactory.java b/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/RepositoryFactory.java index c02e71f76..b1b821dc8 100644 --- a/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/RepositoryFactory.java +++ b/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/RepositoryFactory.java @@ -77,6 +77,8 @@ public class RepositoryFactory private FileStore fileStore; + private NodeStore nodeStore; + private ExecutorService executorService; public enum StoreType @@ -93,11 +95,13 @@ public class RepositoryFactory throws IOException, InvalidFileStoreVersionException { createExecutor(); - NodeStore nodeStore; + if ( SEGMENT_FILE_TYPE == storeType ) { fileStore = FileStoreBuilder.fileStoreBuilder( repositoryPath.toFile() ).build(); - nodeStore = SegmentNodeStoreBuilders.builder( fileStore ).build(); + nodeStore = SegmentNodeStoreBuilders.builder( fileStore ) // + .withStatisticsProvider( StatisticsProvider.NOOP ) // + .build(); } else if ( IN_MEMORY_TYPE == storeType ) { diff --git a/archiva-modules/plugins/metadata-store-jcr/src/test/resources/log4j2-test.xml b/archiva-modules/plugins/metadata-store-jcr/src/test/resources/log4j2-test.xml index 50dab921b..7f4b0cd9c 100644 --- a/archiva-modules/plugins/metadata-store-jcr/src/test/resources/log4j2-test.xml +++ b/archiva-modules/plugins/metadata-store-jcr/src/test/resources/log4j2-test.xml @@ -19,9 +19,7 @@ --> - - - + diff --git a/pom.xml b/pom.xml index 4dc86ac77..0a8fc1cf7 100644 --- a/pom.xml +++ b/pom.xml @@ -78,7 +78,7 @@ true 4.10.4 - 1.7.3 + 1.7.5 2.15.4 3.0.3 -- cgit v1.2.3 From 2351414ee6698951bef41e8dee63b09a9754cf3f Mon Sep 17 00:00:00 2001 From: olivier lamy Date: Tue, 15 Aug 2017 19:55:54 +1000 Subject: take care of too old repository Signed-off-by: olivier lamy --- .../managed/DefaultManagedRepositoryAdmin.java | 38 ++++++++++++++-------- .../remote/DefaultRemoteRepositoryAdmin.java | 36 +++++++++++++------- 2 files changed, 48 insertions(+), 26 deletions(-) (limited to 'archiva-modules/archiva-base') diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/managed/DefaultManagedRepositoryAdmin.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/managed/DefaultManagedRepositoryAdmin.java index 7ba503cfb..f7662ba25 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/managed/DefaultManagedRepositoryAdmin.java +++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/managed/DefaultManagedRepositoryAdmin.java @@ -46,6 +46,7 @@ import org.apache.maven.index.NexusIndexer; import org.apache.maven.index.context.IndexCreator; import org.apache.maven.index.context.IndexingContext; import org.apache.maven.index.context.UnsupportedExistingLuceneIndexException; +import org.apache.maven.index_shaded.lucene.index.IndexFormatTooOldException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; @@ -638,24 +639,33 @@ public class DefaultManagedRepositoryAdmin if ( context == null ) { - context = indexer.addIndexingContext( repository.getId(), repository.getId(), repositoryDirectory, - indexDirectory, - repositoryDirectory.toURI().toURL().toExternalForm(), - indexDirectory.toURI().toURL().toString(), indexCreators ); + try + { + context = indexer.addIndexingContext( repository.getId(), repository.getId(), repositoryDirectory, + indexDirectory, + repositoryDirectory.toURI().toURL().toExternalForm(), + indexDirectory.toURI().toURL().toString(), indexCreators ); - context.setSearchable( repository.isScanned() ); + context.setSearchable( repository.isScanned() ); + } + catch ( IndexFormatTooOldException e ) + { + // existing index with an old lucene format so we need to delete it!!! + // delete it first then recreate it. + log.warn( "the index of repository {} is too old we have to delete and recreate it", // + repository.getId() ); + FileUtils.deleteDirectory( indexDirectory ); + context = indexer.addIndexingContext( repository.getId(), repository.getId(), repositoryDirectory, + indexDirectory, + repositoryDirectory.toURI().toURL().toExternalForm(), + indexDirectory.toURI().toURL().toString(), indexCreators ); + + context.setSearchable( repository.isScanned() ); + } } return context; } - catch ( MalformedURLException e ) - { - throw new RepositoryAdminException( e.getMessage(), e ); - } - catch ( IOException e ) - { - throw new RepositoryAdminException( e.getMessage(), e ); - } - catch ( UnsupportedExistingLuceneIndexException e ) + catch ( IOException| UnsupportedExistingLuceneIndexException e ) { throw new RepositoryAdminException( e.getMessage(), e ); } diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/remote/DefaultRemoteRepositoryAdmin.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/remote/DefaultRemoteRepositoryAdmin.java index bf8d88b18..01f733767 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/remote/DefaultRemoteRepositoryAdmin.java +++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/remote/DefaultRemoteRepositoryAdmin.java @@ -23,16 +23,19 @@ import org.apache.archiva.admin.model.RepositoryAdminException; import org.apache.archiva.admin.model.beans.RemoteRepository; import org.apache.archiva.admin.model.remote.RemoteRepositoryAdmin; import org.apache.archiva.admin.repository.AbstractRepositoryAdmin; +import org.apache.archiva.common.utils.FileUtil; import org.apache.archiva.configuration.Configuration; import org.apache.archiva.configuration.ProxyConnectorConfiguration; import org.apache.archiva.configuration.RemoteRepositoryConfiguration; import org.apache.archiva.configuration.RepositoryCheckPath; import org.apache.archiva.metadata.model.facets.AuditEvent; +import org.apache.commons.io.FileUtils; import org.apache.commons.lang.StringUtils; import org.apache.maven.index.NexusIndexer; import org.apache.maven.index.context.IndexCreator; import org.apache.maven.index.context.IndexingContext; import org.apache.maven.index.context.UnsupportedExistingLuceneIndexException; +import org.apache.maven.index_shaded.lucene.index.IndexFormatTooOldException; import org.springframework.stereotype.Service; import javax.annotation.PostConstruct; @@ -304,19 +307,28 @@ public class DefaultRemoteRepositoryAdmin { indexDirectory.mkdirs(); } - return indexer.addIndexingContext( contextKey, remoteRepository.getId(), repoDir, indexDirectory, - remoteRepository.getUrl(), calculateIndexRemoteUrl( remoteRepository ), - indexCreators ); - } - catch ( MalformedURLException e ) - { - throw new RepositoryAdminException( e.getMessage(), e ); - } - catch ( IOException e ) - { - throw new RepositoryAdminException( e.getMessage(), e ); + + try + { + + return indexer.addIndexingContext( contextKey, remoteRepository.getId(), repoDir, indexDirectory, + remoteRepository.getUrl(), calculateIndexRemoteUrl( remoteRepository ), + indexCreators ); + } + catch ( IndexFormatTooOldException e ) + { + // existing index with an old lucene format so we need to delete it!!! + // delete it first then recreate it. + log.warn( "the index of repository {} is too old we have to delete and recreate it", // + remoteRepository.getId() ); + FileUtils.deleteDirectory( indexDirectory ); + return indexer.addIndexingContext( contextKey, remoteRepository.getId(), repoDir, indexDirectory, + remoteRepository.getUrl(), calculateIndexRemoteUrl( remoteRepository ), + indexCreators ); + + } } - catch ( UnsupportedExistingLuceneIndexException e ) + catch ( IOException | UnsupportedExistingLuceneIndexException e ) { throw new RepositoryAdminException( e.getMessage(), e ); } -- cgit v1.2.3 From ed1bfa3a90a4f9dd85a363ffbce613a3796511a7 Mon Sep 17 00:00:00 2001 From: olivier lamy Date: Thu, 17 Aug 2017 21:27:05 +1000 Subject: helping consumer archetype to build with an empty repo Signed-off-by: olivier lamy --- .../archiva-consumers/archiva-consumer-archetype/pom.xml | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'archiva-modules/archiva-base') diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/pom.xml b/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/pom.xml index f8af4626c..19ec789aa 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/pom.xml +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/pom.xml @@ -86,6 +86,11 @@ 1.9 test + + org.apache.lucene + lucene-core + 5.5.4 + -- cgit v1.2.3 From c2bb83aa1fd43fc255b9445544bf1fd39dedee9b Mon Sep 17 00:00:00 2001 From: olivier lamy Date: Fri, 18 Aug 2017 09:57:43 +1000 Subject: helping consumer archetype to build with an empty repo Signed-off-by: olivier lamy --- .../archiva-consumers/archiva-consumer-archetype/pom.xml | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'archiva-modules/archiva-base') diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/pom.xml b/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/pom.xml index 19ec789aa..529506da9 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/pom.xml +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/pom.xml @@ -91,6 +91,11 @@ lucene-core 5.5.4 + + org.apache.lucene + lucene-highlighter + 5.5.4 + -- cgit v1.2.3 From 03465a024d8f4fdc2ef611d3e2474d27661e649b Mon Sep 17 00:00:00 2001 From: olivier lamy Date: Fri, 18 Aug 2017 12:06:25 +1000 Subject: helping consumer archetype to build with an empty repo Signed-off-by: olivier lamy --- .../archiva-consumers/archiva-consumer-archetype/pom.xml | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'archiva-modules/archiva-base') diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/pom.xml b/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/pom.xml index 529506da9..892e7926a 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/pom.xml +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/pom.xml @@ -96,6 +96,11 @@ lucene-highlighter 5.5.4 + + org.apache.lucene + lucene-memory + 5.5.4 + -- cgit v1.2.3 From 053e5c1322758edb0cb814756249b71ae7c9d9b1 Mon Sep 17 00:00:00 2001 From: olivier lamy Date: Fri, 18 Aug 2017 14:26:08 +1000 Subject: helping consumer archetype to build with an empty repo Signed-off-by: olivier lamy --- .../archiva-consumers/archiva-consumer-archetype/pom.xml | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'archiva-modules/archiva-base') diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/pom.xml b/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/pom.xml index 892e7926a..bb331e01e 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/pom.xml +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/pom.xml @@ -101,6 +101,11 @@ lucene-memory 5.5.4 + + org.apache.lucene + lucene-queries + 5.5.4 + -- cgit v1.2.3 From 46ec7272042c9cfe228c475d95ebd1b2490b9c51 Mon Sep 17 00:00:00 2001 From: olivier lamy Date: Fri, 18 Aug 2017 14:38:45 +1000 Subject: inherit version from parent Signed-off-by: olivier lamy --- .../archiva-base/archiva-consumers/archiva-consumer-archetype/pom.xml | 4 ---- 1 file changed, 4 deletions(-) (limited to 'archiva-modules/archiva-base') diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/pom.xml b/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/pom.xml index bb331e01e..54d724377 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/pom.xml +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/pom.xml @@ -89,22 +89,18 @@ org.apache.lucene lucene-core - 5.5.4 org.apache.lucene lucene-highlighter - 5.5.4 org.apache.lucene lucene-memory - 5.5.4 org.apache.lucene lucene-queries - 5.5.4 -- cgit v1.2.3 From 88385088993b8121099f48371ce9e00689ccb547 Mon Sep 17 00:00:00 2001 From: olivier lamy Date: Fri, 18 Aug 2017 21:13:26 +1000 Subject: helping consumer archetype to build with an empty repo Signed-off-by: olivier lamy --- .../archiva-base/archiva-consumers/archiva-consumer-archetype/pom.xml | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'archiva-modules/archiva-base') diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/pom.xml b/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/pom.xml index 54d724377..bb331e01e 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/pom.xml +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/pom.xml @@ -89,18 +89,22 @@ org.apache.lucene lucene-core + 5.5.4 org.apache.lucene lucene-highlighter + 5.5.4 org.apache.lucene lucene-memory + 5.5.4 org.apache.lucene lucene-queries + 5.5.4 -- cgit v1.2.3