diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/utils/ArtifactDownloadInfoBuilder.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/utils/ArtifactDownloadInfoBuilder.java index e90c1bd14..8f9f1e1be 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/utils/ArtifactDownloadInfoBuilder.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/utils/ArtifactDownloadInfoBuilder.java @@ -62,7 +62,7 @@ public class ArtifactDownloadInfoBuilder public Artifact build() { ArtifactReference ref = new ArtifactReference(); - ref.setArtifactId( artifactMetadata.getProject() ); + ref.setArtifactId( artifactMetadata.getId() ); ref.setGroupId( artifactMetadata.getNamespace() ); ref.setVersion( artifactMetadata.getVersion() ); @@ -82,6 +82,7 @@ public class ArtifactDownloadInfoBuilder String extension = FilenameUtils.getExtension( file.getName() ); Artifact artifact = new Artifact( ref.getGroupId(), ref.getArtifactId(), ref.getVersion() ); + artifact.setRepositoryId( artifactMetadata.getRepositoryId() ); artifact.setClassifier( classifier ); artifact.setPackaging( type ); artifact.setFileExtension( extension ); diff --git a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/archiva/web/action/ShowArtifactActionTest.java b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/archiva/web/action/ShowArtifactActionTest.java index 108d9dcb8..00814525d 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/archiva/web/action/ShowArtifactActionTest.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/archiva/web/action/ShowArtifactActionTest.java @@ -567,7 +567,8 @@ public class ShowArtifactActionTest Artifact actual = list.get( 0 ); assertEquals( artifact.getNamespace(), actual.getGroupId() ); assertEquals( artifact.getId(), actual.getArtifactId() ); - assertEquals( artifact.getProject(), actual.getGroupId() ); + // olamy test has no more sense as we reuse an other object now + //assertEquals( artifact.getProject(), actual.getGroupId() ); assertEquals( artifact.getRepositoryId(), actual.getRepositoryId() ); assertEquals( artifact.getVersion(), actual.getVersion() ); assertEquals( TEST_TYPE, actual.getPackaging() );