*/
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;
/**
private Logger log = LoggerFactory.getLogger( getClass() );
+ @Inject
private List<? extends IndexCreator> 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 );
default-lazy-init="true">
<context:annotation-config/>
- <context:component-scan base-package="org.apache.archiva.common.plexusbridge"/>
+ <context:component-scan base-package="org.apache.archiva.common.plexusbridge,org.apache.maven.index"/>
</beans>
\ No newline at end of file
<dependency>
<groupId>org.apache.maven.indexer</groupId>
<artifactId>indexer-core</artifactId>
- <exclusions>
- <exclusion>
- <groupId>org.sonatype.sisu</groupId>
- <artifactId>sisu-guava</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.sonatype.sisu</groupId>
- <artifactId>sisu-guice</artifactId>
- </exclusion>
- </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven.archetype</groupId>
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;
{
@Inject
- private PlexusSisuBridge plexusSisuBridge;
-
- @Inject
- private MavenIndexerUtils mavenIndexerUtils;
-
- // fields
private List<? extends IndexCreator> 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 );
}
return indexer.addIndexingContext( contextKey, remoteRepository.getId(), repoDir, indexDirectory,
remoteRepository.getUrl(), calculateIndexRemoteUrl( remoteRepository ),
- mavenIndexerUtils.getAllIndexCreators() );
+ indexCreators );
}
catch ( MalformedURLException e )
{
<context:annotation-config />
<context:component-scan
- base-package="org.apache.archiva.admin.repository,org.apache.maven.index"/>
+ base-package="org.apache.archiva.admin.repository"/>
<alias name="redbackRuntimeConfigurationAdmin#default" alias="userConfiguration#archiva"/>
* 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;
<javaxMailVersion>1.4</javaxMailVersion>
<!--jettyVersion>9.4.5.v20170502</jettyVersion-->
<jettyVersion>9.4.7-SNAPSHOT</jettyVersion>
- <guava.version>22.0</guava.version>
+ <guava.version>15.0</guava.version>
<openjpaVersion>2.4.1</openjpaVersion>
<!-- restore when we will be able to use a derby in memory database -->
<groupId>com.google.code.atinject</groupId>
<artifactId>atinject</artifactId>
</exclusion>
+ <exclusion>
+ <groupId>org.sonatype.sisu</groupId>
+ <artifactId>sisu-guava</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.sonatype.sisu</groupId>
+ <artifactId>sisu-guice</artifactId>
+ </exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.maven.archetype</groupId>
<artifactId>archetype-common</artifactId>
<version>3.0.1</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.sonatype.sisu</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>