diff options
author | Olivier Lamy <olamy@apache.org> | 2013-04-21 23:35:17 +0000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2013-04-21 23:35:17 +0000 |
commit | 0da207565c4cb4a789ea7cf581d8ede9e4143e99 (patch) | |
tree | b381f3f853e261dfa6c0492c6aef75e4448ef8f6 /archiva-modules/archiva-base | |
parent | 3b64d5dca9b008cfc38c89775bbbda17c6aa2597 (diff) | |
download | archiva-0da207565c4cb4a789ea7cf581d8ede9e4143e99.tar.gz archiva-0da207565c4cb4a789ea7cf581d8ede9e4143e99.zip |
fix handling of dynamic mergedIndexPath
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1470363 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/archiva-base')
2 files changed, 31 insertions, 6 deletions
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 1d4bfecfd..77618be8b 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 @@ -47,7 +47,7 @@ import java.util.concurrent.CopyOnWriteArrayList; * @author Olivier Lamy * @since 1.4-M2 */ -@Service( "indexMerger#default" ) +@Service("indexMerger#default") public class DefaultIndexMerger implements IndexMerger { @@ -100,7 +100,7 @@ public class DefaultIndexMerger try { - File indexLocation = new File( tempRepoFile, ".indexer" ); + File indexLocation = new File( tempRepoFile, indexMergerRequest.getMergedIndexPath() ); IndexingContext indexingContext = indexer.addIndexingContext( tempRepoId, tempRepoId, tempRepoFile, indexLocation, null, null, mavenIndexerUtils.getAllIndexCreators() ); @@ -124,7 +124,8 @@ public class DefaultIndexMerger temporaryGroupIndexes.add( new TemporaryGroupIndex( tempRepoFile, tempRepoId, indexMergerRequest.getGroupId() ) ); stopWatch.stop(); - log.info( "merged index for repos {} in {} s", indexMergerRequest.getRepositoriesIds(), stopWatch.getTime() ); + log.info( "merged index for repos {} in {} s", indexMergerRequest.getRepositoriesIds(), + stopWatch.getTime() ); return indexingContext; } catch ( IOException e ) diff --git a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/merger/IndexMergerRequest.java b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/merger/IndexMergerRequest.java index d6836061e..76d238fd2 100644 --- a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/merger/IndexMergerRequest.java +++ b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/merger/IndexMergerRequest.java @@ -40,6 +40,8 @@ public class IndexMergerRequest */ private String groupId; + private String mergedIndexPath = "/.indexer"; + public IndexMergerRequest( Collection<String> repositoriesIds, boolean packIndex, String groupId ) { this.repositoriesIds = repositoriesIds; @@ -47,6 +49,18 @@ public class IndexMergerRequest this.groupId = groupId; } + /** + * @since 1.4-M4 + */ + public IndexMergerRequest( Collection<String> repositoriesIds, boolean packIndex, String groupId, + String mergedIndexPath ) + { + this.repositoriesIds = repositoriesIds; + this.packIndex = packIndex; + this.groupId = groupId; + this.mergedIndexPath = mergedIndexPath; + } + public Collection<String> getRepositoriesIds() { return repositoriesIds; @@ -77,14 +91,24 @@ public class IndexMergerRequest this.groupId = groupId; } + public String getMergedIndexPath() + { + return mergedIndexPath; + } + + public void setMergedIndexPath( String mergedIndexPath ) + { + this.mergedIndexPath = mergedIndexPath; + } + @Override public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append( "IndexMergerRequest" ); - sb.append( "{repositoriesIds=" ).append( repositoriesIds ); + final StringBuilder sb = new StringBuilder( "IndexMergerRequest{" ); + sb.append( "repositoriesIds=" ).append( repositoriesIds ); sb.append( ", packIndex=" ).append( packIndex ); sb.append( ", groupId='" ).append( groupId ).append( '\'' ); + sb.append( ", mergedIndexPath='" ).append( mergedIndexPath ).append( '\'' ); sb.append( '}' ); return sb.toString(); } |