diff options
author | olivier lamy <olamy@apache.org> | 2017-07-24 10:12:23 +1000 |
---|---|---|
committer | olivier lamy <olamy@apache.org> | 2017-07-24 10:12:23 +1000 |
commit | 003d5794a823d57b58ec26663fe145f31649ce31 (patch) | |
tree | ae0e1e1b6b5a149764047d321f61cafae36167b9 /archiva-modules | |
parent | 7480b7ffe247268dc434a3eb079cb1e34c6bb73b (diff) | |
download | archiva-003d5794a823d57b58ec26663fe145f31649ce31.tar.gz archiva-003d5794a823d57b58ec26663fe145f31649ce31.zip |
more progress on new maven indexer version
Signed-off-by: olivier lamy <olamy@apache.org>
Diffstat (limited to 'archiva-modules')
36 files changed, 147 insertions, 417 deletions
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<ArtifactIndexingTask> { - Set<File> indexed = new HashSet<File>(); + Set<File> 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.<String>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.<File>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.<String>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 Binary files differdeleted file mode 100644 index 9c708cae2..000000000 --- a/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_7.fdt +++ /dev/null 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 Binary files differdeleted file mode 100644 index 9c6ebd91b..000000000 --- a/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_7.fdx +++ /dev/null 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-ServiceBundle-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%5yquW
I_#s+1?;wigK!)UA3'{9m=Qe}7EMk-/GO]coC[ S 1e K^X1e K^X {si_[WOIC;3+#%
7/ 1
3
1u %
7
J]9$/@ 1e K^X1e K^X 1W {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(6I* PE
=
9SV*64 u77* u77*t.6K* PHsr'%
_%
=
eI s u77*a u17* -
<
9-S%V*64r'1_%={I u77*1W'$
_%
=
; ( tlM* `i: u77*
=
9SV*64rs'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 PL1e 9(&4>h0r PdLr u75 X
Yt64x X
=
9SV* 64 qWV
W u77* '1_%
=
!!N 'XVZ8
F - - - - - - - - -
4 - -
c
4 - -
d %m#/ !%"
3 )(( ! W0>r ">12VV1 ?
s!
u
! ?
s#!
!
z\ 6Z"W u15 X W[9W u/5 X1 ?
s
!
#?
1 -<
95S H ' 1 J< yW[?Vq(W1e C ^XW[?VZ01 ?
s
!
"?
11 ?
s
!
""
0 W[?0>r "R-
>r 4 1 zc^$ P2F.I $ 9A
1)
!W[?W[?VZ>0>r 9<<VWW[?VZ81e K^XWZ?WVZ - ! /!!,$r!4WVZ>PW[? - - - - - ,( - -! - -!9!(,d8$V1"./9+:Wy
7?1 ?
s!
#S
1WWW
=
9S.V * 6!4$ -<94S :V >* @6 84 =1 ?
s!
[
V - -Z> -W[?W[?W[?0"r #+-W1e 6
Y=K^XVZ9WQWZ?s+W0>r t0
.1 ?
s
!
#>
1 ) ! u /7* 9D A) %oWV0WZ?W9WZ9Q0>rG "#0J0>rF a<W[>QpD 4A+)V"J7W1 ?
s!
"S
0W k/W
=
9SV* 64&WVW - - / - - - - - - - - - - - - - - - - - - - - - - - - - - -& - - - - - -J -& - - - - - - - - - -#vC .!j t q 1 ?
s!
u
rt1 ?
s!
u
VWVW[?WZ?V - - -W W[?VdZ>WW1e K^XWVW[1 ?
s!
#S
WZ8'1_%=; 0 N BX 1WWs9 u17* !W[?W
! ?
s 4
!
1
z"^ P"H!W[?Vj. u17* - - - - - - - - -%+$ $%+#1 ?
s!
u
W[?VWZ?V1 ?
s
!
a
-E 5A1) VJVVW )
=
5
?k, =CVZ(Q1 ?
s
!
"(
0WZ?VWW[?1 -11 -111111111120111%211[)!( ( c' * !!"!! - - - - - - -
n - - - n - -- %#6J !%"1e (
(=h/* 0'(C+WWWW
=
9SV*64WVVt06-* 1 4WWWWrtVVZ>QW[)W1 -11 -111111111120111%211[)!( ( c' * !!"!! V[>
3 )(( ! rueVZ0QW
=
9SV* 64'0>r "R0.
! %@B/9#! $!5B..VV[>1e
9) '5>h0 PJ$
]0>r "80! u5 X - -2 $* &( & &( # 3%%!"W[?Q
=
9SH '1:%VVZ>
=
9SV*641 ?
s
!
#(
1'1_%
=
{I )
I
")
0j
=
9S$V* 6 45VZ>VZ8
3 )(( ! W[91e
9) '7>h: * |WZ9WZ9VV1 ?
s
!
"8
#WZ?Q
<
"0Bn'01 ?
s
!
")
1 ?
s!
9=
W
=
9SV* 64WW[9Q1 ?
s
!
"(
0)W[?W1e C ^XV - -1e - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -9( - - - - - -& - -4 - - - - - - - - - ->!h0 PL u15 X
=
9SV* 64WWW - & '" (+0>r t0 -[1 ?
s!
u
[?V1 ?
s!
u
, RM0 T W'I [ mUN C hWZ -?VD 4A)!* 'WVt1e K^X -
- - - - - - 9 - - - -%!!/*+ @-!u1e K^X
'/($/@" - - - -2 - -6 - -.D8/t64 X u1e K^X1e K^X1e
9)'5>h0 PL
'/($/@#
37/D8/uu%
5
7
/S1Jutu1e K^X - - - - - - - - 8 - - - -%.! :/ 3 . ; @+-'1e K^Xuut -0dJ^X " - - - -2 - -6 - -.D8/u -0dJ^-X 0{wsoica_][YWUOIC=;93-+)#
1e K^X
1e K^X
! !
,%'+," ( (woca]YUOI=9-)#WSM7'!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 -0W~r u77 XV
!
3 .%(*$ "#NH:2"000 a
! !
,%'+," ( (}{ywqousmkigeca_][YUWSQOMKIGECA?=9;1/-753+)'%#!
;%A80){%% 1;70tI
*(/' 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 Binary files differdeleted file mode 100644 index 601fb22d7..000000000 --- a/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_7.prx +++ /dev/null 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 Binary files differdeleted file mode 100644 index 52941c7db..000000000 --- a/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_7.tii +++ /dev/null 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 Binary files differdeleted file mode 100644 index d018fa672..000000000 --- a/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_7.tis +++ /dev/null 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 Binary files differnew file mode 100644 index 000000000..9ab6d4d90 --- /dev/null +++ b/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_8.fdt 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 Binary files differnew file mode 100644 index 000000000..a26fbfa6b --- /dev/null +++ b/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_8.fdx 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 Binary files differnew file mode 100644 index 000000000..b9f92430c --- /dev/null +++ b/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_8.fnm 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 Binary files differnew file mode 100644 index 000000000..d832c2f6f --- /dev/null +++ b/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_8.nvd 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 Binary files differnew file mode 100644 index 000000000..a27cff81a --- /dev/null +++ b/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_8.nvm 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 Binary files differnew file mode 100644 index 000000000..2539c768d --- /dev/null +++ b/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_8.si 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 Binary files differnew file mode 100644 index 000000000..0a2394bd2 --- /dev/null +++ b/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_8_Lucene41_0.doc 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 Binary files differnew file mode 100644 index 000000000..4d9bbaad5 --- /dev/null +++ b/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_8_Lucene41_0.pos 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 Binary files differnew file mode 100644 index 000000000..ac8475263 --- /dev/null +++ b/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_8_Lucene41_0.tim 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 Binary files differnew file mode 100644 index 000000000..d94d9c92b --- /dev/null +++ b/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/_8_Lucene41_0.tip 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 Binary files differindex e76c9033a..077a451a0 100644 --- 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 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 Binary files differdeleted file mode 100644 index 8d4ef95e8..000000000 --- a/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/segments_8 +++ /dev/null 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 Binary files differnew file mode 100644 index 000000000..a01b84fd7 --- /dev/null +++ b/archiva-modules/archiva-base/archiva-indexer/src/test/repo-release/.index/segments_9 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; @@ -80,7 +80,13 @@ 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 @@ -84,15 +84,15 @@ public class DefaultDownloadRemoteIndexScheduler 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<ArtifactInfo> 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<ArtifactInfo> 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,18 +72,10 @@ 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(); repositoryTaskScheduler.startup(); Banner.display( (String) archivaRuntimeProperties.get( "archiva.version" ) ); 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 @@ -103,6 +103,10 @@ <artifactId>spring-web</artifactId> </dependency> <dependency> + <groupId>org.apache.jackrabbit</groupId> + <artifactId>jackrabbit-webdav</artifactId> + </dependency> + <dependency> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> </dependency> 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 @@ <executions> <execution> <id>test-repository</id> - <phase>generate-test-resources</phase> + <phase>process-test-classes</phase> <goals> <goal>unpack-dependencies</goal> </goals> 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 @@ <artifactId>metadata-store-jcr</artifactId> <packaging>bundle</packaging> <name>Archiva Core Plugins :: JCR Storage for Metadata</name> - <properties> - <jcr-oak.version>1.7.2</jcr-oak.version> - </properties> <dependencies> <dependency> <groupId>org.apache.archiva</groupId> @@ -65,12 +62,10 @@ <dependency> <groupId>org.apache.jackrabbit</groupId> <artifactId>oak-jcr</artifactId> - <version>${jcr-oak.version}</version> </dependency> <dependency> <groupId>org.apache.jackrabbit</groupId> <artifactId>oak-segment-tar</artifactId> - <version>${jcr-oak.version}</version> </dependency> <dependency> <groupId>org.apache.jackrabbit</groupId> @@ -124,6 +119,7 @@ <artifactId>xercesImpl</artifactId> <scope>test</scope> </dependency> + <dependency> <groupId>org.apache.lucene</groupId> <artifactId>lucene-core</artifactId> @@ -169,6 +165,7 @@ <artifactId>lucene-analyzers-common</artifactId> <version>${lucene.version}</version> </dependency> + </dependencies> <build> <testResources> 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<String, MetadataFacetFactory> 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 @@ --> <beans xmlns="http://www.springframework.org/schema/beans" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util" - xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"> + 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"> </beans>
\ No newline at end of file |