You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@archiva.apache.org by sk...@apache.org on 2014/04/18 01:51:01 UTC
[1/3] git commit: fix import packages
Repository: archiva
Updated Branches:
refs/heads/master 1d929b31f -> a7c6ebb10
fix import packages
Project: http://git-wip-us.apache.org/repos/asf/archiva/repo
Commit: http://git-wip-us.apache.org/repos/asf/archiva/commit/4e905069
Tree: http://git-wip-us.apache.org/repos/asf/archiva/tree/4e905069
Diff: http://git-wip-us.apache.org/repos/asf/archiva/diff/4e905069
Branch: refs/heads/master
Commit: 4e9050691b62b8203d1ded669cc72e186ce17f5e
Parents: 1d929b3
Author: Eric Barboni <sk...@apache.org>
Authored: Fri Apr 18 01:43:18 2014 +0200
Committer: Eric Barboni <sk...@apache.org>
Committed: Fri Apr 18 01:43:18 2014 +0200
----------------------------------------------------------------------
archiva-modules/plugins/maven2-repository/pom.xml | 4 ----
1 file changed, 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/archiva/blob/4e905069/archiva-modules/plugins/maven2-repository/pom.xml
----------------------------------------------------------------------
diff --git a/archiva-modules/plugins/maven2-repository/pom.xml b/archiva-modules/plugins/maven2-repository/pom.xml
index 4888c72..c33ac80 100644
--- a/archiva-modules/plugins/maven2-repository/pom.xml
+++ b/archiva-modules/plugins/maven2-repository/pom.xml
@@ -239,13 +239,9 @@
org.apache.commons.lang*;version="[2.4,3)",
org.apache.maven.artifact*,
org.apache.maven.model*,
- org.apache.maven.shared.dependency.tree*,
- org.apache.maven.index*,
org.apache.maven.wagon*,
org.codehaus.plexus*,
com.google.common.io,
- org.codehaus.redback.components*,
- org.dom4j*;version="[1.6,2)",
org.springframework*;version="[3,4)",
org.slf4j;resolution:=optional,
org.apache.maven.repository.internal,
[2/3] git commit: remove unused package,
reduce annotations (value= or locations=)
Posted by sk...@apache.org.
remove unused package, reduce annotations (value= or locations=)
Project: http://git-wip-us.apache.org/repos/asf/archiva/repo
Commit: http://git-wip-us.apache.org/repos/asf/archiva/commit/fe7e671f
Tree: http://git-wip-us.apache.org/repos/asf/archiva/tree/fe7e671f
Diff: http://git-wip-us.apache.org/repos/asf/archiva/diff/fe7e671f
Branch: refs/heads/master
Commit: fe7e671f3bb075e22572da95cf2eddc100e0eb73
Parents: 4e90506
Author: Eric Barboni <sk...@apache.org>
Authored: Fri Apr 18 01:45:16 2014 +0200
Committer: Eric Barboni <sk...@apache.org>
Committed: Fri Apr 18 01:45:16 2014 +0200
----------------------------------------------------------------------
.../java/org/apache/archiva/configuration/MockRepoAdmin.java | 2 +-
.../tree/maven2/DependencyTreeBuilderTestMaven3.java | 6 +++---
.../maven2/AbstractDefaultRepositoryContentTestCase.java | 3 ---
.../maven2/AbstractLegacyRepositoryContentTestCase.java | 2 +-
.../storage/maven2/ManagedDefaultRepositoryContentTest.java | 7 ++-----
.../storage/maven2/ManagedLegacyRepositoryContentTest.java | 5 +----
.../Maven2RepositoryMetadataResolverMRM1411RepoGroupTest.java | 6 +++---
.../maven2/Maven2RepositoryMetadataResolverMRM1411Test.java | 6 +++---
.../Maven2RepositoryMetadataResolverManagedReleaseTest.java | 2 +-
.../Maven2RepositoryMetadataResolverManagedSnapshotTest.java | 5 +----
.../storage/maven2/Maven2RepositoryMetadataResolverTest.java | 6 +++---
.../archiva/metadata/repository/storage/maven2/MockWagon.java | 2 +-
.../storage/maven2/RemoteDefaultRepositoryContentTest.java | 5 +----
.../storage/maven2/RemoteLegacyRepositoryContentTest.java | 2 +-
.../archiva/repository/AbstractRepositoryLayerTestCase.java | 2 +-
.../repository/content/legacy/LegacyPathParserTest.java | 4 ++--
.../content/maven2/ArtifactExtensionMappingTest.java | 2 +-
.../repository/content/maven2/DefaultPathParserTest.java | 2 +-
.../repository/content/maven2/RepositoryRequestTest.java | 4 ++--
.../repository/metadata/Maven2RepositoryStorageTest.java | 4 ++--
.../apache/archiva/repository/metadata/MetadataToolsTest.java | 6 +++---
21 files changed, 34 insertions(+), 49 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/archiva/blob/fe7e671f/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/configuration/MockRepoAdmin.java
----------------------------------------------------------------------
diff --git a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/configuration/MockRepoAdmin.java b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/configuration/MockRepoAdmin.java
index f3c3c55..b9ba411 100644
--- a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/configuration/MockRepoAdmin.java
+++ b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/configuration/MockRepoAdmin.java
@@ -52,7 +52,7 @@ public class MockRepoAdmin
implements RemoteRepositoryAdmin, ManagedRepositoryAdmin, ProxyConnectorAdmin, NetworkProxyAdmin
{
@Inject
- @Named (value = "archivaConfiguration#test")
+ @Named ( "archivaConfiguration#test" )
private ArchivaConfiguration archivaConfiguration;
@Override
http://git-wip-us.apache.org/repos/asf/archiva/blob/fe7e671f/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/dependency/tree/maven2/DependencyTreeBuilderTestMaven3.java
----------------------------------------------------------------------
diff --git a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/dependency/tree/maven2/DependencyTreeBuilderTestMaven3.java b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/dependency/tree/maven2/DependencyTreeBuilderTestMaven3.java
index d05cad4..c277434 100644
--- a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/dependency/tree/maven2/DependencyTreeBuilderTestMaven3.java
+++ b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/dependency/tree/maven2/DependencyTreeBuilderTestMaven3.java
@@ -40,12 +40,12 @@ import java.util.Collections;
import java.util.List;
@RunWith( ArchivaSpringJUnit4ClassRunner.class )
-@ContextConfiguration( locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context.xml" } )
+@ContextConfiguration( { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context.xml" } )
public class DependencyTreeBuilderTestMaven3
extends TestCase
{
@Inject
- @Named( value = "dependencyTreeBuilder#maven3" )
+ @Named( "dependencyTreeBuilder#maven3" )
private Maven3DependencyTreeBuilder builder;
@Inject
@@ -61,7 +61,7 @@ public class DependencyTreeBuilderTestMaven3
@Inject
- @Named( value = "archivaConfiguration#test" )
+ @Named( "archivaConfiguration#test" )
ArchivaConfiguration config;
@Before
http://git-wip-us.apache.org/repos/asf/archiva/blob/fe7e671f/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/AbstractDefaultRepositoryContentTestCase.java
----------------------------------------------------------------------
diff --git a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/AbstractDefaultRepositoryContentTestCase.java b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/AbstractDefaultRepositoryContentTestCase.java
index fb425ba..0967e22 100644
--- a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/AbstractDefaultRepositoryContentTestCase.java
+++ b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/AbstractDefaultRepositoryContentTestCase.java
@@ -22,11 +22,8 @@ package org.apache.archiva.metadata.repository.storage.maven2;
import org.apache.archiva.model.ArtifactReference;
import org.apache.archiva.repository.AbstractRepositoryLayerTestCase;
import org.apache.archiva.repository.layout.LayoutException;
-import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner;
import org.apache.commons.lang.StringUtils;
import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.test.context.ContextConfiguration;
import static org.junit.Assert.*;
http://git-wip-us.apache.org/repos/asf/archiva/blob/fe7e671f/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/AbstractLegacyRepositoryContentTestCase.java
----------------------------------------------------------------------
diff --git a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/AbstractLegacyRepositoryContentTestCase.java b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/AbstractLegacyRepositoryContentTestCase.java
index f00aef4..379c28d 100644
--- a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/AbstractLegacyRepositoryContentTestCase.java
+++ b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/AbstractLegacyRepositoryContentTestCase.java
@@ -33,7 +33,7 @@ import static org.junit.Assert.*;
* AbstractLegacyRepositoryContentTestCase
*/
@RunWith ( ArchivaSpringJUnit4ClassRunner.class )
-@ContextConfiguration ( locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context-no-mock-conf.xml" } )
+@ContextConfiguration ( { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context-no-mock-conf.xml" } )
public abstract class AbstractLegacyRepositoryContentTestCase
extends AbstractRepositoryLayerTestCase
{
http://git-wip-us.apache.org/repos/asf/archiva/blob/fe7e671f/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/ManagedDefaultRepositoryContentTest.java
----------------------------------------------------------------------
diff --git a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/ManagedDefaultRepositoryContentTest.java b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/ManagedDefaultRepositoryContentTest.java
index 0b921b0..6c0033e 100644
--- a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/ManagedDefaultRepositoryContentTest.java
+++ b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/ManagedDefaultRepositoryContentTest.java
@@ -29,11 +29,8 @@ import org.apache.archiva.model.ProjectReference;
import org.apache.archiva.model.VersionedReference;
import org.apache.archiva.repository.ManagedRepositoryContent;
import org.apache.archiva.repository.layout.LayoutException;
-import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner;
import org.junit.Before;
import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.test.context.ContextConfiguration;
import javax.inject.Inject;
import javax.inject.Named;
@@ -54,14 +51,14 @@ public class ManagedDefaultRepositoryContentTest
extends AbstractDefaultRepositoryContentTestCase
{
@Inject
- @Named ( value = "managedRepositoryContent#default" )
+ @Named ( "managedRepositoryContent#default" )
private ManagedRepositoryContent repoContent;
@Inject
FileTypes fileTypes;
@Inject
- @Named ( value = "archivaConfiguration#default" )
+ @Named ( "archivaConfiguration#default" )
ArchivaConfiguration archivaConfiguration;
@Before
http://git-wip-us.apache.org/repos/asf/archiva/blob/fe7e671f/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/ManagedLegacyRepositoryContentTest.java
----------------------------------------------------------------------
diff --git a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/ManagedLegacyRepositoryContentTest.java b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/ManagedLegacyRepositoryContentTest.java
index 3bdbea0..ad52ab3 100644
--- a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/ManagedLegacyRepositoryContentTest.java
+++ b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/ManagedLegacyRepositoryContentTest.java
@@ -26,11 +26,8 @@ import org.apache.archiva.model.ProjectReference;
import org.apache.archiva.model.VersionedReference;
import org.apache.archiva.repository.ManagedRepositoryContent;
import org.apache.archiva.repository.layout.LayoutException;
-import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner;
import org.junit.Before;
import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.test.context.ContextConfiguration;
import javax.inject.Inject;
import javax.inject.Named;
@@ -51,7 +48,7 @@ public class ManagedLegacyRepositoryContentTest
extends AbstractLegacyRepositoryContentTestCase
{
@Inject
- @Named( value = "managedRepositoryContent#legacy" )
+ @Named( "managedRepositoryContent#legacy" )
private ManagedRepositoryContent repoContent;
@Before
http://git-wip-us.apache.org/repos/asf/archiva/blob/fe7e671f/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverMRM1411RepoGroupTest.java
----------------------------------------------------------------------
diff --git a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverMRM1411RepoGroupTest.java b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverMRM1411RepoGroupTest.java
index e7538de..dcc05ea 100644
--- a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverMRM1411RepoGroupTest.java
+++ b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverMRM1411RepoGroupTest.java
@@ -58,14 +58,14 @@ import static org.mockito.Mockito.when;
@RunWith ( ArchivaSpringJUnit4ClassRunner.class )
-@ContextConfiguration ( locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context.xml" } )
+@ContextConfiguration ( { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context.xml" } )
public class Maven2RepositoryMetadataResolverMRM1411RepoGroupTest
extends TestCase
{
private static final Filter<String> ALL = new AllFilter<String>();
@Inject
- @Named (value = "repositoryStorage#maven2")
+ @Named ( "repositoryStorage#maven2")
private Maven2RepositoryStorage storage;
private static final String TEST_REPO_ID = "test";
@@ -93,7 +93,7 @@ public class Maven2RepositoryMetadataResolverMRM1411RepoGroupTest
private static final String EMPTY_SHA1 = "da39a3ee5e6b4b0d3255bfef95601890afd80709";
@Inject
- @Named (value = "archivaConfiguration#default")
+ @Named ( "archivaConfiguration#default" )
private ArchivaConfiguration configuration;
private WagonFactory wagonFactory;
http://git-wip-us.apache.org/repos/asf/archiva/blob/fe7e671f/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverMRM1411Test.java
----------------------------------------------------------------------
diff --git a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverMRM1411Test.java b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverMRM1411Test.java
index 43aed4b..0b2f650 100644
--- a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverMRM1411Test.java
+++ b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverMRM1411Test.java
@@ -58,14 +58,14 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
@RunWith ( ArchivaSpringJUnit4ClassRunner.class )
-@ContextConfiguration ( locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context.xml" } )
+@ContextConfiguration ( { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context.xml" } )
public class Maven2RepositoryMetadataResolverMRM1411Test
extends TestCase
{
private static final Filter<String> ALL = new AllFilter<String>();
@Inject
- @Named (value = "repositoryStorage#maven2")
+ @Named ( "repositoryStorage#maven2")
private Maven2RepositoryStorage storage;
private static final String TEST_REPO_ID = "test";
@@ -89,7 +89,7 @@ public class Maven2RepositoryMetadataResolverMRM1411Test
private static final String EMPTY_SHA1 = "da39a3ee5e6b4b0d3255bfef95601890afd80709";
@Inject
- @Named (value = "archivaConfiguration#default")
+ @Named ( "archivaConfiguration#default" )
private ArchivaConfiguration configuration;
private WagonFactory wagonFactory;
http://git-wip-us.apache.org/repos/asf/archiva/blob/fe7e671f/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverManagedReleaseTest.java
----------------------------------------------------------------------
diff --git a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverManagedReleaseTest.java b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverManagedReleaseTest.java
index c0ebe5e..c2549ac 100644
--- a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverManagedReleaseTest.java
+++ b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverManagedReleaseTest.java
@@ -38,7 +38,7 @@ public class Maven2RepositoryMetadataResolverManagedReleaseTest
private static final Filter<String> ALL = new AllFilter<String>();
@Inject
- @Named (value = "repositoryStorage#maven2")
+ @Named ( "repositoryStorage#maven2")
private Maven2RepositoryStorage storage;
private static final String TEST_REPO_ID = "test";
http://git-wip-us.apache.org/repos/asf/archiva/blob/fe7e671f/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverManagedSnapshotTest.java
----------------------------------------------------------------------
diff --git a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverManagedSnapshotTest.java b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverManagedSnapshotTest.java
index 0cbb7a7..dbbe8e8 100644
--- a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverManagedSnapshotTest.java
+++ b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverManagedSnapshotTest.java
@@ -24,11 +24,8 @@ import org.apache.archiva.metadata.repository.filter.AllFilter;
import org.apache.archiva.metadata.repository.filter.Filter;
import org.apache.archiva.metadata.repository.storage.ReadMetadataRequest;
import org.apache.archiva.metadata.repository.storage.RepositoryStorageRuntimeException;
-import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner;
import org.junit.Before;
import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.test.context.ContextConfiguration;
import javax.inject.Inject;
import javax.inject.Named;
@@ -39,7 +36,7 @@ public class Maven2RepositoryMetadataResolverManagedSnapshotTest
private static final Filter<String> ALL = new AllFilter<String>();
@Inject
- @Named (value = "repositoryStorage#maven2")
+ @Named ( "repositoryStorage#maven2")
private Maven2RepositoryStorage storage;
private static final String TEST_REPO_ID = "test";
http://git-wip-us.apache.org/repos/asf/archiva/blob/fe7e671f/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverTest.java
----------------------------------------------------------------------
diff --git a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverTest.java b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverTest.java
index 9cf7228..f23e2d6 100644
--- a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverTest.java
+++ b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverTest.java
@@ -63,14 +63,14 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
@RunWith ( ArchivaSpringJUnit4ClassRunner.class )
-@ContextConfiguration ( locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context.xml" } )
+@ContextConfiguration ( { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context.xml" } )
public class Maven2RepositoryMetadataResolverTest
extends TestCase
{
private static final Filter<String> ALL = new AllFilter<String>();
@Inject
- @Named (value = "repositoryStorage#maven2")
+ @Named ( "repositoryStorage#maven2" )
private Maven2RepositoryStorage storage;
private static final String TEST_REPO_ID = "test";
@@ -94,7 +94,7 @@ public class Maven2RepositoryMetadataResolverTest
private static final String EMPTY_SHA1 = "da39a3ee5e6b4b0d3255bfef95601890afd80709";
@Inject
- @Named ( value = "archivaConfiguration#default" )
+ @Named ( "archivaConfiguration#default" )
protected ArchivaConfiguration configuration;
private WagonFactory wagonFactory;
http://git-wip-us.apache.org/repos/asf/archiva/blob/fe7e671f/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/MockWagon.java
----------------------------------------------------------------------
diff --git a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/MockWagon.java b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/MockWagon.java
index 4ef36d4..fee3410 100644
--- a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/MockWagon.java
+++ b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/MockWagon.java
@@ -86,7 +86,7 @@ public class MockWagon
}
@Override
- public List getFileList( String s )
+ public List<String> getFileList( String s )
throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException
{
return null;
http://git-wip-us.apache.org/repos/asf/archiva/blob/fe7e671f/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/RemoteDefaultRepositoryContentTest.java
----------------------------------------------------------------------
diff --git a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/RemoteDefaultRepositoryContentTest.java b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/RemoteDefaultRepositoryContentTest.java
index be5f77b..2145ebc 100644
--- a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/RemoteDefaultRepositoryContentTest.java
+++ b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/RemoteDefaultRepositoryContentTest.java
@@ -23,10 +23,7 @@ import org.apache.archiva.admin.model.beans.RemoteRepository;
import org.apache.archiva.model.ArtifactReference;
import org.apache.archiva.repository.RemoteRepositoryContent;
import org.apache.archiva.repository.layout.LayoutException;
-import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner;
import org.junit.Before;
-import org.junit.runner.RunWith;
-import org.springframework.test.context.ContextConfiguration;
import javax.inject.Inject;
import javax.inject.Named;
@@ -38,7 +35,7 @@ public class RemoteDefaultRepositoryContentTest
extends AbstractDefaultRepositoryContentTestCase
{
@Inject
- @Named ( value = "remoteRepositoryContent#default" )
+ @Named ( "remoteRepositoryContent#default" )
private RemoteRepositoryContent repoContent;
@Before
http://git-wip-us.apache.org/repos/asf/archiva/blob/fe7e671f/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/RemoteLegacyRepositoryContentTest.java
----------------------------------------------------------------------
diff --git a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/RemoteLegacyRepositoryContentTest.java b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/RemoteLegacyRepositoryContentTest.java
index 8cd826b..2a5e647 100644
--- a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/RemoteLegacyRepositoryContentTest.java
+++ b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/RemoteLegacyRepositoryContentTest.java
@@ -37,7 +37,7 @@ public class RemoteLegacyRepositoryContentTest
extends AbstractLegacyRepositoryContentTestCase
{
@Inject
- @Named( value = "remoteRepositoryContent#legacy" )
+ @Named( "remoteRepositoryContent#legacy" )
private RemoteRepositoryContent repoContent;
@Before
http://git-wip-us.apache.org/repos/asf/archiva/blob/fe7e671f/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/repository/AbstractRepositoryLayerTestCase.java
----------------------------------------------------------------------
diff --git a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/repository/AbstractRepositoryLayerTestCase.java b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/repository/AbstractRepositoryLayerTestCase.java
index ec52fb4..94bfe47 100644
--- a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/repository/AbstractRepositoryLayerTestCase.java
+++ b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/repository/AbstractRepositoryLayerTestCase.java
@@ -37,7 +37,7 @@ import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner;
*
*/
@RunWith( ArchivaSpringJUnit4ClassRunner.class )
-@ContextConfiguration( locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context-no-mock-conf.xml" } )
+@ContextConfiguration( { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context-no-mock-conf.xml" } )
public abstract class AbstractRepositoryLayerTestCase
{
@Rule
http://git-wip-us.apache.org/repos/asf/archiva/blob/fe7e671f/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/repository/content/legacy/LegacyPathParserTest.java
----------------------------------------------------------------------
diff --git a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/repository/content/legacy/LegacyPathParserTest.java b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/repository/content/legacy/LegacyPathParserTest.java
index 1e587c9..4b3eb5d 100644
--- a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/repository/content/legacy/LegacyPathParserTest.java
+++ b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/repository/content/legacy/LegacyPathParserTest.java
@@ -41,13 +41,13 @@ import static org.junit.Assert.*;
*
*/
@RunWith ( ArchivaSpringJUnit4ClassRunner.class )
-@ContextConfiguration ( locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context-no-mock-conf.xml" } )
+@ContextConfiguration ( { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context-no-mock-conf.xml" } )
public class LegacyPathParserTest
{
private LegacyPathParser parser;
@Inject
- @Named( value = "archivaConfiguration#default" )
+ @Named( "archivaConfiguration#default" )
ArchivaConfiguration config;
/**
http://git-wip-us.apache.org/repos/asf/archiva/blob/fe7e671f/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/repository/content/maven2/ArtifactExtensionMappingTest.java
----------------------------------------------------------------------
diff --git a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/repository/content/maven2/ArtifactExtensionMappingTest.java b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/repository/content/maven2/ArtifactExtensionMappingTest.java
index c854da0..ae72a66 100644
--- a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/repository/content/maven2/ArtifactExtensionMappingTest.java
+++ b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/repository/content/maven2/ArtifactExtensionMappingTest.java
@@ -40,7 +40,7 @@ import static org.junit.Assert.assertFalse;
*
*/
@RunWith ( ArchivaSpringJUnit4ClassRunner.class )
-@ContextConfiguration ( locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context.xml" } )
+@ContextConfiguration ( { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context.xml" } )
public class ArtifactExtensionMappingTest
{
private RepositoryPathTranslator pathTranslator = new Maven2RepositoryPathTranslator(
http://git-wip-us.apache.org/repos/asf/archiva/blob/fe7e671f/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/repository/content/maven2/DefaultPathParserTest.java
----------------------------------------------------------------------
diff --git a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/repository/content/maven2/DefaultPathParserTest.java b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/repository/content/maven2/DefaultPathParserTest.java
index b376c0b..74b2c0d 100644
--- a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/repository/content/maven2/DefaultPathParserTest.java
+++ b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/repository/content/maven2/DefaultPathParserTest.java
@@ -38,7 +38,7 @@ import static org.junit.Assert.*;
*
*/
@RunWith ( ArchivaSpringJUnit4ClassRunner.class )
-@ContextConfiguration ( locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context.xml" } )
+@ContextConfiguration ( { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context.xml" } )
public class DefaultPathParserTest
{
private PathParser parser = new DefaultPathParser();
http://git-wip-us.apache.org/repos/asf/archiva/blob/fe7e671f/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/repository/content/maven2/RepositoryRequestTest.java
----------------------------------------------------------------------
diff --git a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/repository/content/maven2/RepositoryRequestTest.java b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/repository/content/maven2/RepositoryRequestTest.java
index 2206b9f..cb5bd55 100644
--- a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/repository/content/maven2/RepositoryRequestTest.java
+++ b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/repository/content/maven2/RepositoryRequestTest.java
@@ -45,7 +45,7 @@ import static org.junit.Assert.*;
*/
@RunWith ( ArchivaSpringJUnit4ClassRunner.class )
@ContextConfiguration (
- locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context-repo-request-test.xml" } )
+ { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context-repo-request-test.xml" } )
public class RepositoryRequestTest
{
@@ -53,7 +53,7 @@ public class RepositoryRequestTest
protected ApplicationContext applicationContext;
@Inject
- @Named ( value = "archivaConfiguration#repo-request-test" )
+ @Named ( "archivaConfiguration#repo-request-test" )
private ArchivaConfiguration archivaConfiguration;
private RepositoryRequest repoRequest;
http://git-wip-us.apache.org/repos/asf/archiva/blob/fe7e671f/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/repository/metadata/Maven2RepositoryStorageTest.java
----------------------------------------------------------------------
diff --git a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/repository/metadata/Maven2RepositoryStorageTest.java b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/repository/metadata/Maven2RepositoryStorageTest.java
index 858bb86..ee52f5f 100644
--- a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/repository/metadata/Maven2RepositoryStorageTest.java
+++ b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/repository/metadata/Maven2RepositoryStorageTest.java
@@ -34,11 +34,11 @@ import javax.inject.Named;
* @author Olivier Lamy
*/
@RunWith( ArchivaSpringJUnit4ClassRunner.class )
-@ContextConfiguration( locations = { "classpath*:/META-INF/spring-context.xml" } )
+@ContextConfiguration( { "classpath*:/META-INF/spring-context.xml" } )
public class Maven2RepositoryStorageTest
{
@Inject
- @Named( value = "repositoryStorage#maven2" )
+ @Named( "repositoryStorage#maven2" )
RepositoryStorage repositoryStorage;
@Test
http://git-wip-us.apache.org/repos/asf/archiva/blob/fe7e671f/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/repository/metadata/MetadataToolsTest.java
----------------------------------------------------------------------
diff --git a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/repository/metadata/MetadataToolsTest.java b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/repository/metadata/MetadataToolsTest.java
index f7876cd..5bb87ce 100644
--- a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/repository/metadata/MetadataToolsTest.java
+++ b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/repository/metadata/MetadataToolsTest.java
@@ -58,16 +58,16 @@ import static org.junit.Assert.*;
* MetadataToolsTest
*/
@ContextConfiguration (
- locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context-metadata-tools-test.xml" } )
+ { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context-metadata-tools-test.xml" } )
public class MetadataToolsTest
extends AbstractRepositoryLayerTestCase
{
@Inject
- @Named ( value = "metadataTools#test" )
+ @Named ( "metadataTools#test" )
private MetadataTools tools;
@Inject
- @Named ( value = "archivaConfiguration#mock" )
+ @Named ( "archivaConfiguration#mock" )
protected MockConfiguration config;
@Test
[3/3] git commit: jdk 7 (multicatch) for-loop remove unused package,
reduce annotations (value= or locations=) move javadoc from
Maven2RepsotirotyStorage to RepositoryStorage
Posted by sk...@apache.org.
jdk 7 (multicatch) for-loop
remove unused package, reduce annotations (value= or locations=)
move javadoc from Maven2RepsotirotyStorage to RepositoryStorage
Project: http://git-wip-us.apache.org/repos/asf/archiva/repo
Commit: http://git-wip-us.apache.org/repos/asf/archiva/commit/a7c6ebb1
Tree: http://git-wip-us.apache.org/repos/asf/archiva/tree/a7c6ebb1
Diff: http://git-wip-us.apache.org/repos/asf/archiva/diff/a7c6ebb1
Branch: refs/heads/master
Commit: a7c6ebb10e533634d4cdd0c2baa2034979524f85
Parents: fe7e671
Author: Eric Barboni <sk...@apache.org>
Authored: Fri Apr 18 01:46:55 2014 +0200
Committer: Eric Barboni <sk...@apache.org>
Committed: Fri Apr 18 01:46:55 2014 +0200
----------------------------------------------------------------------
.../repository/storage/RepositoryStorage.java | 13 ++++-
.../maven2/Maven3DependencyTreeBuilder.java | 2 +-
.../storage/maven2/Maven2RepositoryStorage.java | 13 +----
.../storage/maven2/RepositoryModelResolver.java | 7 +--
.../legacy/AbstractLegacyRepositoryContent.java | 2 +-
.../maven2/ManagedDefaultRepositoryContent.java | 59 +++++++-------------
6 files changed, 36 insertions(+), 60 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/archiva/blob/a7c6ebb1/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/storage/RepositoryStorage.java
----------------------------------------------------------------------
diff --git a/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/storage/RepositoryStorage.java b/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/storage/RepositoryStorage.java
index 664103d..1c300b0 100644
--- a/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/storage/RepositoryStorage.java
+++ b/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/storage/RepositoryStorage.java
@@ -58,7 +58,18 @@ public interface RepositoryStorage
// FIXME: reconsider this API, do we want to expose storage format in the form of a path?
ArtifactMetadata readArtifactMetadataFromPath( String repoId, String path )
throws RepositoryStorageRuntimeException;
-
+
+ /**
+ * A relocation capable client will request the POM prior to the artifact, and will then read meta-data and do
+ * client side relocation. A simplier client (like maven 1) will only request the artifact and not use the
+ * metadatas.
+ * <p>
+ * For such clients, archiva does server-side relocation by reading itself the <relocation> element in
+ * metadatas and serving the expected artifact.
+ * @param managedRepository the used managed repository
+ * @param artifact the artifact reference
+ * @throws org.apache.archiva.policies.ProxyDownloadException
+ */
void applyServerSideRelocation( ManagedRepositoryContent managedRepository, ArtifactReference artifact )
throws ProxyDownloadException;
http://git-wip-us.apache.org/repos/asf/archiva/blob/a7c6ebb1/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/dependency/tree/maven2/Maven3DependencyTreeBuilder.java
----------------------------------------------------------------------
diff --git a/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/dependency/tree/maven2/Maven3DependencyTreeBuilder.java b/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/dependency/tree/maven2/Maven3DependencyTreeBuilder.java
index 53e801b..6acf622 100644
--- a/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/dependency/tree/maven2/Maven3DependencyTreeBuilder.java
+++ b/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/dependency/tree/maven2/Maven3DependencyTreeBuilder.java
@@ -92,7 +92,7 @@ public class Maven3DependencyTreeBuilder
private PlexusSisuBridge plexusSisuBridge;
@Inject
- @Named(value = "repositoryPathTranslator#maven2")
+ @Named( "repositoryPathTranslator#maven2" )
private RepositoryPathTranslator pathTranslator;
@Inject
http://git-wip-us.apache.org/repos/asf/archiva/blob/a7c6ebb1/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryStorage.java
----------------------------------------------------------------------
diff --git a/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryStorage.java b/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryStorage.java
index 0543c33..6db2b79 100644
--- a/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryStorage.java
+++ b/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryStorage.java
@@ -84,7 +84,6 @@ import javax.inject.Inject;
import javax.inject.Named;
import java.io.File;
import java.io.FileNotFoundException;
-import java.io.FileReader;
import java.io.FilenameFilter;
import java.io.IOException;
import java.io.Reader;
@@ -130,7 +129,7 @@ public class Maven2RepositoryStorage
private NetworkProxyAdmin networkProxyAdmin;
@Inject
- @Named( value = "repositoryPathTranslator#maven2" )
+ @Named( "repositoryPathTranslator#maven2" )
private RepositoryPathTranslator pathTranslator;
@Inject
@@ -140,7 +139,7 @@ public class Maven2RepositoryStorage
private ApplicationContext applicationContext;
@Inject
- @Named( value = "pathParser#default" )
+ @Named( "pathParser#default" )
private PathParser pathParser;
private static final String METADATA_FILENAME_START = "maven-metadata";
@@ -649,14 +648,6 @@ public class Maven2RepositoryStorage
return metadata;
}
- /**
- * A relocation capable client will request the POM prior to the artifact, and will then read meta-data and do
- * client side relocation. A simplier client (like maven 1) will only request the artifact and not use the
- * metadatas.
- * <p>
- * For such clients, archiva does server-side relocation by reading itself the <relocation> element in
- * metadatas and serving the expected artifact.
- */
@Override
public void applyServerSideRelocation( ManagedRepositoryContent managedRepository, ArtifactReference artifact )
throws ProxyDownloadException
http://git-wip-us.apache.org/repos/asf/archiva/blob/a7c6ebb1/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/RepositoryModelResolver.java
----------------------------------------------------------------------
diff --git a/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/RepositoryModelResolver.java b/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/RepositoryModelResolver.java
index 99340f3..0113513 100644
--- a/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/RepositoryModelResolver.java
+++ b/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/RepositoryModelResolver.java
@@ -403,12 +403,7 @@ public class RepositoryModelResolver
}
connected = true;
}
- catch ( ConnectionException e )
- {
- log.error( "Could not connect to {}:{} ", remoteRepository.getName(), e.getMessage() );
- connected = false;
- }
- catch ( AuthenticationException e )
+ catch ( ConnectionException | AuthenticationException e )
{
log.error( "Could not connect to {}:{} ", remoteRepository.getName(), e.getMessage() );
connected = false;
http://git-wip-us.apache.org/repos/asf/archiva/blob/a7c6ebb1/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/repository/content/legacy/AbstractLegacyRepositoryContent.java
----------------------------------------------------------------------
diff --git a/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/repository/content/legacy/AbstractLegacyRepositoryContent.java b/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/repository/content/legacy/AbstractLegacyRepositoryContent.java
index e40292d..6c7f239 100644
--- a/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/repository/content/legacy/AbstractLegacyRepositoryContent.java
+++ b/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/repository/content/legacy/AbstractLegacyRepositoryContent.java
@@ -56,7 +56,7 @@ public abstract class AbstractLegacyRepositoryContent
*
*/
@Inject
- @Named( value = "pathParser#legacy" )
+ @Named( "pathParser#legacy" )
private PathParser legacyPathParser;
public ArtifactReference toArtifactReference( String path )
http://git-wip-us.apache.org/repos/asf/archiva/blob/a7c6ebb1/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/repository/content/maven2/ManagedDefaultRepositoryContent.java
----------------------------------------------------------------------
diff --git a/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/repository/content/maven2/ManagedDefaultRepositoryContent.java b/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/repository/content/maven2/ManagedDefaultRepositoryContent.java
index 930855e..aa4ca8a 100644
--- a/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/repository/content/maven2/ManagedDefaultRepositoryContent.java
+++ b/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/repository/content/maven2/ManagedDefaultRepositoryContent.java
@@ -54,7 +54,7 @@ public class ManagedDefaultRepositoryContent
implements ManagedRepositoryContent
{
@Inject
- @Named (value = "fileTypes")
+ @Named ( "fileTypes" )
private FileTypes filetypes;
private ManagedRepository repository;
@@ -182,20 +182,17 @@ public class ManagedDefaultRepositoryContent
"Unable to get related artifacts using a non-directory: " + repoDir.getAbsolutePath() );
}
- Set<ArtifactReference> foundArtifacts = new HashSet<ArtifactReference>();
+ Set<ArtifactReference> foundArtifacts = new HashSet<>();
// First gather up the versions found as artifacts in the managed repository.
File repoFiles[] = repoDir.listFiles();
- for ( int i = 0; i < repoFiles.length; i++ )
+ for (File repoFile : repoFiles)
{
- if ( repoFiles[i].isDirectory() )
- {
+ if (repoFile.isDirectory()) {
// Skip it. it's a directory.
continue;
}
-
- String relativePath = PathUtil.getRelative( repository.getLocation(), repoFiles[i] );
-
+ String relativePath = PathUtil.getRelative(repository.getLocation(), repoFile);
if ( filetypes.matchesArtifactPattern( relativePath ) )
{
try
@@ -204,7 +201,7 @@ public class ManagedDefaultRepositoryContent
// Test for related, groupId / artifactId / version must match.
if ( artifact.getGroupId().equals( reference.getGroupId() ) && artifact.getArtifactId().equals(
- reference.getArtifactId() ) && artifact.getVersion().equals( reference.getVersion() ) )
+ reference.getArtifactId() ) && artifact.getVersion().equals( reference.getVersion() ) )
{
foundArtifacts.add( artifact );
}
@@ -265,24 +262,21 @@ public class ManagedDefaultRepositoryContent
"Unable to get Versions on a non-directory: " + repoDir.getAbsolutePath() );
}
- Set<String> foundVersions = new HashSet<String>();
+ Set<String> foundVersions = new HashSet<>();
VersionedReference versionRef = new VersionedReference();
versionRef.setGroupId( reference.getGroupId() );
versionRef.setArtifactId( reference.getArtifactId() );
File repoFiles[] = repoDir.listFiles();
- for ( int i = 0; i < repoFiles.length; i++ )
+ for (File repoFile : repoFiles)
{
- if ( !repoFiles[i].isDirectory() )
- {
+ if (!repoFile.isDirectory()) {
// Skip it. not a directory.
continue;
}
-
// Test if dir has an artifact, which proves to us that it is a valid version directory.
- String version = repoFiles[i].getName();
+ String version = repoFile.getName();
versionRef.setVersion( version );
-
if ( hasArtifact( versionRef ) )
{
// Found an artifact, must be a valid version.
@@ -319,26 +313,22 @@ public class ManagedDefaultRepositoryContent
"Unable to get versions on a non-directory: " + repoDir.getAbsolutePath() );
}
- Set<String> foundVersions = new HashSet<String>();
+ Set<String> foundVersions = new HashSet<>();
// First gather up the versions found as artifacts in the managed repository.
File repoFiles[] = repoDir.listFiles();
- for ( int i = 0; i < repoFiles.length; i++ )
+ for (File repoFile : repoFiles)
{
- if ( repoFiles[i].isDirectory() )
- {
+ if (repoFile.isDirectory()) {
// Skip it. it's a directory.
continue;
}
-
- String relativePath = PathUtil.getRelative( repository.getLocation(), repoFiles[i] );
-
+ String relativePath = PathUtil.getRelative(repository.getLocation(), repoFile);
if ( filetypes.matchesDefaultExclusions( relativePath ) )
{
// Skip it, it's metadata or similar
continue;
}
-
if ( filetypes.matchesArtifactPattern( relativePath ) )
{
try
@@ -372,11 +362,7 @@ public class ManagedDefaultRepositoryContent
Set<String> versions = getVersions( reference );
return !versions.isEmpty();
}
- catch ( ContentNotFoundException e )
- {
- return false;
- }
- catch ( LayoutException e )
+ catch ( ContentNotFoundException | LayoutException e )
{
return false;
}
@@ -389,11 +375,7 @@ public class ManagedDefaultRepositoryContent
{
return ( getFirstArtifact( reference ) != null );
}
- catch ( IOException e )
- {
- return false;
- }
- catch ( LayoutException e )
+ catch ( IOException | LayoutException e )
{
return false;
}
@@ -470,16 +452,13 @@ public class ManagedDefaultRepositoryContent
}
File repoFiles[] = repoDir.listFiles();
- for ( int i = 0; i < repoFiles.length; i++ )
+ for (File repoFile : repoFiles)
{
- if ( repoFiles[i].isDirectory() )
- {
+ if (repoFile.isDirectory()) {
// Skip it. it's a directory.
continue;
}
-
- String relativePath = PathUtil.getRelative( repository.getLocation(), repoFiles[i] );
-
+ String relativePath = PathUtil.getRelative(repository.getLocation(), repoFile);
if ( filetypes.matchesArtifactPattern( relativePath ) )
{
ArtifactReference artifact = toArtifactReference( relativePath );