Browse Source

Updating index merge to new maven api

pull/46/head
Martin Stockhammer 6 years ago
parent
commit
c424149d1c

+ 52
- 32
archiva-modules/archiva-base/archiva-maven2-indexer/src/main/java/org/apache/archiva/indexer/maven/merger/DefaultIndexMerger.java View File

*/ */


import org.apache.archiva.common.utils.FileUtils; import org.apache.archiva.common.utils.FileUtils;
import org.apache.archiva.indexer.UnsupportedBaseContextException;
import org.apache.archiva.indexer.merger.IndexMerger; import org.apache.archiva.indexer.merger.IndexMerger;
import org.apache.archiva.indexer.merger.IndexMergerException; import org.apache.archiva.indexer.merger.IndexMergerException;
import org.apache.archiva.indexer.merger.IndexMergerRequest; import org.apache.archiva.indexer.merger.IndexMergerRequest;
import org.apache.archiva.indexer.merger.TemporaryGroupIndex; import org.apache.archiva.indexer.merger.TemporaryGroupIndex;
import org.apache.archiva.repository.RepositoryRegistry;
import org.apache.archiva.repository.RepositoryType;
import org.apache.commons.lang.time.StopWatch; import org.apache.commons.lang.time.StopWatch;
import org.apache.maven.index.NexusIndexer;
import org.apache.maven.index.Indexer;
import org.apache.maven.index.context.ContextMemberProvider;
import org.apache.maven.index.context.IndexCreator; import org.apache.maven.index.context.IndexCreator;
import org.apache.maven.index.context.IndexingContext; import org.apache.maven.index.context.IndexingContext;
import org.apache.maven.index.context.UnsupportedExistingLuceneIndexException;
import org.apache.maven.index.context.StaticContextMemberProvider;
import org.apache.maven.index.packer.IndexPacker; import org.apache.maven.index.packer.IndexPacker;
import org.apache.maven.index.packer.IndexPackingRequest; import org.apache.maven.index.packer.IndexPackingRequest;
import org.slf4j.Logger; import org.slf4j.Logger;
import java.nio.file.Path; import java.nio.file.Path;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.CopyOnWriteArrayList;
import java.util.stream.Collectors;


/** /**
* @author Olivier Lamy * @author Olivier Lamy
implements IndexMerger implements IndexMerger
{ {


@Inject
RepositoryRegistry repositoryRegistry;

private Logger log = LoggerFactory.getLogger( getClass() ); private Logger log = LoggerFactory.getLogger( getClass() );


private final NexusIndexer indexer;


private final IndexPacker indexPacker; private final IndexPacker indexPacker;


private Indexer indexer;

private final List<IndexCreator> indexCreators; private final List<IndexCreator> indexCreators;


private List<TemporaryGroupIndex> temporaryGroupIndexes = new CopyOnWriteArrayList<>(); private List<TemporaryGroupIndex> temporaryGroupIndexes = new CopyOnWriteArrayList<>();


private List<IndexingContext> temporaryContextes = new CopyOnWriteArrayList<>( );

private List<String> runningGroups = new CopyOnWriteArrayList<>(); private List<String> runningGroups = new CopyOnWriteArrayList<>();


@Inject @Inject
public DefaultIndexMerger( NexusIndexer nexusIndexer, IndexPacker indexPacker, List<IndexCreator> indexCreators )
public DefaultIndexMerger( Indexer indexer, IndexPacker indexPacker, List<IndexCreator> indexCreators )
{ {
this.indexer = nexusIndexer;
this.indexer = indexer;
this.indexPacker = indexPacker; this.indexPacker = indexPacker;
this.indexCreators = indexCreators; this.indexCreators = indexCreators;
} }
try try
{ {
Path indexLocation = mergedIndexDirectory.resolve( indexMergerRequest.getMergedIndexPath() ); Path indexLocation = mergedIndexDirectory.resolve( indexMergerRequest.getMergedIndexPath() );
IndexingContext indexingContext =
indexer.addIndexingContext( tempRepoId, tempRepoId, mergedIndexDirectory.toFile(), indexLocation.toFile(), null, null,
indexCreators );


for ( String repoId : indexMergerRequest.getRepositoriesIds() )
{
IndexingContext idxToMerge = indexer.getIndexingContexts().get( repoId );
if ( idxToMerge != null )
{
indexingContext.merge( idxToMerge.getIndexDirectory() );
}
}

indexingContext.optimize();
List<IndexingContext> members = indexMergerRequest.getRepositoriesIds( ).stream( ).map( id ->
repositoryRegistry.getRepository( id ) ).filter( repo -> repo.getType().equals( RepositoryType.MAVEN ) )
.map( repo -> {
try
{
return repo.getIndexingContext().getBaseContext( IndexingContext.class );
}
catch ( UnsupportedBaseContextException e )
{
return null;
// Ignore
}
} ).filter( Objects::nonNull ).collect( Collectors.toList() );
ContextMemberProvider memberProvider = new StaticContextMemberProvider(members);
IndexingContext mergedCtx = indexer.createMergedIndexingContext( tempRepoId, tempRepoId, mergedIndexDirectory.toFile(),
indexLocation.toFile(), true, memberProvider);
mergedCtx.optimize();


if ( indexMergerRequest.isPackIndex() ) if ( indexMergerRequest.isPackIndex() )
{ {
IndexPackingRequest request = new IndexPackingRequest( indexingContext, //
indexingContext.acquireIndexSearcher().getIndexReader(), //
IndexPackingRequest request = new IndexPackingRequest( mergedCtx, //
mergedCtx.acquireIndexSearcher().getIndexReader(), //
indexLocation.toFile() ); indexLocation.toFile() );
indexPacker.packIndex( request ); indexPacker.packIndex( request );
} }
{ {
temporaryGroupIndexes.add( new TemporaryGroupIndex( mergedIndexDirectory, tempRepoId, groupId, temporaryGroupIndexes.add( new TemporaryGroupIndex( mergedIndexDirectory, tempRepoId, groupId,
indexMergerRequest.getMergedIndexTtl() ) ); indexMergerRequest.getMergedIndexTtl() ) );
temporaryContextes.add(mergedCtx);
} }
stopWatch.stop(); stopWatch.stop();
log.info( "merged index for repos {} in {} s", indexMergerRequest.getRepositoriesIds(), log.info( "merged index for repos {} in {} s", indexMergerRequest.getRepositoriesIds(),
stopWatch.getTime() ); stopWatch.getTime() );
return indexingContext;
return mergedCtx;
} }
catch ( IOException | UnsupportedExistingLuceneIndexException e )
catch ( IOException e)
{ {
throw new IndexMergerException( e.getMessage(), e ); throw new IndexMergerException( e.getMessage(), e );
} }


try try
{ {
IndexingContext indexingContext = indexer.getIndexingContexts().get( temporaryGroupIndex.getIndexId() );
if ( indexingContext != null )
{
indexer.removeIndexingContext( indexingContext, true );
}
Path directory = temporaryGroupIndex.getDirectory();
if ( directory != null && Files.exists(directory) )
{
FileUtils.deleteDirectory( directory );

Optional<IndexingContext> ctxOpt = temporaryContextes.stream( ).filter( ctx -> ctx.getId( ).equals( temporaryGroupIndex.getIndexId( ) ) ).findFirst( );
if (ctxOpt.isPresent()) {
IndexingContext ctx = ctxOpt.get();
indexer.closeIndexingContext( ctx, true );
temporaryGroupIndexes.remove( temporaryGroupIndex );
temporaryContextes.remove( ctx );
Path directory = temporaryGroupIndex.getDirectory();
if ( directory != null && Files.exists(directory) )
{
FileUtils.deleteDirectory( directory );
}
} }
temporaryGroupIndexes.remove( temporaryGroupIndex );
} }
catch ( IOException e ) catch ( IOException e )
{ {

+ 30
- 28
archiva-modules/archiva-base/archiva-maven2-indexer/src/main/java/org/apache/archiva/indexer/maven/search/MavenRepositorySearch.java View File

import org.apache.maven.index_shaded.lucene.search.BooleanClause; 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.BooleanClause.Occur;
import org.apache.maven.index_shaded.lucene.search.BooleanQuery; import org.apache.maven.index_shaded.lucene.search.BooleanQuery;
import org.apache.maven.index_shaded.lucene.search.Query;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
// since upgrade to nexus 2.0.0, query has changed from g:[QUERIED TERM]* to g:*[QUERIED TERM]* // since upgrade to nexus 2.0.0, query has changed from g:[QUERIED TERM]* to g:*[QUERIED TERM]*
// resulting to more wildcard searches so we need to increase max clause count // resulting to more wildcard searches so we need to increase max clause count
BooleanQuery.setMaxClauseCount( Integer.MAX_VALUE ); BooleanQuery.setMaxClauseCount( Integer.MAX_VALUE );
BooleanQuery q = new BooleanQuery();
BooleanQuery.Builder qb = new BooleanQuery.Builder();


if ( previousSearchTerms == null || previousSearchTerms.isEmpty() ) if ( previousSearchTerms == null || previousSearchTerms.isEmpty() )
{ {
constructQuery( term, q );
constructQuery( term, qb );
} }
else else
{ {
for ( String previousTerm : previousSearchTerms ) for ( String previousTerm : previousSearchTerms )
{ {
BooleanQuery iQuery = new BooleanQuery();
BooleanQuery.Builder iQuery = new BooleanQuery.Builder();
constructQuery( previousTerm, iQuery ); constructQuery( previousTerm, iQuery );


q.add( iQuery, BooleanClause.Occur.MUST );
qb.add( iQuery.build(), BooleanClause.Occur.MUST );
} }


BooleanQuery iQuery = new BooleanQuery();
BooleanQuery.Builder iQuery = new BooleanQuery.Builder();
constructQuery( term, iQuery ); constructQuery( term, iQuery );
q.add( iQuery, BooleanClause.Occur.MUST );
qb.add( iQuery.build(), BooleanClause.Occur.MUST );
} }


// we retun only artifacts without classifier in quick search, olamy cannot find a way to say with this field empty // we retun only artifacts without classifier in quick search, olamy cannot find a way to say with this field empty
// FIXME cannot find a way currently to setup this in constructQuery !!! // FIXME cannot find a way currently to setup this in constructQuery !!!
return search( limits, q, indexingContextIds, NoClassifierArtifactInfoFilter.LIST, selectedRepos, true );
return search( limits, qb.build(), indexingContextIds, NoClassifierArtifactInfoFilter.LIST, selectedRepos, true );


} }


return new SearchResults(); return new SearchResults();
} }


BooleanQuery q = new BooleanQuery();
BooleanQuery.Builder qb = new BooleanQuery.Builder();
if ( StringUtils.isNotBlank( searchFields.getGroupId() ) ) if ( StringUtils.isNotBlank( searchFields.getGroupId() ) )
{ {
q.add( indexer.constructQuery( MAVEN.GROUP_ID, searchFields.isExactSearch() ? new SourcedSearchExpression(
qb.add( indexer.constructQuery( MAVEN.GROUP_ID, searchFields.isExactSearch() ? new SourcedSearchExpression(
searchFields.getGroupId() ) : new UserInputSearchExpression( searchFields.getGroupId() ) ), searchFields.getGroupId() ) : new UserInputSearchExpression( searchFields.getGroupId() ) ),
BooleanClause.Occur.MUST ); BooleanClause.Occur.MUST );
} }


if ( StringUtils.isNotBlank( searchFields.getArtifactId() ) ) if ( StringUtils.isNotBlank( searchFields.getArtifactId() ) )
{ {
q.add( indexer.constructQuery( MAVEN.ARTIFACT_ID,
qb.add( indexer.constructQuery( MAVEN.ARTIFACT_ID,
searchFields.isExactSearch() searchFields.isExactSearch()
? new SourcedSearchExpression( searchFields.getArtifactId() ) ? new SourcedSearchExpression( searchFields.getArtifactId() )
: new UserInputSearchExpression( searchFields.getArtifactId() ) ), : new UserInputSearchExpression( searchFields.getArtifactId() ) ),


if ( StringUtils.isNotBlank( searchFields.getVersion() ) ) if ( StringUtils.isNotBlank( searchFields.getVersion() ) )
{ {
q.add( indexer.constructQuery( MAVEN.VERSION, searchFields.isExactSearch() ? new SourcedSearchExpression(
qb.add( indexer.constructQuery( MAVEN.VERSION, searchFields.isExactSearch() ? new SourcedSearchExpression(
searchFields.getVersion() ) : new SourcedSearchExpression( searchFields.getVersion() ) ), searchFields.getVersion() ) : new SourcedSearchExpression( searchFields.getVersion() ) ),
BooleanClause.Occur.MUST ); BooleanClause.Occur.MUST );
} }


if ( StringUtils.isNotBlank( searchFields.getPackaging() ) ) if ( StringUtils.isNotBlank( searchFields.getPackaging() ) )
{ {
q.add( indexer.constructQuery( MAVEN.PACKAGING, searchFields.isExactSearch() ? new SourcedSearchExpression(
qb.add( indexer.constructQuery( MAVEN.PACKAGING, searchFields.isExactSearch() ? new SourcedSearchExpression(
searchFields.getPackaging() ) : new UserInputSearchExpression( searchFields.getPackaging() ) ), searchFields.getPackaging() ) : new UserInputSearchExpression( searchFields.getPackaging() ) ),
BooleanClause.Occur.MUST ); BooleanClause.Occur.MUST );
} }


if ( StringUtils.isNotBlank( searchFields.getClassName() ) ) if ( StringUtils.isNotBlank( searchFields.getClassName() ) )
{ {
q.add( indexer.constructQuery( MAVEN.CLASSNAMES,
qb.add( indexer.constructQuery( MAVEN.CLASSNAMES,
new UserInputSearchExpression( searchFields.getClassName() ) ), new UserInputSearchExpression( searchFields.getClassName() ) ),
BooleanClause.Occur.MUST ); BooleanClause.Occur.MUST );
} }


if ( StringUtils.isNotBlank( searchFields.getBundleSymbolicName() ) ) if ( StringUtils.isNotBlank( searchFields.getBundleSymbolicName() ) )
{ {
q.add( indexer.constructQuery( OSGI.SYMBOLIC_NAME,
qb.add( indexer.constructQuery( OSGI.SYMBOLIC_NAME,
new UserInputSearchExpression( searchFields.getBundleSymbolicName() ) ), new UserInputSearchExpression( searchFields.getBundleSymbolicName() ) ),
BooleanClause.Occur.MUST ); BooleanClause.Occur.MUST );
} }


if ( StringUtils.isNotBlank( searchFields.getBundleVersion() ) ) if ( StringUtils.isNotBlank( searchFields.getBundleVersion() ) )
{ {
q.add( indexer.constructQuery( OSGI.VERSION,
qb.add( indexer.constructQuery( OSGI.VERSION,
new UserInputSearchExpression( searchFields.getBundleVersion() ) ), new UserInputSearchExpression( searchFields.getBundleVersion() ) ),
BooleanClause.Occur.MUST ); BooleanClause.Occur.MUST );
} }


if ( StringUtils.isNotBlank( searchFields.getBundleExportPackage() ) ) if ( StringUtils.isNotBlank( searchFields.getBundleExportPackage() ) )
{ {
q.add( indexer.constructQuery( OSGI.EXPORT_PACKAGE,
qb.add( indexer.constructQuery( OSGI.EXPORT_PACKAGE,
new UserInputSearchExpression( searchFields.getBundleExportPackage() ) ), new UserInputSearchExpression( searchFields.getBundleExportPackage() ) ),
Occur.MUST ); Occur.MUST );
} }


if ( StringUtils.isNotBlank( searchFields.getBundleExportService() ) ) if ( StringUtils.isNotBlank( searchFields.getBundleExportService() ) )
{ {
q.add( indexer.constructQuery( OSGI.EXPORT_SERVICE,
qb.add( indexer.constructQuery( OSGI.EXPORT_SERVICE,
new UserInputSearchExpression( searchFields.getBundleExportService() ) ), new UserInputSearchExpression( searchFields.getBundleExportService() ) ),
Occur.MUST ); Occur.MUST );
} }


if ( StringUtils.isNotBlank( searchFields.getBundleImportPackage() ) ) if ( StringUtils.isNotBlank( searchFields.getBundleImportPackage() ) )
{ {
q.add( indexer.constructQuery( OSGI.IMPORT_PACKAGE,
qb.add( indexer.constructQuery( OSGI.IMPORT_PACKAGE,
new UserInputSearchExpression( searchFields.getBundleImportPackage() ) ), new UserInputSearchExpression( searchFields.getBundleImportPackage() ) ),
Occur.MUST ); Occur.MUST );
} }


if ( StringUtils.isNotBlank( searchFields.getBundleName() ) ) if ( StringUtils.isNotBlank( searchFields.getBundleName() ) )
{ {
q.add( indexer.constructQuery( OSGI.NAME, new UserInputSearchExpression( searchFields.getBundleName() ) ),
qb.add( indexer.constructQuery( OSGI.NAME, new UserInputSearchExpression( searchFields.getBundleName() ) ),
Occur.MUST ); Occur.MUST );
} }


if ( StringUtils.isNotBlank( searchFields.getBundleImportPackage() ) ) if ( StringUtils.isNotBlank( searchFields.getBundleImportPackage() ) )
{ {
q.add( indexer.constructQuery( OSGI.IMPORT_PACKAGE,
qb.add( indexer.constructQuery( OSGI.IMPORT_PACKAGE,
new UserInputSearchExpression( searchFields.getBundleImportPackage() ) ), new UserInputSearchExpression( searchFields.getBundleImportPackage() ) ),
Occur.MUST ); Occur.MUST );
} }


if ( StringUtils.isNotBlank( searchFields.getBundleRequireBundle() ) ) if ( StringUtils.isNotBlank( searchFields.getBundleRequireBundle() ) )
{ {
q.add( indexer.constructQuery( OSGI.REQUIRE_BUNDLE,
qb.add( indexer.constructQuery( OSGI.REQUIRE_BUNDLE,
new UserInputSearchExpression( searchFields.getBundleRequireBundle() ) ), new UserInputSearchExpression( searchFields.getBundleRequireBundle() ) ),
Occur.MUST ); Occur.MUST );
} }


if ( StringUtils.isNotBlank( searchFields.getClassifier() ) ) if ( StringUtils.isNotBlank( searchFields.getClassifier() ) )
{ {
q.add( indexer.constructQuery( MAVEN.CLASSIFIER, searchFields.isExactSearch() ? new SourcedSearchExpression(
qb.add( indexer.constructQuery( MAVEN.CLASSIFIER, searchFields.isExactSearch() ? new SourcedSearchExpression(
searchFields.getClassifier() ) : new UserInputSearchExpression( searchFields.getClassifier() ) ), searchFields.getClassifier() ) : new UserInputSearchExpression( searchFields.getClassifier() ) ),
Occur.MUST ); Occur.MUST );
} }
// currently it's done in DefaultSearchService with some filtering // currently it's done in DefaultSearchService with some filtering
} }


if ( q.getClauses() == null || q.getClauses().length <= 0 )
BooleanQuery qu = qb.build();
if ( qu.clauses() == null || qu.clauses().size() <= 0 )
{ {
throw new RepositorySearchException( "No search fields set." ); throw new RepositorySearchException( "No search fields set." );
} }
if (q.getClauses()!=null) {
log.debug("CLAUSES ", q.getClauses());
for (BooleanClause cl : q.getClauses()) {
if (qu.clauses()!=null) {
log.debug("CLAUSES ", qu.clauses());
for (BooleanClause cl : qu.clauses()) {
log.debug("Clause ",cl); log.debug("Clause ",cl);
} }
} }


return search( limits, q, indexingContextIds, Collections.<ArtifactInfoFilter>emptyList(),
return search( limits, qu, indexingContextIds, Collections.<ArtifactInfoFilter>emptyList(),
searchFields.getRepositories(), searchFields.isIncludePomArtifacts() ); searchFields.getRepositories(), searchFields.isIncludePomArtifacts() );
} }


return contexts; return contexts;
} }


private void constructQuery( String term, BooleanQuery q )
private void constructQuery( String term, BooleanQuery.Builder q )
{ {
q.add( indexer.constructQuery( MAVEN.GROUP_ID, new UserInputSearchExpression( term ) ), Occur.SHOULD ); q.add( indexer.constructQuery( MAVEN.GROUP_ID, new UserInputSearchExpression( term ) ), Occur.SHOULD );
q.add( indexer.constructQuery( MAVEN.ARTIFACT_ID, new UserInputSearchExpression( term ) ), Occur.SHOULD ); q.add( indexer.constructQuery( MAVEN.ARTIFACT_ID, new UserInputSearchExpression( term ) ), Occur.SHOULD );

+ 5
- 0
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/pom.xml View File

<artifactId>archiva-maven2-model</artifactId> <artifactId>archiva-maven2-model</artifactId>
</dependency> </dependency>


<dependency>
<groupId>org.apache.archiva</groupId>
<artifactId>archiva-model</artifactId>
</dependency>

<dependency> <dependency>
<groupId>org.jsoup</groupId> <groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId> <artifactId>jsoup</artifactId>

+ 11
- 6
archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/DownloadMergedIndexNonDefaultPathTest.java View File

import org.apache.archiva.admin.model.beans.ProxyConnector; import org.apache.archiva.admin.model.beans.ProxyConnector;
import org.apache.archiva.admin.model.beans.RemoteRepository; import org.apache.archiva.admin.model.beans.RemoteRepository;
import org.apache.archiva.admin.model.beans.RepositoryGroup; import org.apache.archiva.admin.model.beans.RepositoryGroup;
import org.apache.archiva.common.utils.FileUtils;
import org.apache.archiva.maven2.model.Artifact; import org.apache.archiva.maven2.model.Artifact;
import org.apache.archiva.redback.integration.security.role.RedbackRoleConstants; import org.apache.archiva.redback.integration.security.role.RedbackRoleConstants;
import org.apache.archiva.redback.rest.services.FakeCreateAdminService; import org.apache.archiva.redback.rest.services.FakeCreateAdminService;
public void downloadMergedIndexWithNonDefaultPath() public void downloadMergedIndexWithNonDefaultPath()
throws Exception throws Exception
{ {
Path tmpIndexDir = Paths.get( System.getProperty( "java.io.tmpdir" ), "tmpIndex" );
if ( Files.exists(tmpIndexDir) )
{
org.apache.archiva.common.utils.FileUtils.deleteDirectory( tmpIndexDir );

Path indexBaseDir = Paths.get(System.getProperty( "java.io.tmpdir" )).resolve("archiva").resolve("remotedownloadtest");
String indexBase = indexBaseDir.toString();
FileUtils.deleteQuietly( indexBaseDir);
if (!Files.exists(indexBaseDir)) {
Files.createDirectories( indexBaseDir );
} }
String id = Long.toString( System.currentTimeMillis() ); String id = Long.toString( System.currentTimeMillis() );
ManagedRepository managedRepository = new ManagedRepository( Locale.getDefault()); ManagedRepository managedRepository = new ManagedRepository( Locale.getDefault());
managedRepository.setId( id ); managedRepository.setId( id );
managedRepository.setName( "name of " + id ); managedRepository.setName( "name of " + id );
managedRepository.setLocation( System.getProperty( "basedir" ) + "/src/test/repositories/test-repo" ); managedRepository.setLocation( System.getProperty( "basedir" ) + "/src/test/repositories/test-repo" );
managedRepository.setIndexDirectory( System.getProperty( "java.io.tmpdir" ) + "/tmpIndex/" + id );
managedRepository.setIndexDirectory( indexBase + "/index-" + id );
managedRepository.setPackedIndexDirectory( indexBase + "/indexPacked-" + id );


ManagedRepositoriesService managedRepositoriesService = getManagedRepositoriesService(); ManagedRepositoriesService managedRepositoriesService = getManagedRepositoriesService();


managedRepository.setId( id ); managedRepository.setId( id );
managedRepository.setName( "name of " + id ); managedRepository.setName( "name of " + id );
managedRepository.setLocation( System.getProperty( "basedir" ) + "/src/test/repositories/test-repo" ); managedRepository.setLocation( System.getProperty( "basedir" ) + "/src/test/repositories/test-repo" );
managedRepository.setIndexDirectory( System.getProperty( "java.io.tmpdir" ) + "/tmpIndex/" + id );
managedRepository.setIndexDirectory( indexBaseDir + "/index-"+ id );
managedRepository.setPackedIndexDirectory( indexBase + "/tmpIndexPacked-" + id );


if ( managedRepositoriesService.getManagedRepository( id ) != null ) if ( managedRepositoriesService.getManagedRepository( id ) != null )
{ {

Loading…
Cancel
Save