summaryrefslogtreecommitdiffstats
path: root/archiva-modules/plugins
diff options
context:
space:
mode:
authorBrett Porter <brett@apache.org>2011-06-28 08:05:07 +0000
committerBrett Porter <brett@apache.org>2011-06-28 08:05:07 +0000
commita5c5d53fa11f7706ccafec757e386b33c7d3ac99 (patch)
treeec0481d021e92e1ab38e7b4abbb1a43c734d7cc9 /archiva-modules/plugins
parent23e2f88dfb5505ec932173c017d1a003320ffddf (diff)
downloadarchiva-a5c5d53fa11f7706ccafec757e386b33c7d3ac99.tar.gz
archiva-a5c5d53fa11f7706ccafec757e386b33c7d3ac99.zip
[MRM-1335] improve the message appearing when an artifact's metadata is incomplete
Submitted by: Greg Michael Meneses git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1140473 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/plugins')
-rw-r--r--archiva-modules/plugins/maven2-repository/pom.xml4
-rw-r--r--archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryStorage.java19
2 files changed, 20 insertions, 3 deletions
diff --git a/archiva-modules/plugins/maven2-repository/pom.xml b/archiva-modules/plugins/maven2-repository/pom.xml
index 6c4df0d8a..7001fa6aa 100644
--- a/archiva-modules/plugins/maven2-repository/pom.xml
+++ b/archiva-modules/plugins/maven2-repository/pom.xml
@@ -39,6 +39,10 @@
</dependency>
<dependency>
<groupId>org.apache.archiva</groupId>
+ <artifactId>problem-reports</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.archiva</groupId>
<artifactId>archiva-proxy-common</artifactId>
</dependency>
<dependency>
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 f4291eca3..d99f1644b 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
@@ -30,6 +30,7 @@ import org.apache.archiva.metadata.repository.storage.RepositoryStorage;
import org.apache.archiva.metadata.repository.storage.RepositoryStorageMetadataInvalidException;
import org.apache.archiva.metadata.repository.storage.RepositoryStorageMetadataNotFoundException;
import org.apache.archiva.proxy.common.WagonFactory;
+import org.apache.archiva.reports.RepositoryProblemFacet;
import org.apache.maven.archiva.common.utils.VersionUtil;
import org.apache.maven.archiva.configuration.ArchivaConfiguration;
import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
@@ -56,9 +57,6 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
-import javax.annotation.PostConstruct;
-import javax.inject.Inject;
-import javax.inject.Named;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FilenameFilter;
@@ -71,6 +69,9 @@ import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import javax.annotation.PostConstruct;
+import javax.inject.Inject;
+import javax.inject.Named;
/**
* Maven 2 repository format storage implementation. This class currently takes parameters to indicate the repository to
@@ -246,6 +247,18 @@ public class Maven2RepositoryStorage
facet.setPackaging( "jar" );
metadata.addFacet( facet );
+ String errMsg = "Error in resolving artifact's parent POM file. " + problem.getException().getMessage();
+ RepositoryProblemFacet repoProblemFacet = new RepositoryProblemFacet();
+ repoProblemFacet.setRepositoryId( repoId );
+ repoProblemFacet.setId( repoId );
+ repoProblemFacet.setMessage( errMsg );
+ repoProblemFacet.setProblem( errMsg );
+ repoProblemFacet.setProject( projectId );
+ repoProblemFacet.setVersion( projectVersion );
+ repoProblemFacet.setNamespace( namespace );
+
+ metadata.addFacet( repoProblemFacet );
+
return metadata;
}
}