git-svn-id: https://svn.apache.org/repos/asf/maven/repository-manager/trunk@360039 13f79535-47bb-0310-9956-ffa450edef68tags/archiva-0.9-alpha-1
@@ -37,16 +37,18 @@ import java.util.Map; | |||
/** | |||
* This class will report on bad metadata files. These include invalid version declarations and incomplete version | |||
* information inside the metadata file. Plugin metadata will be checked for validity of the latest plugin artifacts. | |||
* | |||
* @plexus.component role="org.apache.maven.repository.reporting.MetadataReportProcessor" role-hint="bad-metadata" | |||
*/ | |||
public class BadMetadataReportProcessor | |||
implements MetadataReportProcessor | |||
{ | |||
// plexus components | |||
/** @plexus.requirement */ | |||
private ArtifactFactory artifactFactory; | |||
/** @plexus.requirement */ | |||
private RepositoryQueryLayerFactory repositoryQueryLayerFactory; | |||
/** | |||
* Process the metadata encountered in the repository and report all errors found, if any. | |||
* |
@@ -34,9 +34,12 @@ import java.security.NoSuchAlgorithmException; | |||
/** | |||
* This class reports invalid and mismatched checksums of artifacts and metadata files. | |||
* It validates MD5 and SHA-1 checksums. | |||
* | |||
* @todo remove stateful parts, change to singleton instantiation | |||
* @plexus.component role="org.apache.maven.repository.reporting.ArtifactReportProcessor" role-hint="checksum" instantiation-strategy="per-lookup" | |||
*/ | |||
public class ChecksumArtifactReporter | |||
implements ArtifactReportProcessor, MetadataReportProcessor | |||
implements ArtifactReportProcessor | |||
{ | |||
protected InputStream md5InputStream; | |||
@@ -0,0 +1,45 @@ | |||
package org.apache.maven.repository.reporting; | |||
/* | |||
* Copyright 2005-2006 The Apache Software Foundation. | |||
* | |||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||
* you may not use this file except in compliance with the License. | |||
* You may obtain a copy of the License at | |||
* | |||
* http://www.apache.org/licenses/LICENSE-2.0 | |||
* | |||
* Unless required by applicable law or agreed to in writing, software | |||
* distributed under the License is distributed on an "AS IS" BASIS, | |||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
* See the License for the specific language governing permissions and | |||
* limitations under the License. | |||
*/ | |||
import org.apache.maven.artifact.Artifact; | |||
import org.apache.maven.artifact.repository.ArtifactRepository; | |||
import org.apache.maven.artifact.repository.metadata.RepositoryMetadata; | |||
import org.apache.maven.model.Model; | |||
import java.io.File; | |||
import java.io.FileInputStream; | |||
import java.io.FileNotFoundException; | |||
import java.io.IOException; | |||
import java.io.InputStream; | |||
import java.io.InputStreamReader; | |||
import java.net.URL; | |||
import java.security.MessageDigest; | |||
import java.security.NoSuchAlgorithmException; | |||
/** | |||
* This class reports invalid and mismatched checksums of artifacts and metadata files. | |||
* It validates MD5 and SHA-1 checksums. | |||
* | |||
* @todo remove this duplicate class for the parent using one role | |||
* @plexus.component role="org.apache.maven.repository.reporting.MetadataReportProcessor" role-hint="checksum-metadata" instantiation-strategy="per-lookup" | |||
*/ | |||
public class ChecksumMetadataReporter | |||
extends ChecksumArtifactReporter | |||
implements MetadataReportProcessor | |||
{ | |||
} |
@@ -23,6 +23,7 @@ import org.apache.maven.artifact.repository.ArtifactRepository; | |||
* | |||
* @author <a href="mailto:brett@apache.org">Brett Porter</a> | |||
* @version $Id$ | |||
* @plexus.component role="org.apache.maven.repository.reporting.RepositoryQueryLayerFactory" | |||
*/ | |||
public class DefaultRepositoryQueryLayerFactory | |||
implements RepositoryQueryLayerFactory |
@@ -33,11 +33,11 @@ import java.net.URL; | |||
/** | |||
* This class validates well-formedness of pom xml file. | |||
* @plexus.component role="org.apache.maven.repository.reporting.ArtifactReportProcessor" role-hint="invalid-pom" | |||
*/ | |||
public class InvalidPomArtifactReportProcessor | |||
implements ArtifactReportProcessor | |||
{ | |||
/** | |||
* @param model | |||
* @param artifact The pom xml file to be validated, passed as an artifact object. |
@@ -36,10 +36,12 @@ import java.util.jar.JarFile; | |||
* Validate the location of the artifact based on the values indicated | |||
* in its pom (both the pom packaged with the artifact & the pom in the | |||
* file system). | |||
* @plexus.component role="org.apache.maven.repository.reporting.ArtifactReportProcessor" role-hint="artifact-location" | |||
*/ | |||
public class LocationArtifactReportProcessor | |||
implements ArtifactReportProcessor | |||
{ | |||
/** @plexus.requirement */ | |||
private ArtifactFactory artifactFactory; | |||
/** |
@@ -1,66 +0,0 @@ | |||
<!-- | |||
~ Copyright 2005-2006 The Apache Software Foundation. | |||
~ | |||
~ Licensed under the Apache License, Version 2.0 (the "License"); | |||
~ you may not use this file except in compliance with the License. | |||
~ You may obtain a copy of the License at | |||
~ | |||
~ http://www.apache.org/licenses/LICENSE-2.0 | |||
~ | |||
~ Unless required by applicable law or agreed to in writing, software | |||
~ distributed under the License is distributed on an "AS IS" BASIS, | |||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
~ See the License for the specific language governing permissions and | |||
~ limitations under the License. | |||
--> | |||
<component-set> | |||
<components> | |||
<component> | |||
<role>org.apache.maven.repository.reporting.RepositoryQueryLayerFactory</role> | |||
<implementation>org.apache.maven.repository.reporting.DefaultRepositoryQueryLayerFactory</implementation> | |||
</component> | |||
<component> | |||
<role>org.apache.maven.repository.reporting.MetadataReportProcessor</role> | |||
<role-hint>bad-metadata</role-hint> | |||
<implementation>org.apache.maven.repository.reporting.BadMetadataReportProcessor</implementation> | |||
<requirements> | |||
<requirement> | |||
<role>org.apache.maven.repository.reporting.RepositoryQueryLayerFactory</role> | |||
</requirement> | |||
<requirement> | |||
<role>org.apache.maven.artifact.factory.ArtifactFactory</role> | |||
</requirement> | |||
</requirements> | |||
</component> | |||
<component> | |||
<role>org.apache.maven.repository.reporting.ArtifactReportProcessor</role> | |||
<role-hint>checksum</role-hint> | |||
<implementation>org.apache.maven.repository.reporting.ChecksumArtifactReporter</implementation> | |||
<instantiation-strategy>per-lookup</instantiation-strategy> | |||
</component> | |||
<component> | |||
<role>org.apache.maven.repository.reporting.MetadataReportProcessor</role> | |||
<role-hint>checksum-metadata</role-hint> | |||
<implementation>org.apache.maven.repository.reporting.ChecksumArtifactReporter</implementation> | |||
<instantiation-strategy>per-lookup</instantiation-strategy> | |||
</component> | |||
<component> | |||
<role>org.apache.maven.repository.reporting.ArtifactReportProcessor</role> | |||
<role-hint>artifact-location</role-hint> | |||
<implementation>org.apache.maven.repository.reporting.LocationArtifactReportProcessor</implementation> | |||
<instantiation-strategy>per-lookup</instantiation-strategy> | |||
<requirements> | |||
<requirement> | |||
<role>org.apache.maven.artifact.factory.ArtifactFactory</role> | |||
</requirement> | |||
</requirements> | |||
</component> | |||
<component> | |||
<role>org.apache.maven.repository.reporting.ArtifactReportProcessor</role> | |||
<role-hint>invalid-pom</role-hint> | |||
<implementation>org.apache.maven.repository.reporting.InvalidPomArtifactReportProcessor</implementation> | |||
<instantiation-strategy>per-lookup</instantiation-strategy> | |||
</component> | |||
</components> | |||
</component-set> |