archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From marti...@apache.org
Subject [11/15] archiva git commit: Implementation of new archivaindexer
Date Fri, 10 Nov 2017 23:20:54 GMT
http://git-wip-us.apache.org/repos/asf/archiva/blob/c6e4e563/archiva-modules/archiva-base/archiva-maven2-indexer/src/test/java/org/apache/archiva/indexer/search/MavenRepositorySearchTest.java
----------------------------------------------------------------------
diff --git a/archiva-modules/archiva-base/archiva-maven2-indexer/src/test/java/org/apache/archiva/indexer/search/MavenRepositorySearchTest.java b/archiva-modules/archiva-base/archiva-maven2-indexer/src/test/java/org/apache/archiva/indexer/search/MavenRepositorySearchTest.java
deleted file mode 100644
index 3c10633..0000000
--- a/archiva-modules/archiva-base/archiva-maven2-indexer/src/test/java/org/apache/archiva/indexer/search/MavenRepositorySearchTest.java
+++ /dev/null
@@ -1,937 +0,0 @@
-package org.apache.archiva.indexer.search;
-
-/*
- * 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.archiva.configuration.ConfigurationEvent;
-import org.apache.archiva.configuration.ConfigurationListener;
-import org.apache.archiva.indexer.util.SearchUtil;
-import org.apache.archiva.repository.RepositoryRegistry;
-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.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.test.context.ContextConfiguration;
-
-import javax.inject.Inject;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import java.util.Locale;
-
-
-@RunWith( ArchivaSpringJUnit4ClassRunner.class )
-@ContextConfiguration( locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context.xml" } )
-public class MavenRepositorySearchTest
-    extends AbstractMavenRepositorySearch
-{
-
-
-    private void createSimpleIndex( boolean scan )
-        throws Exception
-    {
-        List<Path> files = new ArrayList<>();
-        files.add( Paths.get( org.apache.archiva.common.utils.FileUtils.getBasedir(), "src/test", TEST_REPO_1,
-                              "/org/apache/archiva/archiva-search/1.0/archiva-search-1.0.jar" ) );
-        files.add( Paths.get( org.apache.archiva.common.utils.FileUtils.getBasedir(), "src/test", TEST_REPO_1,
-                              "/org/apache/archiva/archiva-test/1.0/archiva-test-1.0.jar" ));
-        files.add( Paths.get( org.apache.archiva.common.utils.FileUtils.getBasedir(), "src/test", TEST_REPO_1,
-                              "org/apache/archiva/archiva-test/2.0/archiva-test-2.0.jar" ));
-
-        createIndex( TEST_REPO_1, files, scan );
-    }
-
-    private void createIndexContainingMoreArtifacts( boolean scan )
-        throws Exception
-    {
-        List<Path> files = new ArrayList<>();
-        files.add( Paths.get( org.apache.archiva.common.utils.FileUtils.getBasedir(), "src/test/" + TEST_REPO_1
-            + "/org/apache/archiva/archiva-search/1.0/archiva-search-1.0.jar" ) );
-        files.add( Paths.get( org.apache.archiva.common.utils.FileUtils.getBasedir(), "src/test/" + TEST_REPO_1
-            + "/org/apache/archiva/archiva-test/1.0/archiva-test-1.0.jar" ) );
-        files.add( Paths.get( org.apache.archiva.common.utils.FileUtils.getBasedir(), "src/test/" + TEST_REPO_1
-            + "/org/apache/archiva/archiva-test/2.0/archiva-test-2.0.jar" ) );
-        files.add( Paths.get( org.apache.archiva.common.utils.FileUtils.getBasedir(), "src/test/" + TEST_REPO_1
-            + "/org/apache/archiva/archiva-webapp/1.0/archiva-webapp-1.0.war" ) );
-        files.add( Paths.get( org.apache.archiva.common.utils.FileUtils.getBasedir(),
-                             "src/test/" + TEST_REPO_1 + "/com/artifactid-numeric/1.0/artifactid-numeric-1.0.jar" ) );
-        files.add( Paths.get( org.apache.archiva.common.utils.FileUtils.getBasedir(), "src/test/" + TEST_REPO_1
-            + "/com/artifactid-numeric123/1.0/artifactid-numeric123-1.0.jar" ) );
-        files.add( Paths.get( org.apache.archiva.common.utils.FileUtils.getBasedir(),
-                             "src/test/" + TEST_REPO_1 + "/com/classname-search/1.0/classname-search-1.0.jar" ) );
-
-        createIndex( TEST_REPO_1, files, scan );
-    }
-
-    private void createIndexContainingMultipleArtifactsSameVersion( boolean scan )
-        throws Exception
-    {
-        List<Path> files = new ArrayList<>();
-
-        files.add( Paths.get( org.apache.archiva.common.utils.FileUtils.getBasedir(), "src/test/" + TEST_REPO_1
-            + "/org/apache/archiva/archiva-search/1.0/archiva-search-1.0.jar" ) );
-
-        files.add( Paths.get( org.apache.archiva.common.utils.FileUtils.getBasedir(), "src/test/" + TEST_REPO_1
-            + "/org/apache/archiva/archiva-search/1.0/archiva-search-1.0.pom" ) );
-
-        files.add( Paths.get( org.apache.archiva.common.utils.FileUtils.getBasedir(), "src/test/" + TEST_REPO_1
-            + "/org/apache/archiva/archiva-search/1.0/archiva-search-1.0-sources.jar" ) );
-
-        createIndex( TEST_REPO_1, files, scan );
-    }
-
-    @Test
-    public void testQuickSearch()
-        throws Exception
-    {
-        createSimpleIndex( false );
-
-        List<String> selectedRepos = Arrays.asList( TEST_REPO_1 );
-
-        // search artifactId
-        EasyMock.expect( archivaConfig.getDefaultLocale() ).andReturn( Locale.getDefault( ) ).anyTimes();
-        EasyMock.expect( archivaConfig.getConfiguration()).andReturn(config).anyTimes();
-
-        archivaConfigControl.replay();
-
-        SearchResults results = search.search( "user", selectedRepos, "archiva-search", null, null );
-
-        archivaConfigControl.verify();
-
-        assertNotNull( results );
-
-        SearchResultHit hit =
-            results.getSearchResultHit( SearchUtil.getHitId( "org.apache.archiva", "archiva-search", null, "jar" ) );
-        assertNotNull( "hit null in result " + results.getHits(), hit );
-        assertEquals( "org.apache.archiva", hit.getGroupId() );
-        assertEquals( "archiva-search", hit.getArtifactId() );
-        assertEquals( "1.0", hit.getVersions().get( 0 ) );
-
-        archivaConfigControl.reset();
-
-        EasyMock.expect( archivaConfig.getDefaultLocale() ).andReturn( Locale.getDefault( ) ).anyTimes();
-        EasyMock.expect( archivaConfig.getConfiguration()).andReturn(config).anyTimes();
-
-        // search groupId
-        archivaConfigControl.replay();
-
-        results = search.search( "user", selectedRepos, "org.apache.archiva", null, null );
-
-        archivaConfigControl.verify();
-
-        assertNotNull( results );
-        assertEquals( "total hints not 3", 3, results.getTotalHits() );
-
-        //TODO: search for class & package names
-    }
-
-    @Test
-    public void testQuickSearchNotWithClassifier()
-        throws Exception
-    {
-        createSimpleIndex( true );
-
-        List<String> selectedRepos = Arrays.asList( TEST_REPO_1 );
-
-        // search artifactId
-        EasyMock.expect( archivaConfig.getDefaultLocale() ).andReturn( Locale.getDefault( ) ).anyTimes();
-        EasyMock.expect( archivaConfig.getConfiguration()).andReturn(config).anyTimes();
-
-        archivaConfigControl.replay();
-
-        SearchResults results = search.search( "user", selectedRepos, "archiva-search", null, null );
-
-        archivaConfigControl.verify();
-
-        assertNotNull( results );
-
-        SearchResultHit hit =
-            results.getSearchResultHit( SearchUtil.getHitId( "org.apache.archiva", "archiva-search", null, "jar" ) );
-        assertNotNull( "hit null in result " + results.getHits(), hit );
-        assertEquals( "org.apache.archiva", hit.getGroupId() );
-        assertEquals( "archiva-search", hit.getArtifactId() );
-        assertEquals( "1.0", hit.getVersions().get( 0 ) );
-
-        archivaConfigControl.reset();
-
-        // search groupId
-        EasyMock.expect( archivaConfig.getDefaultLocale() ).andReturn( Locale.getDefault( ) ).anyTimes();
-        EasyMock.expect( archivaConfig.getConfiguration()).andReturn(config).anyTimes();
-
-        archivaConfigControl.replay();
-
-        results = search.search( "user", selectedRepos, "archiva-search", null, null );
-
-        archivaConfigControl.verify();
-
-        assertNotNull( results );
-        assertEquals( "total hints not 3 hits " + results.getHits(), 3, results.getTotalHits() );
-
-        //TODO: search for class & package names
-    }
-
-    @Test
-    public void testQuickSearchMultipleArtifactsSameVersion()
-        throws Exception
-    {
-        createIndexContainingMultipleArtifactsSameVersion( false );
-
-        List<String> selectedRepos = new ArrayList<>();
-        selectedRepos.add( TEST_REPO_1 );
-
-        // search artifactId
-        EasyMock.expect( archivaConfig.getDefaultLocale() ).andReturn( Locale.getDefault( ) ).anyTimes();
-        EasyMock.expect( archivaConfig.getConfiguration()).andReturn(config).anyTimes();
-
-        archivaConfigControl.replay();
-
-        SearchResults results = search.search( "user", selectedRepos, "archiva-search", null, null );
-
-        archivaConfigControl.verify();
-
-        assertNotNull( results );
-        assertEquals( 3, results.getTotalHits() );
-
-        SearchResultHit hit = results.getHits().get( 0 );
-        assertEquals( "org.apache.archiva", hit.getGroupId() );
-        assertEquals( "archiva-search", hit.getArtifactId() );
-        assertEquals( "1.0", hit.getVersions().get( 0 ) );
-
-        //only 1 version of 1.0 is retrieved
-        assertEquals( 1, hit.getVersions().size() );
-    }
-
-    @Test
-    public void testMultipleArtifactsSameVersionWithClassifier()
-        throws Exception
-    {
-        createIndexContainingMultipleArtifactsSameVersion( true );
-
-        List<String> selectedRepos = new ArrayList<>();
-        selectedRepos.add( TEST_REPO_1 );
-
-        // search artifactId
-        EasyMock.expect( archivaConfig.getDefaultLocale() ).andReturn( Locale.getDefault( ) ).anyTimes();
-        EasyMock.expect( archivaConfig.getConfiguration()).andReturn(config).anyTimes();
-
-        archivaConfigControl.replay();
-
-        SearchFields searchFields = new SearchFields();
-        searchFields.setGroupId( "org.apache.archiva" );
-        searchFields.setArtifactId( "archiva-search" );
-        searchFields.setClassifier( "sources" );
-        searchFields.setRepositories( selectedRepos );
-
-        SearchResults results = search.search( "user", searchFields, null );
-
-        archivaConfigControl.verify();
-
-        assertNotNull( results );
-        assertEquals( 1, results.getTotalHits() );
-
-        SearchResultHit hit = results.getHits().get( 0 );
-        assertEquals( "org.apache.archiva", hit.getGroupId() );
-        assertEquals( "archiva-search", hit.getArtifactId() );
-        assertEquals( "1.0", hit.getVersions().get( 0 ) );
-
-        //only 1 version of 1.0 is retrieved
-        assertEquals( 1, hit.getVersions().size() );
-    }
-
-    // search for existing artifact using multiple keywords
-    @Test
-    public void testQuickSearchWithMultipleKeywords()
-        throws Exception
-    {
-        createSimpleIndex( false );
-
-        List<String> selectedRepos = new ArrayList<>();
-        selectedRepos.add( TEST_REPO_1 );
-
-        EasyMock.expect( archivaConfig.getDefaultLocale() ).andReturn( Locale.getDefault( ) ).anyTimes();
-        EasyMock.expect( archivaConfig.getConfiguration()).andReturn(config).anyTimes();
-        archivaConfigControl.replay();
-
-        SearchResults results = search.search( "user", selectedRepos, "archiva search", null, null );
-
-        archivaConfigControl.verify();
-
-        assertNotNull( results );
-        assertEquals( 1, results.getTotalHits() );
-    }
-
-    @Test
-    public void testQuickSearchWithPagination()
-        throws Exception
-    {
-        createSimpleIndex( true );
-
-        List<String> selectedRepos = new ArrayList<>();
-        selectedRepos.add( TEST_REPO_1 );
-
-        // page 1
-        SearchResultLimits limits = new SearchResultLimits( 0 );
-        limits.setPageSize( 1 );
-
-        EasyMock.expect( archivaConfig.getDefaultLocale() ).andReturn( Locale.getDefault( ) ).anyTimes();
-        EasyMock.expect( archivaConfig.getConfiguration()).andReturn(config).anyTimes();
-
-        archivaConfigControl.replay();
-
-        SearchResults results = search.search( "user", selectedRepos, "org", limits, Collections.emptyList() );
-
-        archivaConfigControl.verify();
-
-        assertNotNull( results );
-        assertEquals( 1, results.getHits().size() );
-        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() );
-
-        archivaConfigControl.reset();
-
-        // page 2
-        limits = new SearchResultLimits( 1 );
-        limits.setPageSize( 1 );
-
-        EasyMock.expect( archivaConfig.getDefaultLocale() ).andReturn( Locale.getDefault( ) ).anyTimes();
-        EasyMock.expect( archivaConfig.getConfiguration()).andReturn(config).anyTimes();
-
-        archivaConfigControl.replay();
-
-        results = search.search( "user", selectedRepos, "org", limits, null );
-
-        archivaConfigControl.verify();
-
-        assertNotNull( results );
-
-        assertEquals( "hits not 1", 1, results.getHits().size() );
-        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() );
-    }
-
-    @Test
-    public void testArtifactFoundInMultipleRepositories()
-        throws Exception
-    {
-        createSimpleIndex( true );
-
-        List<Path> files = new ArrayList<>();
-        files.add( Paths.get( org.apache.archiva.common.utils.FileUtils.getBasedir(), "src/test/" + TEST_REPO_2
-            + "/org/apache/archiva/archiva-search/1.0/archiva-search-1.0.jar" ) );
-        files.add( Paths.get( org.apache.archiva.common.utils.FileUtils.getBasedir(), "src/test/" + TEST_REPO_2
-            + "/org/apache/archiva/archiva-search/1.1/archiva-search-1.1.jar" ) );
-        createIndex( TEST_REPO_2, files, false );
-
-        List<String> selectedRepos = new ArrayList<>();
-        selectedRepos.add( TEST_REPO_1 );
-        selectedRepos.add( TEST_REPO_2 );
-
-        config.addManagedRepository( createRepositoryConfig( TEST_REPO_2 ) );
-
-        EasyMock.expect( archivaConfig.getDefaultLocale() ).andReturn( Locale.getDefault( ) ).anyTimes();
-        EasyMock.expect( archivaConfig.getConfiguration()).andReturn(config).anyTimes();
-
-        archivaConfigControl.replay();
-
-        // wait lucene flush.....
-        Thread.sleep( 2000 );
-
-        SearchResults results = search.search( "user", selectedRepos, "archiva-search", null, null );
-
-        archivaConfigControl.verify();
-
-        assertNotNull( results );
-
-        SearchResultHit hit =
-            results.getSearchResultHit( SearchUtil.getHitId( "org.apache.archiva", "archiva-search", null, "jar" ) );
-        assertEquals( "org.apache.archiva", hit.getGroupId() );
-        assertEquals( "archiva-search", hit.getArtifactId() );
-        assertEquals( "not 2 version for hit " + hit + "::" + niceDisplay( results ), 2, hit.getVersions().size() );
-        assertTrue( hit.getVersions().contains( "1.0" ) );
-        assertTrue( hit.getVersions().contains( "1.1" ) );
-
-        archivaConfigControl.reset();
-
-        // TODO: [BROWSE] in artifact info from browse, display all the repositories where the artifact is found
-    }
-
-    @Test
-    public void testNoMatchFound()
-        throws Exception
-    {
-        createSimpleIndex( false );
-
-        List<String> selectedRepos = new ArrayList<>();
-        selectedRepos.add( TEST_REPO_1 );
-
-        EasyMock.expect( archivaConfig.getDefaultLocale() ).andReturn( Locale.getDefault( ) ).anyTimes();
-        EasyMock.expect( archivaConfig.getConfiguration()).andReturn(config).anyTimes();
-
-        archivaConfigControl.replay();
-
-        SearchResults results = search.search( "user", selectedRepos, "dfghdfkweriuasndsaie", null, null );
-
-        archivaConfigControl.verify();
-
-        assertNotNull( results );
-        assertEquals( 0, results.getTotalHits() );
-    }
-
-    @Test
-    public void testNoIndexFound()
-        throws Exception
-    {
-        List<String> selectedRepos = new ArrayList<>();
-        selectedRepos.add( TEST_REPO_1 );
-
-        EasyMock.expect( archivaConfig.getDefaultLocale() ).andReturn( Locale.getDefault( ) ).anyTimes();
-        EasyMock.expect( archivaConfig.getConfiguration()).andReturn(config).anyTimes();
-
-        archivaConfigControl.replay();
-
-        SearchResults results = search.search( "user", selectedRepos, "org.apache.archiva", null, null );
-        assertNotNull( results );
-        assertEquals( 0, results.getTotalHits() );
-
-        archivaConfigControl.verify();
-    }
-
-    @Test
-    public void testRepositoryNotFound()
-        throws Exception
-    {
-        List<String> selectedRepos = new ArrayList<>();
-        selectedRepos.add( "non-existing-repo" );
-
-        archivaConfigControl.replay();
-
-        SearchResults results = search.search( "user", selectedRepos, "org.apache.archiva", null, null );
-        assertNotNull( results );
-        assertEquals( 0, results.getTotalHits() );
-
-        archivaConfigControl.verify();
-    }
-
-    @Test
-    public void testSearchWithinSearchResults()
-        throws Exception
-    {
-        createSimpleIndex( true );
-
-        List<String> selectedRepos = new ArrayList<>();
-        selectedRepos.add( TEST_REPO_1 );
-
-        List<String> previousSearchTerms = new ArrayList<>();
-        previousSearchTerms.add( "archiva-test" );
-
-        EasyMock.expect( archivaConfig.getDefaultLocale() ).andReturn( Locale.getDefault( ) ).anyTimes();
-        EasyMock.expect( archivaConfig.getConfiguration()).andReturn(config).anyTimes();
-
-        archivaConfigControl.replay();
-
-        SearchResults results = search.search( "user", selectedRepos, "1.0", null, previousSearchTerms );
-
-        archivaConfigControl.verify();
-
-        assertNotNull( results );
-        assertEquals( "total hints not 1", 1, results.getTotalHits() );
-
-        SearchResultHit hit = results.getHits().get( 0 );
-        assertEquals( "org.apache.archiva", hit.getGroupId() );
-        assertEquals( "archiva-test", hit.getArtifactId() );
-        assertEquals( "versions not 1", 1, hit.getVersions().size() );
-        assertEquals( "1.0", hit.getVersions().get( 0 ) );
-    }
-
-    // tests for advanced search
-    @Test
-    public void testAdvancedSearch()
-        throws Exception
-    {
-        List<Path> files = new ArrayList<>();
-        files.add( Paths.get( org.apache.archiva.common.utils.FileUtils.getBasedir(), "src/test/" + TEST_REPO_2
-            + "/org/apache/archiva/archiva-search/1.0/archiva-search-1.0.jar" ) );
-        files.add( Paths.get( org.apache.archiva.common.utils.FileUtils.getBasedir(), "src/test/" + TEST_REPO_2
-            + "/org/apache/archiva/archiva-search/1.1/archiva-search-1.1.jar" ) );
-        createIndex( TEST_REPO_2, files, false );
-
-        List<String> selectedRepos = new ArrayList<>();
-        selectedRepos.add( TEST_REPO_2 );
-
-        SearchFields searchFields = new SearchFields();
-        searchFields.setGroupId( "org.apache.archiva" );
-        searchFields.setVersion( "1.0" );
-        searchFields.setRepositories( selectedRepos );
-
-        EasyMock.expect( archivaConfig.getDefaultLocale() ).andReturn( Locale.getDefault( ) ).anyTimes();
-        EasyMock.expect( archivaConfig.getConfiguration()).andReturn(config).anyTimes();
-
-        archivaConfigControl.replay();
-
-        SearchResults results = search.search( "user", searchFields, null );
-
-        archivaConfigControl.verify();
-
-        assertNotNull( results );
-        assertEquals( 1, results.getTotalHits() );
-
-        SearchResultHit hit = results.getHits().get( 0 );
-        assertEquals( "org.apache.archiva", hit.getGroupId() );
-        assertEquals( "archiva-search", hit.getArtifactId() );
-        assertEquals( "1.0", hit.getVersions().get( 0 ) );
-    }
-
-    @Test
-    public void testAdvancedSearchWithPagination()
-        throws Exception
-    {
-        createIndexContainingMoreArtifacts( false );
-
-        List<String> selectedRepos = new ArrayList<>();
-        selectedRepos.add( TEST_REPO_1 );
-
-        SearchFields searchFields = new SearchFields();
-        searchFields.setGroupId( "org.apache.archiva" );
-        searchFields.setRepositories( selectedRepos );
-
-        // page 1
-
-        SearchResultLimits limits = new SearchResultLimits( 0 );
-        limits.setPageSize( 1 );
-
-        EasyMock.expect( archivaConfig.getDefaultLocale() ).andReturn( Locale.getDefault( ) ).anyTimes();
-        EasyMock.expect( archivaConfig.getConfiguration()).andReturn(config).anyTimes();
-
-        archivaConfigControl.replay();
-
-        SearchResults results = search.search( "user", searchFields, limits );
-
-        archivaConfigControl.verify();
-
-        assertNotNull( results );
-        assertEquals( 4, results.getTotalHits() );
-        assertEquals( 1, results.getHits().size() );
-
-        // page 2
-        archivaConfigControl.reset();
-
-        limits = new SearchResultLimits( 1 );
-        limits.setPageSize( 1 );
-
-        EasyMock.expect( archivaConfig.getDefaultLocale() ).andReturn( Locale.getDefault( ) ).anyTimes();
-        EasyMock.expect( archivaConfig.getConfiguration()).andReturn(config).anyTimes();
-
-        archivaConfigControl.replay();
-
-        results = search.search( "user", searchFields, limits );
-
-        archivaConfigControl.verify();
-
-        assertNotNull( results );
-        assertEquals( 4, results.getTotalHits() );
-        assertEquals( 1, results.getHits().size() );
-    }
-
-    // MRM-981 - artifactIds with numeric characters aren't found in advanced search
-    @Test
-    public void testAdvancedSearchArtifactIdHasNumericChar()
-        throws Exception
-    {
-        List<Path> files = new ArrayList<>();
-        files.add( Paths.get( org.apache.archiva.common.utils.FileUtils.getBasedir(),
-                             "src/test/" + TEST_REPO_1 + "/com/artifactid-numeric/1.0/artifactid-numeric-1.0.jar" ) );
-        files.add( Paths.get( org.apache.archiva.common.utils.FileUtils.getBasedir(), "src/test/" + TEST_REPO_1
-            + "/com/artifactid-numeric123/1.0/artifactid-numeric123-1.0.jar" ) );
-        createIndex( TEST_REPO_1, files, true );
-
-        List<String> selectedRepos = new ArrayList<>();
-        selectedRepos.add( TEST_REPO_1 );
-
-        SearchFields searchFields = new SearchFields();
-        searchFields.setArtifactId( "artifactid-numeric" );
-        searchFields.setRepositories( selectedRepos );
-
-        EasyMock.expect( archivaConfig.getDefaultLocale() ).andReturn( Locale.getDefault( ) ).anyTimes();
-        EasyMock.expect( archivaConfig.getConfiguration()).andReturn(config).anyTimes();
-
-        archivaConfigControl.replay();
-
-        SearchResults results = search.search( "user", searchFields, null );
-
-        archivaConfigControl.verify();
-
-        assertNotNull( results );
-        assertEquals( 2, results.getTotalHits() );
-    }
-
-    @Test
-    public void testAdvancedSearchNoRepositoriesConfigured()
-        throws Exception
-    {
-        SearchFields searchFields = new SearchFields();
-        searchFields.setArtifactId( "archiva" );
-        searchFields.setRepositories( null );
-
-        try
-        {
-            search.search( "user", searchFields, null );
-            fail( "A RepositorySearchExcecption should have been thrown." );
-        }
-        catch ( RepositorySearchException e )
-        {
-            assertEquals( "Repositories cannot be null.", e.getMessage() );
-        }
-    }
-
-    @Test
-    public void testAdvancedSearchSearchFieldsAreNull()
-        throws Exception
-    {
-        List<String> selectedRepos = new ArrayList<>();
-        selectedRepos.add( TEST_REPO_1 );
-
-        SearchFields searchFields = new SearchFields();
-        searchFields.setRepositories( selectedRepos );
-
-        try
-        {
-            EasyMock.expect( archivaConfig.getDefaultLocale() ).andReturn( Locale.getDefault( ) ).anyTimes();
-            EasyMock.expect( archivaConfig.getConfiguration()).andReturn(config).anyTimes();
-
-            archivaConfigControl.replay();
-
-            search.search( "user", searchFields, null );
-
-            archivaConfigControl.verify();
-
-            fail( "A RepositorySearchExcecption should have been thrown." );
-        }
-        catch ( RepositorySearchException e )
-        {
-            assertEquals( "No search fields set.", e.getMessage() );
-        }
-    }
-
-    @Test
-    public void testAdvancedSearchSearchFieldsAreBlank()
-        throws Exception
-    {
-        List<String> selectedRepos = new ArrayList<>();
-        selectedRepos.add( TEST_REPO_1 );
-
-        SearchFields searchFields = new SearchFields();
-        searchFields.setGroupId( "" );
-        searchFields.setArtifactId( "" );
-        searchFields.setVersion( "" );
-        searchFields.setPackaging( "" );
-        searchFields.setClassName( "" );
-
-        searchFields.setRepositories( selectedRepos );
-
-        try
-        {
-
-            EasyMock.expect( archivaConfig.getDefaultLocale() ).andReturn( Locale.getDefault( ) ).anyTimes();
-            EasyMock.expect( archivaConfig.getConfiguration()).andReturn(config).anyTimes();
-            archivaConfigControl.replay();
-
-            search.search( "user", searchFields, null );
-
-            archivaConfigControl.verify();
-
-            fail( "A RepositorySearchException should have been thrown." );
-        }
-        catch ( RepositorySearchException e )
-        {
-            assertEquals( "No search fields set.", e.getMessage() );
-        }
-    }
-
-    @Test
-    public void testAdvancedSearchAllSearchCriteriaSpecified()
-        throws Exception
-    {
-        createSimpleIndex( true );
-
-        List<String> selectedRepos = new ArrayList<>();
-        selectedRepos.add( TEST_REPO_1 );
-
-        SearchFields searchFields = new SearchFields();
-        searchFields.setGroupId( "org.apache.archiva" );
-        searchFields.setArtifactId( "archiva-test" );
-        searchFields.setVersion( "2.0" );
-        searchFields.setPackaging( "jar" );
-        searchFields.setClassName( "org.apache.archiva.test.App" );
-        searchFields.setRepositories( selectedRepos );
-
-        EasyMock.expect( archivaConfig.getDefaultLocale() ).andReturn( Locale.getDefault( ) ).anyTimes();
-        EasyMock.expect( archivaConfig.getConfiguration()).andReturn(config).anyTimes();
-
-        archivaConfigControl.replay();
-
-        SearchResults results = search.search( "user", searchFields, null );
-
-        archivaConfigControl.verify();
-
-        assertNotNull( results );
-
-        assertEquals( "total hints not 1" + results, 1, results.getTotalHits() );
-
-        SearchResultHit hit = results.getHits().get( 0 );
-        assertEquals( "org.apache.archiva", hit.getGroupId() );
-        assertEquals( "archiva-test", hit.getArtifactId() );
-        assertEquals( "version not 2.0", "2.0", hit.getVersions().get( 0 ) );
-    }
-
-    @Test
-    public void testAdvancedSearchJarArtifacts()
-        throws Exception
-    {
-        createIndexContainingMoreArtifacts( true );
-
-        List<String> selectedRepos = new ArrayList<>();
-        selectedRepos.add( TEST_REPO_1 );
-
-        SearchFields searchFields = new SearchFields();
-        searchFields.setPackaging( "jar" );
-        searchFields.setRepositories( selectedRepos );
-
-        EasyMock.expect( archivaConfig.getDefaultLocale() ).andReturn( Locale.getDefault( ) ).anyTimes();
-        EasyMock.expect( archivaConfig.getConfiguration()).andReturn(config).anyTimes();
-
-        archivaConfigControl.replay();
-
-        SearchResults results = search.search( "user", searchFields, null );
-
-        archivaConfigControl.verify();
-
-        assertNotNull( results );
-        assertEquals( "not 8 but " + results.getTotalHits() + ":" + niceDisplay( results ), 8, results.getTotalHits() );
-    }
-
-    @Test
-    public void testAdvancedSearchWithIncorrectPackaging()
-        throws Exception
-    {
-        createSimpleIndex( true );
-
-        List<String> selectedRepos = new ArrayList<>();
-        selectedRepos.add( TEST_REPO_1 );
-
-        SearchFields searchFields = new SearchFields();
-        searchFields.setGroupId( "org.apache.archiva" );
-        searchFields.setArtifactId( "archiva-test" );
-        searchFields.setVersion( "2.0" );
-        searchFields.setPackaging( "war" );
-        searchFields.setRepositories( selectedRepos );
-
-        EasyMock.expect( archivaConfig.getDefaultLocale() ).andReturn( Locale.getDefault( ) ).anyTimes();
-        EasyMock.expect( archivaConfig.getConfiguration()).andReturn(config).anyTimes();
-
-        archivaConfigControl.replay();
-
-        SearchResults results = search.search( "user", searchFields, null );
-
-        archivaConfigControl.verify();
-
-        assertNotNull( results );
-        assertEquals( 0, results.getTotalHits() );
-    }
-
-    @Test
-    public void testAdvancedSearchClassname()
-        throws Exception
-    {
-        createIndexContainingMoreArtifacts( true );
-
-        List<String> selectedRepos = Arrays.asList( TEST_REPO_1 );
-
-        SearchFields searchFields = new SearchFields();
-        searchFields.setClassName( "com.classname.search.App" );
-        searchFields.setRepositories( selectedRepos );
-
-        EasyMock.expect( archivaConfig.getDefaultLocale() ).andReturn( Locale.getDefault( ) ).anyTimes();
-        EasyMock.expect( archivaConfig.getConfiguration()).andReturn(config).anyTimes();
-
-        archivaConfigControl.replay();
-
-        SearchResults results = search.search( "user", searchFields, null );
-
-        archivaConfigControl.verify();
-
-        assertNotNull( results );
-        assertEquals( "totalHits not 1 results " + results, 1, results.getTotalHits() );
-
-        SearchResultHit hit = results.getHits().get( 0 );
-        assertEquals( "groupId not com", "com", hit.getGroupId() );
-        assertEquals( "arttifactId not classname-search", "classname-search", hit.getArtifactId() );
-        assertEquals( " hits.version(0) not 1.0", "1.0", hit.getVersions().get( 0 ) );
-    }
-
-    @Test
-    public void testAdvancedSearchNoIndexFound()
-        throws Exception
-    {
-        List<String> selectedRepos = new ArrayList<>();
-        selectedRepos.add( TEST_REPO_1 );
-
-        SearchFields searchFields = new SearchFields();
-        searchFields.setGroupId( "org.apache.archiva" );
-        searchFields.setRepositories( selectedRepos );
-
-        EasyMock.expect( archivaConfig.getDefaultLocale() ).andReturn( Locale.getDefault( ) ).anyTimes();
-        EasyMock.expect( archivaConfig.getConfiguration()).andReturn(config).anyTimes();
-
-        archivaConfigControl.replay();
-
-        SearchResults results = search.search( "user", searchFields, null );
-
-        archivaConfigControl.verify();
-
-        assertNotNull( results );
-        assertEquals( 0, results.getTotalHits() );
-    }
-
-    @Test
-    public void testAdvancedSearchClassNameInWar()
-        throws Exception
-    {
-        createIndexContainingMoreArtifacts( true );
-
-        List<String> selectedRepos = Arrays.asList( TEST_REPO_1 );
-
-        SearchFields searchFields = new SearchFields();
-        searchFields.setClassName( "SomeClass" );
-        searchFields.setRepositories( selectedRepos );
-
-        EasyMock.expect( archivaConfig.getDefaultLocale() ).andReturn( Locale.getDefault( ) ).anyTimes();
-        EasyMock.expect( archivaConfig.getConfiguration()).andReturn(config).anyTimes();
-
-        archivaConfigControl.replay();
-
-        SearchResults results = search.search( "user", searchFields, null );
-
-        archivaConfigControl.verify();
-
-        assertNotNull( results );
-        assertEquals( 1, results.getHits().size() );
-        assertEquals( "test-webapp", results.getHits().get( 0 ).getArtifactId() );
-    }
-
-    @Test
-    public void getAllGroupIds()
-        throws Exception
-    {
-        createIndexContainingMoreArtifacts( true );
-
-        List<String> selectedRepos = Arrays.asList( TEST_REPO_1 );
-
-        EasyMock.expect( archivaConfig.getConfiguration() ).andReturn( config ).times( 0, 2 );
-
-        archivaConfigControl.replay();
-
-        Collection<String> groupIds = search.getAllGroupIds( "user", selectedRepos );
-
-        archivaConfigControl.verify();
-
-        log.info( "groupIds: {}", groupIds );
-
-        assertEquals( 3, groupIds.size() );
-        assertTrue( groupIds.contains( "com" ) );
-        assertTrue( groupIds.contains( "org.apache.felix" ) );
-        assertTrue( groupIds.contains( "org.apache.archiva" ) );
-    }
-
-    @Test
-    public void testSearchWithUnknownRepo()
-        throws Exception
-    {
-        createIndexContainingMoreArtifacts( true );
-
-        List<String> selectedRepos = Arrays.asList( "foo" );
-
-        SearchFields searchFields = new SearchFields();
-        searchFields.setClassName( "SomeClass" );
-        searchFields.setRepositories( selectedRepos );
-
-        archivaConfigControl.replay();
-
-        SearchResults results = search.search( "user", searchFields, null );
-
-        archivaConfigControl.verify();
-
-        assertNotNull( results );
-        assertEquals( 0, results.getHits().size() );
-    }
-
-    @Test
-    public void nolimitedResult()
-        throws Exception
-    {
-
-        Path repo = Paths.get( "target/repo-release" );
-        Path indexDirectory = repo.resolve(".index" );
-        FileUtils.copyDirectoryStructure( Paths.get( "src/test/repo-release" ).toFile(), repo.toFile() );
-
-        IndexUpgrader.main( new String[]{ indexDirectory.toAbsolutePath().toString() } );
-
-        createIndex( "repo-release", Collections.emptyList(), false );
-
-        nexusIndexer.addIndexingContext( REPO_RELEASE, REPO_RELEASE, repo.toFile(), indexDirectory.toFile(),
-                                         repo.toUri().toURL().toExternalForm(),
-                                         indexDirectory.toUri().toURL().toString(), indexCreators );
-
-        SearchResultLimits limits = new SearchResultLimits( SearchResultLimits.ALL_PAGES );
-        limits.setPageSize( 300 );
-
-        EasyMock.expect( archivaConfig.getDefaultLocale() ).andReturn( Locale.getDefault( ) ).anyTimes();
-        EasyMock.expect( archivaConfig.getConfiguration()).andReturn(config).anyTimes();
-
-        archivaConfigControl.replay();
-
-        SearchResults searchResults = search.search( null, Arrays.asList( REPO_RELEASE ), //
-                                                     "org.example", limits, //
-                                                     Collections.emptyList() );
-
-        log.info( "results: {}", searchResults.getHits().size() );
-
-        assertEquals( 255, searchResults.getHits().size() );
-
-        SearchFields searchFields = new SearchFields();
-        searchFields.setGroupId( "org.example" );
-        searchFields.setRepositories( Arrays.asList( REPO_RELEASE ) );
-
-        searchResults = search.search( null, searchFields, limits );
-
-        log.info( "results: {}", searchResults.getHits().size() );
-
-        assertEquals( 255, searchResults.getHits().size() );
-
-        archivaConfigControl.verify();
-    }
-}

http://git-wip-us.apache.org/repos/asf/archiva/blob/c6e4e563/archiva-modules/archiva-base/archiva-maven2-indexer/src/test/resources/spring-context.xml
----------------------------------------------------------------------
diff --git a/archiva-modules/archiva-base/archiva-maven2-indexer/src/test/resources/spring-context.xml b/archiva-modules/archiva-base/archiva-maven2-indexer/src/test/resources/spring-context.xml
index e0bf5c4..13ef95f 100644
--- a/archiva-modules/archiva-base/archiva-maven2-indexer/src/test/resources/spring-context.xml
+++ b/archiva-modules/archiva-base/archiva-maven2-indexer/src/test/resources/spring-context.xml
@@ -28,6 +28,7 @@
        default-lazy-init="false">
 
   <context:annotation-config/>
+  <context:component-scan base-package="org.apache.archiva.indexer.maven" />
 
   <bean name="scheduler" class="org.apache.archiva.redback.components.scheduler.DefaultScheduler">
     <property name="properties">

http://git-wip-us.apache.org/repos/asf/archiva/blob/c6e4e563/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/MockConfiguration.java
----------------------------------------------------------------------
diff --git a/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/MockConfiguration.java b/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/MockConfiguration.java
index fce6949..54a0b94 100644
--- a/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/MockConfiguration.java
+++ b/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/MockConfiguration.java
@@ -19,12 +19,7 @@ package org.apache.archiva.proxy;
  * under the License.
  */
 
-import org.apache.archiva.configuration.ArchivaConfiguration;
-import org.apache.archiva.configuration.Configuration;
-import org.apache.archiva.configuration.ConfigurationListener;
-import org.apache.archiva.configuration.FileType;
-import org.apache.archiva.configuration.FileTypes;
-import org.apache.archiva.configuration.RepositoryScanningConfiguration;
+import org.apache.archiva.configuration.*;
 import org.apache.archiva.redback.components.registry.Registry;
 import org.apache.archiva.redback.components.registry.RegistryException;
 import org.apache.archiva.redback.components.registry.RegistryListener;
@@ -32,12 +27,10 @@ import org.easymock.EasyMock;
 import org.easymock.IMocksControl;
 import org.springframework.stereotype.Service;
 
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Locale;
-import java.util.Set;
 import javax.annotation.PostConstruct;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.*;
 
 /**
  * MockConfiguration
@@ -158,4 +151,13 @@ public class MockConfiguration
     {
         return Locale.LanguageRange.parse( "en,fr,de" );
     }
+
+    @Override
+    public Path getAppServerBaseDir() {
+        if (System.getProperties().containsKey("appserver.base")) {
+            return Paths.get(System.getProperty("appserver.base"));
+        } else {
+            return Paths.get("");
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/archiva/blob/c6e4e563/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/ArchivaIndexManager.java
----------------------------------------------------------------------
diff --git a/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/ArchivaIndexManager.java b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/ArchivaIndexManager.java
index 1891383..4663db6 100644
--- a/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/ArchivaIndexManager.java
+++ b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/ArchivaIndexManager.java
@@ -23,6 +23,7 @@ import org.apache.archiva.model.ArtifactReference;
 import org.apache.archiva.repository.Repository;
 import org.apache.archiva.repository.RepositoryType;
 
+import java.io.IOException;
 import java.net.URI;
 
 public interface ArchivaIndexManager {
@@ -31,14 +32,14 @@ public interface ArchivaIndexManager {
      * Compresses the index to a more dense packed format.
      * @param context
      */
-    void pack(ArchivaIndexingContext context);
+    void pack(ArchivaIndexingContext context) throws IOException;
 
     /**
      * Rescans the whole repository, this index is associated to.
      * @param context
      * @param update
      */
-    void scan(ArchivaIndexingContext context, boolean update);
+    void scan(ArchivaIndexingContext context, boolean update) throws IOException;
 
     /**
      * Updates the index from the remote url.
@@ -46,21 +47,21 @@ public interface ArchivaIndexManager {
      * @param remoteUpdateUri
      * @param fullUpdate
      */
-    void update(ArchivaIndexingContext context, URI remoteUpdateUri, boolean fullUpdate);
+    void update(ArchivaIndexingContext context, URI remoteUpdateUri, boolean fullUpdate) throws IOException;
 
     /**
      * Adds a artifact to the index.
      * @param context
      * @param artifactReference
      */
-    void addArtifactToIndex(ArchivaIndexingContext context, ArtifactReference artifactReference);
+    void addArtifactToIndex(ArchivaIndexingContext context, ArtifactReference artifactReference) throws IOException;
 
     /**
      * Removes a artifact from the index.
      * @param context
      * @param artifactReference
      */
-    void removeArtifactFromIndex(ArchivaIndexingContext context, ArtifactReference artifactReference);
+    void removeArtifactFromIndex(ArchivaIndexingContext context, ArtifactReference artifactReference) throws IOException;
 
 
     /**
@@ -75,5 +76,5 @@ public interface ArchivaIndexManager {
      * @param repository the repository for which the index context should be created
      * @return the index context
      */
-    ArchivaIndexingContext createContext(Repository repository);
+    ArchivaIndexingContext createContext(Repository repository) throws IOException;
 }

http://git-wip-us.apache.org/repos/asf/archiva/blob/c6e4e563/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/ArchivaIndexingContext.java
----------------------------------------------------------------------
diff --git a/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/ArchivaIndexingContext.java b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/ArchivaIndexingContext.java
index 23496e7..ee7cfc1 100644
--- a/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/ArchivaIndexingContext.java
+++ b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/ArchivaIndexingContext.java
@@ -25,6 +25,7 @@ import org.apache.archiva.repository.RepositoryType;
 import java.io.IOException;
 import java.net.URI;
 import java.time.LocalDateTime;
+import java.time.ZonedDateTime;
 import java.util.Set;
 
 /**
@@ -55,7 +56,7 @@ public interface ArchivaIndexingContext {
      * Returns true, if the index has no entries or is not initialized.
      * @return
      */
-    boolean isEmpty();
+    boolean isEmpty() throws IOException;
 
     /**
      * Writes the last changes to the index.
@@ -111,7 +112,7 @@ public interface ArchivaIndexingContext {
      * Returns the list of groups that are assigned to this index
      * @return
      */
-    Set<String> getGroups();
+    Set<String> getGroups() throws IOException;
 
     /**
      * Updates the timestamp of the index.
@@ -126,5 +127,5 @@ public interface ArchivaIndexingContext {
      * @param time
      * @throws IOException
      */
-    void updateTimestamp(boolean save, LocalDateTime time) throws IOException;
+    void updateTimestamp(boolean save, ZonedDateTime time) throws IOException;
 }

http://git-wip-us.apache.org/repos/asf/archiva/blob/c6e4e563/archiva-modules/archiva-web/archiva-webapp/src/test/log4j2-test.xml
----------------------------------------------------------------------
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/test/log4j2-test.xml b/archiva-modules/archiva-web/archiva-webapp/src/test/log4j2-test.xml
index 5566891..b4965e6 100644
--- a/archiva-modules/archiva-web/archiva-webapp/src/test/log4j2-test.xml
+++ b/archiva-modules/archiva-web/archiva-webapp/src/test/log4j2-test.xml
@@ -52,7 +52,7 @@
     <logger name="org.apache.http.headers" level="debug"/>
     -->
 
-    <logger name="org.apache.archiva.indexer.search.MavenRepositorySearch" level="info"/>
+    <logger name="org.apache.archiva.indexer.maven.search.MavenRepositorySearch" level="info"/>
 
     <logger name="org.apache.archiva.common.plexusbridge.MavenIndexerUtils" level="info"/>
 

http://git-wip-us.apache.org/repos/asf/archiva/blob/c6e4e563/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/configuration/TestConfiguration.java
----------------------------------------------------------------------
diff --git a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/configuration/TestConfiguration.java b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/configuration/TestConfiguration.java
index ce931e3..1283f62 100644
--- a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/configuration/TestConfiguration.java
+++ b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/configuration/TestConfiguration.java
@@ -4,6 +4,8 @@ import org.apache.archiva.redback.components.registry.RegistryException;
 import org.apache.archiva.redback.components.registry.RegistryListener;
 import org.springframework.stereotype.Service;
 
+import java.nio.file.Path;
+import java.nio.file.Paths;
 import java.util.List;
 import java.util.Locale;
 
@@ -92,4 +94,13 @@ public class TestConfiguration
     {
         return Locale.LanguageRange.parse("en,fr,de");
     }
+
+    @Override
+    public Path getAppServerBaseDir() {
+        if (System.getProperties().containsKey("appserver.base")) {
+            return Paths.get(System.getProperty("appserver.base"));
+        } else {
+            return Paths.get("");
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/archiva/blob/c6e4e563/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/conf/MockConfiguration.java
----------------------------------------------------------------------
diff --git a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/conf/MockConfiguration.java b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/conf/MockConfiguration.java
index d41cff0..a8d7837 100644
--- a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/conf/MockConfiguration.java
+++ b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/conf/MockConfiguration.java
@@ -28,6 +28,8 @@ import org.apache.archiva.redback.components.registry.RegistryListener;
 import org.easymock.IMocksControl;
 import org.springframework.stereotype.Service;
 
+import java.nio.file.Path;
+import java.nio.file.Paths;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Locale;
@@ -135,4 +137,13 @@ public class MockConfiguration
     {
         return Locale.LanguageRange.parse( "en,fr,de" );
     }
+
+    @Override
+    public Path getAppServerBaseDir() {
+        if (System.getProperties().containsKey("appserver.base")) {
+            return Paths.get(System.getProperty("appserver.base"));
+        } else {
+            return Paths.get("");
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/archiva/blob/c6e4e563/archiva-modules/plugins/stage-repository-merge/src/test/java/org/apache/archiva/configuration/StubConfiguration.java
----------------------------------------------------------------------
diff --git a/archiva-modules/plugins/stage-repository-merge/src/test/java/org/apache/archiva/configuration/StubConfiguration.java b/archiva-modules/plugins/stage-repository-merge/src/test/java/org/apache/archiva/configuration/StubConfiguration.java
index 1709f19..0206edb 100644
--- a/archiva-modules/plugins/stage-repository-merge/src/test/java/org/apache/archiva/configuration/StubConfiguration.java
+++ b/archiva-modules/plugins/stage-repository-merge/src/test/java/org/apache/archiva/configuration/StubConfiguration.java
@@ -23,6 +23,8 @@ import org.apache.archiva.redback.components.registry.RegistryException;
 import org.apache.archiva.redback.components.registry.RegistryListener;
 import org.springframework.stereotype.Service;
 
+import java.nio.file.Path;
+import java.nio.file.Paths;
 import java.util.List;
 import java.util.Locale;
 
@@ -92,4 +94,13 @@ public class StubConfiguration
     {
         return Locale.LanguageRange.parse( "en,fr,de" );
     }
+
+    @Override
+    public Path getAppServerBaseDir() {
+        if (System.getProperties().containsKey("appserver.base")) {
+            return Paths.get(System.getProperty("appserver.base"));
+        } else {
+            return Paths.get("");
+        }
+    }
 }


Mime
View raw message