summaryrefslogtreecommitdiffstats
path: root/archiva-modules/plugins/maven2-repository
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2014-03-31 13:23:20 +0000
committerOlivier Lamy <olamy@apache.org>2014-03-31 13:23:20 +0000
commit4d70362d9dd75ce2c6f7ed9fa9e4fc507c1c8670 (patch)
tree86449be08892ddba7e60c3f51e347eb5b4f1709f /archiva-modules/plugins/maven2-repository
parent0a691774f36c92c3bc9a54ec23a9602a5df7d5cd (diff)
downloadarchiva-4d70362d9dd75ce2c6f7ed9fa9e4fc507c1c8670.tar.gz
archiva-4d70362d9dd75ce2c6f7ed9fa9e4fc507c1c8670.zip
fix unit test with adding mocks
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1583324 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/plugins/maven2-repository')
-rw-r--r--archiva-modules/plugins/maven2-repository/pom.xml2
-rw-r--r--archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryStorage.java24
2 files changed, 12 insertions, 14 deletions
diff --git a/archiva-modules/plugins/maven2-repository/pom.xml b/archiva-modules/plugins/maven2-repository/pom.xml
index 218d8b5e5..334802c24 100644
--- a/archiva-modules/plugins/maven2-repository/pom.xml
+++ b/archiva-modules/plugins/maven2-repository/pom.xml
@@ -20,8 +20,8 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
- <artifactId>plugins</artifactId>
<groupId>org.apache.archiva</groupId>
+ <artifactId>plugins</artifactId>
<version>2.0.2-SNAPSHOT</version>
</parent>
<artifactId>maven2-repository</artifactId>
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 85ca42828..47f34d266 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
@@ -35,7 +35,6 @@ import org.apache.archiva.maven2.metadata.MavenMetadataReader;
import org.apache.archiva.metadata.model.ArtifactMetadata;
import org.apache.archiva.metadata.model.ProjectMetadata;
import org.apache.archiva.metadata.model.ProjectVersionMetadata;
-import org.apache.archiva.metadata.repository.RepositorySessionFactory;
import org.apache.archiva.metadata.repository.filter.Filter;
import org.apache.archiva.metadata.repository.storage.ReadMetadataRequest;
import org.apache.archiva.metadata.repository.storage.RelocationException;
@@ -74,7 +73,6 @@ import org.apache.maven.model.building.ModelBuildingException;
import org.apache.maven.model.building.ModelBuildingRequest;
import org.apache.maven.model.building.ModelProblem;
import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
-import org.apache.maven.wagon.PathUtils;
import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -111,6 +109,9 @@ import java.util.Map;
public class Maven2RepositoryStorage
implements RepositoryStorage
{
+
+ private static final Logger LOGGER = LoggerFactory.getLogger( Maven2RepositoryStorage.class );
+
private ModelBuilder builder;
@Inject
@@ -139,8 +140,6 @@ public class Maven2RepositoryStorage
@Named( value = "pathParser#default" )
private PathParser pathParser;
- private static final Logger log = LoggerFactory.getLogger( Maven2RepositoryStorage.class );
-
private static final String METADATA_FILENAME_START = "maven-metadata";
private static final String METADATA_FILENAME = METADATA_FILENAME_START + ".xml";
@@ -173,10 +172,9 @@ public class Maven2RepositoryStorage
// olamy: in case of browsing via the ui we can mix repos (parent of a SNAPSHOT can come from release repo)
if ( !readMetadataRequest.isBrowsingRequest() )
{
-
- if ( VersionUtil.isSnapshot(
- artifactVersion ) ) // skygo trying to improve speed by honoring managed configuration MRM-1658
+ if ( VersionUtil.isSnapshot( artifactVersion ) )
{
+ // skygo trying to improve speed by honoring managed configuration MRM-1658
if ( managedRepository.isReleases() && !managedRepository.isSnapshots() )
{
throw new RepositoryStorageRuntimeException( "lookforsnaponreleaseonly",
@@ -214,8 +212,8 @@ public class Maven2RepositoryStorage
}
catch ( XMLException e )
{
- // unable to parse metadata - log it, and continue with the version as the original SNAPSHOT version
- log.warn( "Invalid metadata: {} - {}", metadataFile, e.getMessage() );
+ // unable to parse metadata - LOGGER it, and continue with the version as the original SNAPSHOT version
+ LOGGER.warn( "Invalid metadata: {} - {}", metadataFile, e.getMessage() );
}
}
@@ -301,8 +299,8 @@ public class Maven2RepositoryStorage
if ( ( problem.getException() instanceof FileNotFoundException && e.getModelId() != null &&
!e.getModelId().equals( problem.getModelId() ) ) )
{
- log.warn( "The artifact's parent POM file '{}' cannot be resolved. "
- + "Using defaults for project version metadata..", file );
+ LOGGER.warn( "The artifact's parent POM file '{}' cannot be resolved. "
+ + "Using defaults for project version metadata..", file );
ProjectVersionMetadata metadata = new ProjectVersionMetadata();
metadata.setId( readMetadataRequest.getProjectVersion() );
@@ -871,7 +869,7 @@ public class Maven2RepositoryStorage
}
catch ( IOException e )
{
- log.error( "Unable to checksum file {}: {},MD5", file, e.getMessage() );
+ LOGGER.error( "Unable to checksum file {}: {},MD5", file, e.getMessage() );
}
try
{
@@ -879,7 +877,7 @@ public class Maven2RepositoryStorage
}
catch ( IOException e )
{
- log.error( "Unable to checksum file {}: {},SHA1", file, e.getMessage() );
+ LOGGER.error( "Unable to checksum file {}: {},SHA1", file, e.getMessage() );
}
metadata.setSize( file.length() );
}