]> source.dussan.org Git - archiva.git/commitdiff
Refactoring package names for maven metadata
authorMartin Stockhammer <martin_s@apache.org>
Sun, 8 Mar 2020 15:01:50 +0000 (16:01 +0100)
committerMartin Stockhammer <martin_s@apache.org>
Sun, 8 Mar 2020 15:03:56 +0000 (16:03 +0100)
29 files changed:
archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/AbstractRepositoryPurge.java
archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/mock/ManagedRepositoryContentMock.java
archiva-modules/archiva-maven/archiva-maven-metadata/src/main/java/org/apache/archiva/maven2/metadata/MavenMetadataReader.java [deleted file]
archiva-modules/archiva-maven/archiva-maven-metadata/src/main/java/org/apache/archiva/metadata/maven/MavenMetadataReader.java [new file with mode: 0644]
archiva-modules/archiva-maven/archiva-maven-metadata/src/main/java/org/apache/archiva/metadata/maven/model/MavenArtifactFacet.java [new file with mode: 0644]
archiva-modules/archiva-maven/archiva-maven-metadata/src/main/java/org/apache/archiva/metadata/model/maven2/MavenArtifactFacet.java [deleted file]
archiva-modules/archiva-maven/archiva-maven-metadata/src/main/resources/META-INF/spring-context.xml
archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/repository/mock/ManagedRepositoryContentMock.java
archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/repository/maven/content/DefaultPathParser.java
archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/repository/maven/content/ManagedDefaultRepositoryContent.java
archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/repository/maven/content/MavenContentHelper.java
archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/repository/maven/dependency/tree/Maven3DependencyTreeBuilder.java
archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/repository/maven/merge/Maven2RepositoryMerger.java
archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/repository/maven/metadata/storage/Maven2RepositoryPathTranslator.java
archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/repository/maven/metadata/storage/Maven2RepositoryStorage.java
archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/repository/maven/metadata/storage/MavenArtifactFacetFactory.java
archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/repository/maven/metadata/storage/RepositoryModelResolver.java
archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/maven/content/ArtifactExtensionMappingTest.java
archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/maven/content/MavenContentHelperTest.java
archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/maven/metadata/RepositoryMetadataReaderTest.java
archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/maven/metadata/storage/Maven2RepositoryMetadataResolverTest.java
archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/maven/metadata/storage/MavenRepositoryMetadataReaderTest.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoriesService.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/utils/ArtifactBuilder.java
archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/api/DefaultFileUploadService.java
archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/RepositoryServletRepositoryGroupTest.java
archiva-modules/metadata/metadata-statistics-api/src/main/java/org/apache/archiva/metadata/repository/stats/model/RepositoryWalkingStatisticsProvider.java
archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepository.java
archiva-modules/plugins/repository-statistics/src/test/java/org/apache/archiva/metadata/repository/stats/RepositoryStatisticsManagerTest.java

index 2e04e667a278d2d512786f87fa92ae575b931d9c..e94b613bf02e64c862689dffb633f0456d1fd8ef 100644 (file)
@@ -22,7 +22,7 @@ package org.apache.archiva.consumers.core.repository;
 import org.apache.archiva.common.utils.VersionUtil;
 import org.apache.archiva.metadata.model.ArtifactMetadata;
 import org.apache.archiva.metadata.model.facets.AuditEvent;
-import org.apache.archiva.metadata.model.maven2.MavenArtifactFacet;
+import org.apache.archiva.metadata.maven.model.MavenArtifactFacet;
 import org.apache.archiva.metadata.repository.*;
 import org.apache.archiva.model.ArtifactReference;
 import org.apache.archiva.repository.ContentNotFoundException;
index 66ab810ad19adc088a6912817bf2f65d8edf8a36..d1ce70567c47a14e32166d2d521111436472f95c 100644 (file)
@@ -22,7 +22,7 @@ package org.apache.archiva.repository.scanner.mock;
 import org.apache.archiva.common.filelock.DefaultFileLockManager;
 import org.apache.archiva.common.utils.VersionUtil;
 import org.apache.archiva.metadata.model.ArtifactMetadata;
-import org.apache.archiva.metadata.model.maven2.MavenArtifactFacet;
+import org.apache.archiva.metadata.maven.model.MavenArtifactFacet;
 import org.apache.archiva.model.ArchivaArtifact;
 import org.apache.archiva.model.ArtifactReference;
 import org.apache.archiva.model.ProjectReference;
diff --git a/archiva-modules/archiva-maven/archiva-maven-metadata/src/main/java/org/apache/archiva/maven2/metadata/MavenMetadataReader.java b/archiva-modules/archiva-maven/archiva-maven-metadata/src/main/java/org/apache/archiva/maven2/metadata/MavenMetadataReader.java
deleted file mode 100644 (file)
index 05daa17..0000000
+++ /dev/null
@@ -1,197 +0,0 @@
-package org.apache.archiva.maven2.metadata;
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.archiva.model.ArchivaRepositoryMetadata;
-import org.apache.archiva.model.Plugin;
-import org.apache.archiva.model.SnapshotVersion;
-import org.apache.archiva.repository.RepositoryType;
-import org.apache.archiva.repository.metadata.MetadataReader;
-import org.apache.archiva.repository.metadata.RepositoryMetadataException;
-import org.apache.archiva.repository.storage.StorageAsset;
-import org.apache.archiva.xml.XMLException;
-import org.apache.archiva.xml.XMLReader;
-import org.apache.archiva.xml.XmlUtil;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.commons.lang3.math.NumberUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.stereotype.Service;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-import java.io.IOException;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.time.Instant;
-import java.util.Date;
-
-/**
- * @author Olivier Lamy
- * @since 1.4-M3
- */
-@Service("metadataReader#maven")
-public class MavenMetadataReader implements MetadataReader
-{
-    public static final String MAVEN_METADATA = "maven-metadata.xml";
-
-
-    /*
-    <?xml version="1.0" encoding="UTF-8"?>
-    <metadata modelVersion="1.1.0">
-      <groupId>org.apache.archiva</groupId>
-      <artifactId>archiva</artifactId>
-      <version>1.4-M3-SNAPSHOT</version>
-      <versioning>
-        <snapshot>
-          <timestamp>20120310.230917</timestamp>
-          <buildNumber>2</buildNumber>
-        </snapshot>
-        <lastUpdated>20120310230917</lastUpdated>
-        <snapshotVersions>
-          <snapshotVersion>
-            <extension>pom</extension>
-            <value>1.4-M3-20120310.230917-2</value>
-            <updated>20120310230917</updated>
-          </snapshotVersion>
-        </snapshotVersions>
-      </versioning>
-    </metadata>
-    */
-
-    private static final Logger log = LoggerFactory.getLogger( MavenMetadataReader.class );
-
-
-    /**
-     * Read and return the {@link org.apache.archiva.model.ArchivaRepositoryMetadata} object from the provided xml file.
-     *
-     * @param metadataFile the maven-metadata.xml file to read.
-     * @return the archiva repository metadata object that represents the provided file contents.
-     * @throws RepositoryMetadataException if the file cannot be read
-     */
-    public ArchivaRepositoryMetadata read( StorageAsset metadataFile )
-            throws RepositoryMetadataException {
-
-        XMLReader xml;
-        try
-        {
-            xml = new XMLReader( "metadata", metadataFile );
-        }
-        catch ( XMLException e )
-        {
-            throw new RepositoryMetadataException( "Could not open XML metadata file " + metadataFile, e );
-        }
-        return read( xml, metadataFile.getModificationTime(), metadataFile.getSize() );
-
-    }
-
-    public ArchivaRepositoryMetadata read( Path metadataFile )
-        throws RepositoryMetadataException {
-
-        XMLReader xml;
-        try
-        {
-            xml = new XMLReader( "metadata", metadataFile );
-        }
-        catch ( XMLException e )
-        {
-            log.error( "XML error while reading metadata file {}: {}", metadataFile, e.getMessage(), e );
-            throw new RepositoryMetadataException( "Could not open XML metadata file " + metadataFile, e );
-        }
-        try
-        {
-            return read( xml, Files.getLastModifiedTime( metadataFile ).toInstant(), Files.size( metadataFile ) );
-        }
-        catch ( IOException e )
-        {
-            log.error( "IO Error while reading metadata file {}: {}", metadataFile, e.getMessage(), e );
-            throw new RepositoryMetadataException( "Could not open XML metadata file " + metadataFile, e );
-        }
-
-    }
-
-    private ArchivaRepositoryMetadata read( XMLReader xml, Instant modTime, long fileSize) throws RepositoryMetadataException
-    {
-        // invoke this to remove namespaces, see MRM-1136
-        xml.removeNamespaces();
-
-        ArchivaRepositoryMetadata metadata = new ArchivaRepositoryMetadata();
-
-        try
-        {
-            metadata.setGroupId( xml.getElementText( "//metadata/groupId" ) );
-            metadata.setArtifactId( xml.getElementText( "//metadata/artifactId" ) );
-            metadata.setVersion( xml.getElementText( "//metadata/version" ) );
-            metadata.setFileLastModified( Date.from(modTime) );
-            metadata.setFileSize( fileSize );
-            metadata.setLastUpdated( xml.getElementText( "//metadata/versioning/lastUpdated" ) );
-            metadata.setLatestVersion( xml.getElementText( "//metadata/versioning/latest" ) );
-            metadata.setReleasedVersion( xml.getElementText( "//metadata/versioning/release" ) );
-            metadata.setAvailableVersions( xml.getElementListText( "//metadata/versioning/versions/version" ) );
-
-            Element snapshotElem = xml.getElement( "//metadata/versioning/snapshot" );
-            if ( snapshotElem != null )
-            {
-                SnapshotVersion snapshot = new SnapshotVersion( );
-                snapshot.setTimestamp( XmlUtil.getChildText( snapshotElem, "timestamp" ) );
-                String buildNumber = XmlUtil.getChildText( snapshotElem, "buildNumber" );
-                if ( NumberUtils.isCreatable( buildNumber ) )
-                {
-                    snapshot.setBuildNumber( NumberUtils.toInt( buildNumber ) );
-                }
-                metadata.setSnapshotVersion( snapshot );
-            }
-
-            for ( Node node : xml.getElementList( "//metadata/plugins/plugin" ) )
-            {
-                if ( node instanceof Element )
-                {
-                    Element plugin = (Element) node;
-                    Plugin p = new Plugin( );
-                    String prefix = plugin.getElementsByTagName( "prefix" ).item( 0 ).getTextContent( ).trim( );
-                    p.setPrefix( prefix );
-                    String artifactId = plugin.getElementsByTagName( "artifactId" ).item( 0 ).getTextContent( ).trim( );
-                    p.setArtifactId( artifactId );
-                    String name = plugin.getElementsByTagName( "name" ).item( 0 ).getTextContent( ).trim( );
-                    p.setName( name );
-                    metadata.addPlugin( p );
-                }
-            }
-        } catch ( XMLException e) {
-            throw new RepositoryMetadataException( "XML Error while reading metadata file : " + e.getMessage( ), e );
-        }
-        return metadata;
-    }
-
-    @Override
-    public boolean isValidMetadataPath( String path )
-    {
-        if ( StringUtils.isNotEmpty( path ) ) {
-            return path.endsWith( MAVEN_METADATA );
-        } else {
-            return false;
-        }
-    }
-
-    @Override
-    public boolean isValidForType( RepositoryType repositoryType )
-    {
-        return RepositoryType.MAVEN.equals( repositoryType );
-    }
-}
diff --git a/archiva-modules/archiva-maven/archiva-maven-metadata/src/main/java/org/apache/archiva/metadata/maven/MavenMetadataReader.java b/archiva-modules/archiva-maven/archiva-maven-metadata/src/main/java/org/apache/archiva/metadata/maven/MavenMetadataReader.java
new file mode 100644 (file)
index 0000000..8f04ff1
--- /dev/null
@@ -0,0 +1,196 @@
+package org.apache.archiva.metadata.maven;
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.archiva.model.ArchivaRepositoryMetadata;
+import org.apache.archiva.model.Plugin;
+import org.apache.archiva.model.SnapshotVersion;
+import org.apache.archiva.repository.RepositoryType;
+import org.apache.archiva.repository.metadata.MetadataReader;
+import org.apache.archiva.repository.metadata.RepositoryMetadataException;
+import org.apache.archiva.repository.storage.StorageAsset;
+import org.apache.archiva.xml.XMLException;
+import org.apache.archiva.xml.XMLReader;
+import org.apache.archiva.xml.XmlUtil;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.math.NumberUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.time.Instant;
+import java.util.Date;
+
+/**
+ * @author Olivier Lamy
+ * @since 1.4-M3
+ */
+@Service("metadataReader#maven")
+public class MavenMetadataReader implements MetadataReader
+{
+    public static final String MAVEN_METADATA = "maven-metadata.xml";
+
+
+    /*
+    <?xml version="1.0" encoding="UTF-8"?>
+    <metadata modelVersion="1.1.0">
+      <groupId>org.apache.archiva</groupId>
+      <artifactId>archiva</artifactId>
+      <version>1.4-M3-SNAPSHOT</version>
+      <versioning>
+        <snapshot>
+          <timestamp>20120310.230917</timestamp>
+          <buildNumber>2</buildNumber>
+        </snapshot>
+        <lastUpdated>20120310230917</lastUpdated>
+        <snapshotVersions>
+          <snapshotVersion>
+            <extension>pom</extension>
+            <value>1.4-M3-20120310.230917-2</value>
+            <updated>20120310230917</updated>
+          </snapshotVersion>
+        </snapshotVersions>
+      </versioning>
+    </metadata>
+    */
+
+    private static final Logger log = LoggerFactory.getLogger( MavenMetadataReader.class );
+
+
+    /**
+     * Read and return the {@link org.apache.archiva.model.ArchivaRepositoryMetadata} object from the provided xml file.
+     *
+     * @param metadataFile the maven-metadata.xml file to read.
+     * @return the archiva repository metadata object that represents the provided file contents.
+     * @throws RepositoryMetadataException if the file cannot be read
+     */
+    public ArchivaRepositoryMetadata read( StorageAsset metadataFile )
+            throws RepositoryMetadataException {
+
+        XMLReader xml;
+        try
+        {
+            xml = new XMLReader( "metadata", metadataFile );
+        }
+        catch ( XMLException e )
+        {
+            throw new RepositoryMetadataException( "Could not open XML metadata file " + metadataFile, e );
+        }
+        return read( xml, metadataFile.getModificationTime(), metadataFile.getSize() );
+
+    }
+
+    public ArchivaRepositoryMetadata read( Path metadataFile )
+        throws RepositoryMetadataException {
+
+        XMLReader xml;
+        try
+        {
+            xml = new XMLReader( "metadata", metadataFile );
+        }
+        catch ( XMLException e )
+        {
+            log.error( "XML error while reading metadata file {}: {}", metadataFile, e.getMessage(), e );
+            throw new RepositoryMetadataException( "Could not open XML metadata file " + metadataFile, e );
+        }
+        try
+        {
+            return read( xml, Files.getLastModifiedTime( metadataFile ).toInstant(), Files.size( metadataFile ) );
+        }
+        catch ( IOException e )
+        {
+            log.error( "IO Error while reading metadata file {}: {}", metadataFile, e.getMessage(), e );
+            throw new RepositoryMetadataException( "Could not open XML metadata file " + metadataFile, e );
+        }
+
+    }
+
+    private ArchivaRepositoryMetadata read( XMLReader xml, Instant modTime, long fileSize) throws RepositoryMetadataException
+    {
+        // invoke this to remove namespaces, see MRM-1136
+        xml.removeNamespaces();
+
+        ArchivaRepositoryMetadata metadata = new ArchivaRepositoryMetadata();
+
+        try
+        {
+            metadata.setGroupId( xml.getElementText( "//metadata/groupId" ) );
+            metadata.setArtifactId( xml.getElementText( "//metadata/artifactId" ) );
+            metadata.setVersion( xml.getElementText( "//metadata/version" ) );
+            metadata.setFileLastModified( Date.from(modTime) );
+            metadata.setFileSize( fileSize );
+            metadata.setLastUpdated( xml.getElementText( "//metadata/versioning/lastUpdated" ) );
+            metadata.setLatestVersion( xml.getElementText( "//metadata/versioning/latest" ) );
+            metadata.setReleasedVersion( xml.getElementText( "//metadata/versioning/release" ) );
+            metadata.setAvailableVersions( xml.getElementListText( "//metadata/versioning/versions/version" ) );
+
+            Element snapshotElem = xml.getElement( "//metadata/versioning/snapshot" );
+            if ( snapshotElem != null )
+            {
+                SnapshotVersion snapshot = new SnapshotVersion( );
+                snapshot.setTimestamp( XmlUtil.getChildText( snapshotElem, "timestamp" ) );
+                String buildNumber = XmlUtil.getChildText( snapshotElem, "buildNumber" );
+                if ( NumberUtils.isCreatable( buildNumber ) )
+                {
+                    snapshot.setBuildNumber( NumberUtils.toInt( buildNumber ) );
+                }
+                metadata.setSnapshotVersion( snapshot );
+            }
+
+            for ( Node node : xml.getElementList( "//metadata/plugins/plugin" ) )
+            {
+                if ( node instanceof Element )
+                {
+                    Element plugin = (Element) node;
+                    Plugin p = new Plugin( );
+                    String prefix = plugin.getElementsByTagName( "prefix" ).item( 0 ).getTextContent( ).trim( );
+                    p.setPrefix( prefix );
+                    String artifactId = plugin.getElementsByTagName( "artifactId" ).item( 0 ).getTextContent( ).trim( );
+                    p.setArtifactId( artifactId );
+                    String name = plugin.getElementsByTagName( "name" ).item( 0 ).getTextContent( ).trim( );
+                    p.setName( name );
+                    metadata.addPlugin( p );
+                }
+            }
+        } catch ( XMLException e) {
+            throw new RepositoryMetadataException( "XML Error while reading metadata file : " + e.getMessage( ), e );
+        }
+        return metadata;
+    }
+
+    @Override
+    public boolean isValidMetadataPath( String path )
+    {
+        if ( StringUtils.isNotEmpty( path ) ) {
+            return path.endsWith( MAVEN_METADATA );
+        } else {
+            return false;
+        }
+    }
+
+    @Override
+    public boolean isValidForType( RepositoryType repositoryType )
+    {
+        return RepositoryType.MAVEN.equals( repositoryType );
+    }
+}
diff --git a/archiva-modules/archiva-maven/archiva-maven-metadata/src/main/java/org/apache/archiva/metadata/maven/model/MavenArtifactFacet.java b/archiva-modules/archiva-maven/archiva-maven-metadata/src/main/java/org/apache/archiva/metadata/maven/model/MavenArtifactFacet.java
new file mode 100644 (file)
index 0000000..6d0f8df
--- /dev/null
@@ -0,0 +1,143 @@
+package org.apache.archiva.metadata.maven.model;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.archiva.metadata.model.MetadataFacet;
+import org.apache.commons.lang3.StringUtils;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class MavenArtifactFacet
+    implements MetadataFacet
+{
+    private String classifier;
+
+    private String type;
+
+    private String timestamp;
+
+    private int buildNumber;
+
+    public static final String FACET_ID = "org.apache.archiva.metadata.repository.storage.maven2.artifact";
+
+    public String getClassifier()
+    {
+        return classifier;
+    }
+
+    public void setClassifier( String classifier )
+    {
+        this.classifier = classifier;
+    }
+
+    public String getType()
+    {
+        return type;
+    }
+
+    public void setType( String type )
+    {
+        this.type = type;
+    }
+
+    public String getTimestamp()
+    {
+        return timestamp;
+    }
+
+    public void setTimestamp( String timestamp )
+    {
+        this.timestamp = timestamp;
+    }
+
+    public int getBuildNumber()
+    {
+        return buildNumber;
+    }
+
+    public void setBuildNumber( int buildNumber )
+    {
+        this.buildNumber = buildNumber;
+    }
+
+    @Override
+    public String getFacetId()
+    {
+        return FACET_ID;
+    }
+
+    @Override
+    public String getName()
+    {
+        // TODO: not needed, perhaps artifact/version metadata facet should be separate interface?
+        return null;
+    }
+
+    @Override
+    public Map<String, String> toProperties()
+    {
+        Map<String, String> properties = new HashMap<>();
+        properties.put( "type", type );
+        if ( classifier != null )
+        {
+            properties.put( "classifier", classifier );
+        }
+        if ( timestamp != null )
+        {
+            properties.put( "timestamp", timestamp );
+        }
+        if ( buildNumber > 0 )
+        {
+            properties.put( "buildNumber", Integer.toString( buildNumber ) );
+        }
+        return properties;
+    }
+
+    @Override
+    public void fromProperties( Map<String, String> properties )
+    {
+        type = properties.get( "type" );
+        classifier = properties.get( "classifier" );
+        timestamp = properties.get( "timestamp" );
+        String buildNumber = properties.get( "buildNumber" );
+        if ( buildNumber != null )
+        {
+            this.buildNumber = Integer.parseInt( buildNumber );
+        }
+    }
+
+    @Override
+    public boolean equals( Object o )
+    {
+        if ( this == o )
+        {
+            return true;
+        }
+        if ( !( o instanceof MavenArtifactFacet ) )
+        {
+            return false;
+        }
+
+        MavenArtifactFacet that = (MavenArtifactFacet) o;
+
+        return StringUtils.equals( that.getClassifier(), this.classifier );
+    }
+
+}
diff --git a/archiva-modules/archiva-maven/archiva-maven-metadata/src/main/java/org/apache/archiva/metadata/model/maven2/MavenArtifactFacet.java b/archiva-modules/archiva-maven/archiva-maven-metadata/src/main/java/org/apache/archiva/metadata/model/maven2/MavenArtifactFacet.java
deleted file mode 100644 (file)
index 8c65aac..0000000
+++ /dev/null
@@ -1,144 +0,0 @@
-package org.apache.archiva.metadata.model.maven2;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.archiva.metadata.model.MetadataFacet;
-import org.apache.commons.lang3.StringUtils;
-
-import java.util.HashMap;
-import java.util.Map;
-
-public class MavenArtifactFacet
-    implements MetadataFacet
-{
-    private String classifier;
-
-    private String type;
-
-    private String timestamp;
-
-    private int buildNumber;
-
-    public static final String FACET_ID = "org.apache.archiva.metadata.repository.storage.maven2.artifact";
-
-    public String getClassifier()
-    {
-        return classifier;
-    }
-
-    public void setClassifier( String classifier )
-    {
-        this.classifier = classifier;
-    }
-
-    public String getType()
-    {
-        return type;
-    }
-
-    public void setType( String type )
-    {
-        this.type = type;
-    }
-
-    public String getTimestamp()
-    {
-        return timestamp;
-    }
-
-    public void setTimestamp( String timestamp )
-    {
-        this.timestamp = timestamp;
-    }
-
-    public int getBuildNumber()
-    {
-        return buildNumber;
-    }
-
-    public void setBuildNumber( int buildNumber )
-    {
-        this.buildNumber = buildNumber;
-    }
-
-    @Override
-    public String getFacetId()
-    {
-        return FACET_ID;
-    }
-
-    @Override
-    public String getName()
-    {
-        // TODO: not needed, perhaps artifact/version metadata facet should be separate interface?
-        return null;
-    }
-
-    @Override
-    public Map<String, String> toProperties()
-    {
-        Map<String, String> properties = new HashMap<>();
-        properties.put( "type", type );
-        if ( classifier != null )
-        {
-            properties.put( "classifier", classifier );
-        }
-        if ( timestamp != null )
-        {
-            properties.put( "timestamp", timestamp );
-        }
-        if ( buildNumber > 0 )
-        {
-            properties.put( "buildNumber", Integer.toString( buildNumber ) );
-        }
-        return properties;
-    }
-
-    @Override
-    public void fromProperties( Map<String, String> properties )
-    {
-        type = properties.get( "type" );
-        classifier = properties.get( "classifier" );
-        timestamp = properties.get( "timestamp" );
-        String buildNumber = properties.get( "buildNumber" );
-        if ( buildNumber != null )
-        {
-            this.buildNumber = Integer.parseInt( buildNumber );
-        }
-    }
-
-    @Override
-    public boolean equals( Object o )
-    {
-        if ( this == o )
-        {
-            return true;
-        }
-        if ( !( o instanceof MavenArtifactFacet ) )
-        {
-            return false;
-        }
-
-        MavenArtifactFacet that = (MavenArtifactFacet) o;
-
-        return StringUtils.equals( that.getClassifier(), this.classifier );
-    }
-
-}
index f95430808fd41eee1a96e606b0de2e0e5ff633e4..4163a146092cd5b2c83e368dbb63a9282c11ffff 100644 (file)
@@ -28,6 +28,6 @@
        default-lazy-init="true">
 
   <context:annotation-config/>
-  <context:component-scan base-package="org.apache.archiva.maven2.metadata"/>
+  <context:component-scan base-package="org.apache.archiva.metadata.maven"/>
 
 </beans>
\ No newline at end of file
index d06ccd20540a8424574df66e1b9bc7f4b06b7605..87db3d80601c853c55c2dac8e5ef4e71ad162d86 100644 (file)
@@ -22,7 +22,7 @@ package org.apache.archiva.repository.mock;
 import org.apache.archiva.common.filelock.DefaultFileLockManager;
 import org.apache.archiva.common.utils.VersionUtil;
 import org.apache.archiva.metadata.model.ArtifactMetadata;
-import org.apache.archiva.metadata.model.maven2.MavenArtifactFacet;
+import org.apache.archiva.metadata.maven.model.MavenArtifactFacet;
 import org.apache.archiva.model.ArchivaArtifact;
 import org.apache.archiva.model.ArtifactReference;
 import org.apache.archiva.model.ProjectReference;
index d637911d0acec4961d6dd71ad1483e9783e78a7c..4754f13602f1a1e0819d8972f990031080dafc85 100644 (file)
@@ -19,7 +19,7 @@ package org.apache.archiva.repository.maven.content;
  */
 
 import org.apache.archiva.metadata.model.ArtifactMetadata;
-import org.apache.archiva.metadata.model.maven2.MavenArtifactFacet;
+import org.apache.archiva.metadata.maven.model.MavenArtifactFacet;
 import org.apache.archiva.metadata.repository.storage.RepositoryPathTranslator;
 import org.apache.archiva.repository.maven.metadata.storage.ArtifactMappingProvider;
 import org.apache.archiva.repository.maven.metadata.storage.DefaultArtifactMappingProvider;
index dfc0f04d550b6d4903d09593127359ce6060cbba..417dab7d22d430a47816e777070da0aa7cfda461 100644 (file)
@@ -22,7 +22,7 @@ import org.apache.archiva.common.filelock.FileLockManager;
 import org.apache.archiva.common.utils.FileUtils;
 import org.apache.archiva.common.utils.VersionUtil;
 import org.apache.archiva.configuration.FileTypes;
-import org.apache.archiva.maven2.metadata.MavenMetadataReader;
+import org.apache.archiva.metadata.maven.MavenMetadataReader;
 import org.apache.archiva.metadata.repository.storage.RepositoryPathTranslator;
 import org.apache.archiva.repository.maven.metadata.storage.ArtifactMappingProvider;
 import org.apache.archiva.repository.maven.metadata.storage.DefaultArtifactMappingProvider;
index 1a807a0e4ae9387fe71b016c5840e8a7999ca20a..84192a5e72e30368c237b2c1dfc96d93d5d0dca7 100644 (file)
@@ -19,7 +19,7 @@ package org.apache.archiva.repository.maven.content;
  */
 
 import org.apache.archiva.common.utils.VersionUtil;
-import org.apache.archiva.maven2.metadata.MavenMetadataReader;
+import org.apache.archiva.metadata.maven.MavenMetadataReader;
 import org.apache.archiva.model.ArchivaRepositoryMetadata;
 import org.apache.archiva.model.SnapshotVersion;
 import org.apache.archiva.repository.content.ItemSelector;
index 696afd784f77572eb5c62b5a85acd612c310f322..d41c05f5a9eb890daace38587195402de0437277 100644 (file)
@@ -26,7 +26,7 @@ import org.apache.archiva.admin.model.proxyconnector.ProxyConnectorAdmin;
 import org.apache.archiva.common.plexusbridge.PlexusSisuBridge;
 import org.apache.archiva.common.plexusbridge.PlexusSisuBridgeException;
 import org.apache.archiva.common.utils.VersionUtil;
-import org.apache.archiva.maven2.metadata.MavenMetadataReader;
+import org.apache.archiva.metadata.maven.MavenMetadataReader;
 import org.apache.archiva.maven2.model.TreeEntry;
 import org.apache.archiva.metadata.repository.storage.RepositoryPathTranslator;
 import org.apache.archiva.model.ArchivaRepositoryMetadata;
index 322415687f0fbc23df1ff32dfc5960e3bb92b5aa..c4ac9b602fee9b2a05c5003889d532de5f03f0b1 100644 (file)
@@ -24,7 +24,7 @@ import org.apache.archiva.common.utils.VersionUtil;
 import org.apache.archiva.configuration.ArchivaConfiguration;
 import org.apache.archiva.configuration.Configuration;
 import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
-import org.apache.archiva.maven2.metadata.MavenMetadataReader;
+import org.apache.archiva.metadata.maven.MavenMetadataReader;
 import org.apache.archiva.metadata.model.ArtifactMetadata;
 import org.apache.archiva.metadata.repository.MetadataRepository;
 import org.apache.archiva.metadata.repository.MetadataRepositoryException;
index d09b6f36dec9e2fd8ebbcc7e642094beeccdae47..eeb2000427b4ca7c93b7d49bb2f8026600a978b4 100644 (file)
@@ -20,7 +20,7 @@ package org.apache.archiva.repository.maven.metadata.storage;
 
 import org.apache.archiva.common.utils.VersionUtil;
 import org.apache.archiva.metadata.model.ArtifactMetadata;
-import org.apache.archiva.metadata.model.maven2.MavenArtifactFacet;
+import org.apache.archiva.metadata.maven.model.MavenArtifactFacet;
 import org.apache.archiva.metadata.repository.storage.RepositoryPathTranslator;
 import org.apache.archiva.repository.storage.StorageAsset;
 import org.apache.commons.lang3.StringUtils;
index 00e8e0740acb9c08d0521a7b71990cdf3e21787f..0e60a1b11611c71c9eb91ab1686d6db2ade5f06f 100644 (file)
@@ -23,7 +23,7 @@ import org.apache.archiva.checksum.ChecksummedFile;
 import org.apache.archiva.common.Try;
 import org.apache.archiva.common.utils.VersionUtil;
 import org.apache.archiva.filter.Filter;
-import org.apache.archiva.maven2.metadata.MavenMetadataReader;
+import org.apache.archiva.metadata.maven.MavenMetadataReader;
 import org.apache.archiva.metadata.model.ArtifactMetadata;
 import org.apache.archiva.metadata.model.ProjectMetadata;
 import org.apache.archiva.metadata.model.ProjectVersionMetadata;
index fc731611784a4814ce2dfc061688cbb1cf7261e4..4a21a0ec42abb062158b1d4e74ad587b4c4dbe4a 100644 (file)
@@ -18,9 +18,8 @@ package org.apache.archiva.repository.maven.metadata.storage;
  * under the License.
  */
 
-import org.apache.archiva.metadata.model.MetadataFacetFactory;
 import org.apache.archiva.metadata.model.facets.AbstractMetadataFacetFactory;
-import org.apache.archiva.metadata.model.maven2.MavenArtifactFacet;
+import org.apache.archiva.metadata.maven.model.MavenArtifactFacet;
 import org.springframework.stereotype.Service;
 
 /**
index a8647ac0f54bfc4aefff499cfb1065828dacb076..c8f0ebef19914afe65f830b9bddf4179fd1fbc38 100644 (file)
@@ -19,7 +19,7 @@ package org.apache.archiva.repository.maven.metadata.storage;
  */
 
 import org.apache.archiva.common.utils.VersionUtil;
-import org.apache.archiva.maven2.metadata.MavenMetadataReader;
+import org.apache.archiva.metadata.maven.MavenMetadataReader;
 import org.apache.archiva.metadata.repository.storage.RepositoryPathTranslator;
 import org.apache.archiva.model.ArchivaRepositoryMetadata;
 import org.apache.archiva.model.SnapshotVersion;
index 631fb1e5c725fc514a4768dd5c32f1d034dbf6dd..ba62afc1dd5959aed0c424cfc9c8d73a46caf25b 100644 (file)
@@ -19,7 +19,7 @@ package org.apache.archiva.repository.maven.content;
  */
 
 import org.apache.archiva.metadata.model.ArtifactMetadata;
-import org.apache.archiva.metadata.model.maven2.MavenArtifactFacet;
+import org.apache.archiva.metadata.maven.model.MavenArtifactFacet;
 import org.apache.archiva.metadata.repository.storage.RepositoryPathTranslator;
 import org.apache.archiva.repository.maven.metadata.storage.ArtifactMappingProvider;
 import org.apache.archiva.repository.maven.metadata.storage.Maven2RepositoryPathTranslator;
index 6db54b81a6d92edcfc5b1c5463967b7324592749..5466bac31169859b6f38a3ce306c64d9e461e6eb 100644 (file)
@@ -19,7 +19,7 @@ package org.apache.archiva.repository.maven.content;
  */
 
 import org.apache.archiva.common.filelock.DefaultFileLockManager;
-import org.apache.archiva.maven2.metadata.MavenMetadataReader;
+import org.apache.archiva.metadata.maven.MavenMetadataReader;
 import org.apache.archiva.repository.content.ItemSelector;
 import org.apache.archiva.repository.content.base.ArchivaItemSelector;
 import org.apache.archiva.repository.storage.StorageAsset;
index b2642bac271209cec58fab47d65dfbf15217242e..3d04c907eac8efed891fefc755243e2ad5c8b34c 100644 (file)
@@ -19,7 +19,7 @@ package org.apache.archiva.repository.maven.metadata;
  */
 
 import junit.framework.TestCase;
-import org.apache.archiva.maven2.metadata.MavenMetadataReader;
+import org.apache.archiva.metadata.maven.MavenMetadataReader;
 import org.apache.archiva.model.ArchivaRepositoryMetadata;
 import org.apache.archiva.repository.metadata.RepositoryMetadataException;
 import org.apache.archiva.test.utils.ArchivaBlockJUnit4ClassRunner;
index 29b882a5f093f57dbe759c678e2baa74fdb3b3e6..f8e28c2b0c3079bf788b243f58b1c0ef0dd9951c 100644 (file)
@@ -30,7 +30,7 @@ import org.apache.archiva.metadata.model.Dependency;
 import org.apache.archiva.metadata.model.License;
 import org.apache.archiva.metadata.model.MailingList;
 import org.apache.archiva.metadata.model.ProjectVersionMetadata;
-import org.apache.archiva.metadata.model.maven2.MavenArtifactFacet;
+import org.apache.archiva.metadata.maven.model.MavenArtifactFacet;
 import org.apache.archiva.filter.AllFilter;
 import org.apache.archiva.filter.ExcludesFilter;
 import org.apache.archiva.filter.Filter;
index 993d957e6c02b66cb0b18685a7013aa283deb9cb..07ee62ea5d30aebed6a005dd829d3d87ecd8a6c0 100644 (file)
@@ -19,7 +19,7 @@ package org.apache.archiva.repository.maven.metadata.storage;
  */
 
 import junit.framework.TestCase;
-import org.apache.archiva.maven2.metadata.MavenMetadataReader;
+import org.apache.archiva.metadata.maven.MavenMetadataReader;
 import org.apache.archiva.model.ArchivaRepositoryMetadata;
 import org.apache.archiva.model.Plugin;
 import org.apache.archiva.repository.metadata.RepositoryMetadataException;
index 5c72d42aea77ca31225a0bfc4de39c1d916b7042..23b8d6fb6501607bccbe5d4c4b5ea3acbd213891 100644 (file)
@@ -28,7 +28,7 @@ import org.apache.archiva.common.utils.VersionUtil;
 import org.apache.archiva.maven2.model.Artifact;
 import org.apache.archiva.metadata.model.ArtifactMetadata;
 import org.apache.archiva.metadata.model.facets.AuditEvent;
-import org.apache.archiva.metadata.model.maven2.MavenArtifactFacet;
+import org.apache.archiva.metadata.maven.model.MavenArtifactFacet;
 import org.apache.archiva.metadata.repository.*;
 import org.apache.archiva.model.ArchivaRepositoryMetadata;
 import org.apache.archiva.model.ArtifactReference;
index 76d3292a869648dc165535d6fbb3196ade5c4e33..3a9c75051cf77d9fe4776a445f0d97d9d82e395a 100644 (file)
@@ -20,7 +20,7 @@ package org.apache.archiva.rest.services.utils;
 
 import org.apache.archiva.maven2.model.Artifact;
 import org.apache.archiva.metadata.model.ArtifactMetadata;
-import org.apache.archiva.metadata.model.maven2.MavenArtifactFacet;
+import org.apache.archiva.metadata.maven.model.MavenArtifactFacet;
 import org.apache.archiva.model.ArtifactReference;
 import org.apache.archiva.repository.ManagedRepositoryContent;
 import org.apache.archiva.repository.storage.StorageAsset;
index 3b3fe4ed27ce31b3b072502905974a9030eaaa25..881d0d8f0745f0036ee288f2a040cfccbe199cc0 100644 (file)
@@ -30,7 +30,6 @@ import org.apache.archiva.checksum.ChecksummedFile;
 import org.apache.archiva.common.utils.VersionComparator;
 import org.apache.archiva.common.utils.VersionUtil;
 import org.apache.archiva.configuration.ArchivaConfiguration;
-import org.apache.archiva.maven2.metadata.MavenMetadataReader;
 import org.apache.archiva.metadata.model.facets.AuditEvent;
 import org.apache.archiva.model.ArchivaRepositoryMetadata;
 import org.apache.archiva.model.ArtifactReference;
@@ -52,7 +51,6 @@ import org.apache.archiva.rest.services.AbstractRestService;
 import org.apache.archiva.scheduler.ArchivaTaskScheduler;
 import org.apache.archiva.scheduler.repository.model.RepositoryTask;
 import org.apache.archiva.web.model.FileMetadata;
-import org.apache.archiva.xml.XMLException;
 import org.apache.commons.io.FilenameUtils;
 import org.apache.commons.io.IOUtils;
 import org.apache.commons.lang3.BooleanUtils;
index ed44abf4708cee099097bf989588e6883e0fb80c..a3d0b677247f2ed298aeebbbd0f042749f2fe502 100644 (file)
@@ -26,7 +26,7 @@ import org.apache.archiva.common.utils.FileUtils;
 import org.apache.archiva.configuration.Configuration;
 import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
 import org.apache.archiva.configuration.RepositoryGroupConfiguration;
-import org.apache.archiva.maven2.metadata.MavenMetadataReader;
+import org.apache.archiva.metadata.maven.MavenMetadataReader;
 import org.apache.archiva.model.ArchivaRepositoryMetadata;
 import org.apache.commons.lang3.StringUtils;
 import org.junit.After;
index 4f06928c06d09cf0474e403a55ecc6d88ba49684..788afb8959adae990258b0cf35f98ea9d9309221 100644 (file)
@@ -20,7 +20,7 @@ package org.apache.archiva.metadata.repository.stats.model;
  */
 
 import org.apache.archiva.metadata.model.ArtifactMetadata;
-import org.apache.archiva.metadata.model.maven2.MavenArtifactFacet;
+import org.apache.archiva.metadata.maven.model.MavenArtifactFacet;
 import org.apache.archiva.metadata.repository.MetadataRepository;
 import org.apache.archiva.metadata.repository.MetadataRepositoryException;
 import org.apache.archiva.metadata.repository.MetadataResolutionException;
index 2e09bbf37f0d13776e9252c2aca2ab8db5bf885c..fb171f3b07e5f89e2a9567b05dd5499fb8efd8b7 100644 (file)
@@ -23,12 +23,11 @@ import com.google.common.collect.ImmutableMap;
 import org.apache.archiva.checksum.ChecksumAlgorithm;
 import org.apache.archiva.metadata.QueryParameter;
 import org.apache.archiva.metadata.model.*;
-import org.apache.archiva.metadata.model.maven2.MavenArtifactFacet;
+import org.apache.archiva.metadata.maven.model.MavenArtifactFacet;
 import org.apache.archiva.metadata.repository.*;
 import org.apache.archiva.metadata.repository.stats.model.RepositoryStatistics;
 import org.apache.archiva.metadata.repository.stats.model.RepositoryStatisticsProvider;
 import org.apache.commons.lang3.StringUtils;
-import org.apache.jackrabbit.JcrConstants;
 import org.apache.jackrabbit.commons.JcrUtils;
 import org.apache.jackrabbit.commons.cnd.CndImporter;
 import org.apache.jackrabbit.commons.cnd.ParseException;
index 8d7f92e1b17b0de13cf4b5eb59d3d906b5e599df..ac3f1ebdae1f8b3f20fd80e40a445efa6a70315f 100644 (file)
@@ -21,7 +21,7 @@ package org.apache.archiva.metadata.repository.stats;
 
 import junit.framework.TestCase;
 import org.apache.archiva.metadata.model.ArtifactMetadata;
-import org.apache.archiva.metadata.model.maven2.MavenArtifactFacet;
+import org.apache.archiva.metadata.maven.model.MavenArtifactFacet;
 import org.apache.archiva.metadata.repository.MetadataRepository;
 import org.apache.archiva.metadata.repository.RepositorySession;
 import org.apache.archiva.metadata.repository.RepositorySessionFactory;