From 75c63ff2eb458cd0f4ca971035789db62e5c92c3 Mon Sep 17 00:00:00 2001 From: Brett Porter Date: Wed, 30 Jul 2014 12:02:04 +1000 Subject: [PATCH] split out problem facet this avoids modules wanting to report a problem from having to depend on the plugin itself and its consumer, etc. --- .../archiva-web/archiva-rest/archiva-rest-api/pom.xml | 5 ----- .../archiva/rest/api/services/ReportRepositoriesService.java | 2 +- .../rest/services/DefaultReportRepositoriesService.java | 2 +- .../metadata/model/facets}/RepositoryProblemFacet.java | 2 +- archiva-modules/plugins/maven2-repository/pom.xml | 4 ---- .../repository/storage/maven2/Maven2RepositoryStorage.java | 2 +- .../archiva/reports/RepositoryProblemEventListener.java | 1 + .../archiva/reports/RepositoryProblemFacetFactory.java | 1 + .../reports/consumers/DuplicateArtifactsConsumer.java | 2 +- .../reports/consumers/DuplicateArtifactsConsumerTest.java | 2 +- 10 files changed, 8 insertions(+), 15 deletions(-) rename archiva-modules/{plugins/problem-reports/src/main/java/org/apache/archiva/reports => metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/facets}/RepositoryProblemFacet.java (98%) diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/pom.xml b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/pom.xml index b2d600249..374b53a29 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/pom.xml +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/pom.xml @@ -70,11 +70,6 @@ repository-statistics - - org.apache.archiva - problem-reports - - org.apache.archiva.redback redback-authorization-api diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/ReportRepositoriesService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/ReportRepositoriesService.java index b2b10d7a4..1bb718554 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/ReportRepositoriesService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/ReportRepositoriesService.java @@ -18,9 +18,9 @@ package org.apache.archiva.rest.api.services; * under the License. */ +import org.apache.archiva.metadata.model.facets.RepositoryProblemFacet; import org.apache.archiva.metadata.repository.stats.RepositoryStatistics; import org.apache.archiva.redback.authorization.RedbackAuthorization; -import org.apache.archiva.reports.RepositoryProblemFacet; import org.apache.archiva.security.common.ArchivaRoleConstants; import javax.ws.rs.GET; diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultReportRepositoriesService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultReportRepositoriesService.java index 37b5f9b1f..b8c1c74a5 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultReportRepositoriesService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultReportRepositoriesService.java @@ -18,12 +18,12 @@ package org.apache.archiva.rest.services; * under the License. */ +import org.apache.archiva.metadata.model.facets.RepositoryProblemFacet; import org.apache.archiva.metadata.repository.MetadataRepository; import org.apache.archiva.metadata.repository.MetadataRepositoryException; import org.apache.archiva.metadata.repository.RepositorySession; import org.apache.archiva.metadata.repository.stats.RepositoryStatistics; import org.apache.archiva.metadata.repository.stats.RepositoryStatisticsManager; -import org.apache.archiva.reports.RepositoryProblemFacet; import org.apache.archiva.rest.api.services.ArchivaRestServiceException; import org.apache.archiva.rest.api.services.ReportRepositoriesService; import org.apache.commons.lang.StringUtils; diff --git a/archiva-modules/plugins/problem-reports/src/main/java/org/apache/archiva/reports/RepositoryProblemFacet.java b/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/facets/RepositoryProblemFacet.java similarity index 98% rename from archiva-modules/plugins/problem-reports/src/main/java/org/apache/archiva/reports/RepositoryProblemFacet.java rename to archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/facets/RepositoryProblemFacet.java index 2f6417da0..dc202a165 100644 --- a/archiva-modules/plugins/problem-reports/src/main/java/org/apache/archiva/reports/RepositoryProblemFacet.java +++ b/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/facets/RepositoryProblemFacet.java @@ -1,4 +1,4 @@ -package org.apache.archiva.reports; +package org.apache.archiva.metadata.model.facets; /* * Licensed to the Apache Software Foundation (ASF) under one diff --git a/archiva-modules/plugins/maven2-repository/pom.xml b/archiva-modules/plugins/maven2-repository/pom.xml index 3a74321a3..128977667 100644 --- a/archiva-modules/plugins/maven2-repository/pom.xml +++ b/archiva-modules/plugins/maven2-repository/pom.xml @@ -48,10 +48,6 @@ org.apache.archiva archiva-proxy - - org.apache.archiva - problem-reports - org.apache.archiva archiva-proxy-api 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 f1027f255..1f6cd2b71 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 @@ -49,7 +49,7 @@ import org.apache.archiva.model.SnapshotVersion; import org.apache.archiva.policies.ProxyDownloadException; import org.apache.archiva.proxy.common.WagonFactory; import org.apache.archiva.proxy.model.RepositoryProxyConnectors; -import org.apache.archiva.reports.RepositoryProblemFacet; +import org.apache.archiva.metadata.model.facets.RepositoryProblemFacet; import org.apache.archiva.repository.ManagedRepositoryContent; import org.apache.archiva.repository.content.PathParser; import org.apache.archiva.repository.layout.LayoutException; diff --git a/archiva-modules/plugins/problem-reports/src/main/java/org/apache/archiva/reports/RepositoryProblemEventListener.java b/archiva-modules/plugins/problem-reports/src/main/java/org/apache/archiva/reports/RepositoryProblemEventListener.java index 6be32322c..304866a24 100644 --- a/archiva-modules/plugins/problem-reports/src/main/java/org/apache/archiva/reports/RepositoryProblemEventListener.java +++ b/archiva-modules/plugins/problem-reports/src/main/java/org/apache/archiva/reports/RepositoryProblemEventListener.java @@ -20,6 +20,7 @@ package org.apache.archiva.reports; */ import org.apache.archiva.metadata.model.ProjectVersionMetadata; +import org.apache.archiva.metadata.model.facets.RepositoryProblemFacet; import org.apache.archiva.metadata.repository.MetadataRepository; import org.apache.archiva.metadata.repository.MetadataRepositoryException; import org.apache.archiva.metadata.repository.RepositorySession; diff --git a/archiva-modules/plugins/problem-reports/src/main/java/org/apache/archiva/reports/RepositoryProblemFacetFactory.java b/archiva-modules/plugins/problem-reports/src/main/java/org/apache/archiva/reports/RepositoryProblemFacetFactory.java index d14c1563a..e2ca9c579 100644 --- a/archiva-modules/plugins/problem-reports/src/main/java/org/apache/archiva/reports/RepositoryProblemFacetFactory.java +++ b/archiva-modules/plugins/problem-reports/src/main/java/org/apache/archiva/reports/RepositoryProblemFacetFactory.java @@ -21,6 +21,7 @@ package org.apache.archiva.reports; import org.apache.archiva.metadata.model.MetadataFacet; import org.apache.archiva.metadata.model.MetadataFacetFactory; +import org.apache.archiva.metadata.model.facets.RepositoryProblemFacet; import org.springframework.stereotype.Service; /** diff --git a/archiva-modules/plugins/problem-reports/src/main/java/org/apache/archiva/reports/consumers/DuplicateArtifactsConsumer.java b/archiva-modules/plugins/problem-reports/src/main/java/org/apache/archiva/reports/consumers/DuplicateArtifactsConsumer.java index dd12b7a62..5cabece94 100644 --- a/archiva-modules/plugins/problem-reports/src/main/java/org/apache/archiva/reports/consumers/DuplicateArtifactsConsumer.java +++ b/archiva-modules/plugins/problem-reports/src/main/java/org/apache/archiva/reports/consumers/DuplicateArtifactsConsumer.java @@ -36,7 +36,7 @@ import org.apache.archiva.metadata.repository.RepositorySessionFactory; import org.apache.archiva.metadata.repository.storage.RepositoryPathTranslator; import org.apache.archiva.redback.components.registry.Registry; import org.apache.archiva.redback.components.registry.RegistryListener; -import org.apache.archiva.reports.RepositoryProblemFacet; +import org.apache.archiva.metadata.model.facets.RepositoryProblemFacet; import org.apache.commons.collections.CollectionUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/archiva-modules/plugins/problem-reports/src/test/java/org/apache/archiva/reports/consumers/DuplicateArtifactsConsumerTest.java b/archiva-modules/plugins/problem-reports/src/test/java/org/apache/archiva/reports/consumers/DuplicateArtifactsConsumerTest.java index b86bee0ef..4af6bc7ca 100644 --- a/archiva-modules/plugins/problem-reports/src/test/java/org/apache/archiva/reports/consumers/DuplicateArtifactsConsumerTest.java +++ b/archiva-modules/plugins/problem-reports/src/test/java/org/apache/archiva/reports/consumers/DuplicateArtifactsConsumerTest.java @@ -28,7 +28,7 @@ import org.apache.archiva.metadata.repository.MetadataRepository; import org.apache.archiva.metadata.repository.RepositorySession; import org.apache.archiva.metadata.repository.RepositorySessionFactory; import org.apache.archiva.metadata.repository.storage.RepositoryPathTranslator; -import org.apache.archiva.reports.RepositoryProblemFacet; +import org.apache.archiva.metadata.model.facets.RepositoryProblemFacet; import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner; import org.junit.Before; import org.junit.Test; -- 2.39.5