diff options
author | Brett Porter <brett@apache.org> | 2011-06-28 08:05:07 +0000 |
---|---|---|
committer | Brett Porter <brett@apache.org> | 2011-06-28 08:05:07 +0000 |
commit | a5c5d53fa11f7706ccafec757e386b33c7d3ac99 (patch) | |
tree | ec0481d021e92e1ab38e7b4abbb1a43c734d7cc9 /archiva-modules/plugins | |
parent | 23e2f88dfb5505ec932173c017d1a003320ffddf (diff) | |
download | archiva-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')
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; } } |