diff --git a/maven-artifact-manager/src/main/java/org/apache/maven/artifact/metadata/LatestArtifactMetadata.java b/maven-artifact-manager/src/main/java/org/apache/maven/artifact/metadata/LatestArtifactMetadata.java index 8321bb13be..22f0634a7b 100644 --- a/maven-artifact-manager/src/main/java/org/apache/maven/artifact/metadata/LatestArtifactMetadata.java +++ b/maven-artifact-manager/src/main/java/org/apache/maven/artifact/metadata/LatestArtifactMetadata.java @@ -96,11 +96,6 @@ public class LatestArtifactMetadata this.version = content.trim(); } - public void setVersion( String version ) - { - this.version = version; - } - public String getBaseVersion() { return Artifact.LATEST_VERSION; @@ -110,10 +105,4 @@ public class LatestArtifactMetadata { return false; } - - public boolean isSnapshot() - { - return false; - } - } diff --git a/maven-artifact-manager/src/main/java/org/apache/maven/artifact/metadata/LegacyArtifactMetadata.java b/maven-artifact-manager/src/main/java/org/apache/maven/artifact/metadata/LegacyArtifactMetadata.java index 440d1c86d7..059f435d96 100644 --- a/maven-artifact-manager/src/main/java/org/apache/maven/artifact/metadata/LegacyArtifactMetadata.java +++ b/maven-artifact-manager/src/main/java/org/apache/maven/artifact/metadata/LegacyArtifactMetadata.java @@ -1,13 +1,5 @@ package org.apache.maven.artifact.metadata; -import org.apache.maven.artifact.manager.WagonManager; -import org.apache.maven.artifact.repository.ArtifactRepository; -import org.apache.maven.wagon.ResourceDoesNotExistException; - -import java.io.File; -import java.io.IOException; -import java.util.Date; - /* * Copyright 2001-2005 The Apache Software Foundation. * @@ -24,6 +16,14 @@ import java.util.Date; * limitations under the License. */ +import org.apache.maven.artifact.manager.WagonManager; +import org.apache.maven.artifact.repository.ArtifactRepository; +import org.apache.maven.wagon.ResourceDoesNotExistException; + +import java.io.File; +import java.io.IOException; +import java.util.Date; + /** * Methods used by the old artifact metadata. To be removed in beta-2. * diff --git a/maven-artifact-manager/src/main/java/org/apache/maven/artifact/metadata/ReleaseArtifactMetadata.java b/maven-artifact-manager/src/main/java/org/apache/maven/artifact/metadata/ReleaseArtifactMetadata.java index 749e0aeccd..20467c4738 100644 --- a/maven-artifact-manager/src/main/java/org/apache/maven/artifact/metadata/ReleaseArtifactMetadata.java +++ b/maven-artifact-manager/src/main/java/org/apache/maven/artifact/metadata/ReleaseArtifactMetadata.java @@ -103,11 +103,6 @@ public class ReleaseArtifactMetadata this.version = content.trim(); } - public void setVersion( String version ) - { - this.version = version; - } - public String getBaseVersion() { return ReleaseArtifactTransformation.RELEASE_VERSION; @@ -117,10 +112,4 @@ public class ReleaseArtifactMetadata { return false; } - - public boolean isSnapshot() - { - return false; - } - } diff --git a/maven-artifact-manager/src/main/java/org/apache/maven/artifact/metadata/SnapshotArtifactMetadata.java b/maven-artifact-manager/src/main/java/org/apache/maven/artifact/metadata/SnapshotArtifactMetadata.java index ef6fb0330a..151e1a36e6 100644 --- a/maven-artifact-manager/src/main/java/org/apache/maven/artifact/metadata/SnapshotArtifactMetadata.java +++ b/maven-artifact-manager/src/main/java/org/apache/maven/artifact/metadata/SnapshotArtifactMetadata.java @@ -165,18 +165,8 @@ public class SnapshotArtifactMetadata return true; } - public boolean isSnapshot() - { - return true; - } - public String getBaseVersion() { return artifact.getBaseVersion(); } - - public void setRepository( ArtifactRepository remoteRepository ) - { - artifact.setRepository( remoteRepository ); - } } diff --git a/maven-artifact-manager/src/main/java/org/apache/maven/artifact/repository/metadata/RepositoryMetadata.java b/maven-artifact-manager/src/main/java/org/apache/maven/artifact/repository/metadata/RepositoryMetadata.java index 8a84c21805..580f807255 100644 --- a/maven-artifact-manager/src/main/java/org/apache/maven/artifact/repository/metadata/RepositoryMetadata.java +++ b/maven-artifact-manager/src/main/java/org/apache/maven/artifact/repository/metadata/RepositoryMetadata.java @@ -49,4 +49,11 @@ public interface RepositoryMetadata * @param metadata the metadata */ void setMetadata( Metadata metadata ); + + /** + * Whether this represents a snapshot. + * + * @return if it is a snapshot + */ + boolean isSnapshot(); } diff --git a/maven-artifact/src/main/java/org/apache/maven/artifact/metadata/AbstractArtifactMetadata.java b/maven-artifact/src/main/java/org/apache/maven/artifact/metadata/AbstractArtifactMetadata.java index eae953b802..cefc52dcae 100644 --- a/maven-artifact/src/main/java/org/apache/maven/artifact/metadata/AbstractArtifactMetadata.java +++ b/maven-artifact/src/main/java/org/apache/maven/artifact/metadata/AbstractArtifactMetadata.java @@ -48,9 +48,4 @@ public abstract class AbstractArtifactMetadata { return artifact.getArtifactId(); } - - public String getVersion() - { - return artifact.getVersion(); - } } diff --git a/maven-artifact/src/main/java/org/apache/maven/artifact/metadata/ArtifactMetadata.java b/maven-artifact/src/main/java/org/apache/maven/artifact/metadata/ArtifactMetadata.java index d801aca5c3..2b5d488875 100644 --- a/maven-artifact/src/main/java/org/apache/maven/artifact/metadata/ArtifactMetadata.java +++ b/maven-artifact/src/main/java/org/apache/maven/artifact/metadata/ArtifactMetadata.java @@ -46,8 +46,6 @@ public interface ArtifactMetadata Object getKey(); - boolean isSnapshot(); - /** * Get the filename of this metadata on the local repository. * diff --git a/maven-project/src/main/java/org/apache/maven/project/artifact/ProjectArtifactMetadata.java b/maven-project/src/main/java/org/apache/maven/project/artifact/ProjectArtifactMetadata.java index 6d83f7e3ed..0c6c6f2c39 100644 --- a/maven-project/src/main/java/org/apache/maven/project/artifact/ProjectArtifactMetadata.java +++ b/maven-project/src/main/java/org/apache/maven/project/artifact/ProjectArtifactMetadata.java @@ -34,7 +34,6 @@ import java.io.FileNotFoundException; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; -import java.util.Date; /** * Attach a POM to an artifact. @@ -132,21 +131,6 @@ public class ProjectArtifactMetadata return artifact.getBaseVersion(); } - public boolean newerThanFile( File file ) - { - return this.file.lastModified() > file.lastModified(); - } - - public Date getLastModified() - { - return new Date( file.lastModified() ); - } - - public boolean isSnapshot() - { - return artifact.isSnapshot(); - } - public Object getKey() { return "project " + artifact.getGroupId() + ":" + artifact.getArtifactId();