diff --git a/maven-artifact-manager/src/main/java/org/apache/maven/artifact/repository/metadata/ArtifactRepositoryMetadata.java b/maven-artifact-manager/src/main/java/org/apache/maven/artifact/repository/metadata/ArtifactRepositoryMetadata.java index 9b6f12516f..94df2571cf 100644 --- a/maven-artifact-manager/src/main/java/org/apache/maven/artifact/repository/metadata/ArtifactRepositoryMetadata.java +++ b/maven-artifact-manager/src/main/java/org/apache/maven/artifact/repository/metadata/ArtifactRepositoryMetadata.java @@ -24,7 +24,6 @@ import org.apache.maven.artifact.repository.ArtifactRepository; * * @author Brett Porter * @version $Id$ - * @todo split instantiation (versioning, plugin mappings) from definition */ public class ArtifactRepositoryMetadata extends AbstractRepositoryMetadata diff --git a/maven-artifact-manager/src/main/java/org/apache/maven/artifact/transform/AbstractVersionTransformation.java b/maven-artifact-manager/src/main/java/org/apache/maven/artifact/transform/AbstractVersionTransformation.java index 22ac98a688..d8db444608 100644 --- a/maven-artifact-manager/src/main/java/org/apache/maven/artifact/transform/AbstractVersionTransformation.java +++ b/maven-artifact-manager/src/main/java/org/apache/maven/artifact/transform/AbstractVersionTransformation.java @@ -61,7 +61,6 @@ public abstract class AbstractVersionTransformation protected String resolveVersion( Artifact artifact, ArtifactRepository localRepository, List remoteRepositories ) throws ArtifactMetadataRetrievalException { - // TODO: can we improve on this? RepositoryMetadata metadata; if ( !artifact.isSnapshot() || Artifact.LATEST_VERSION.equals( artifact.getBaseVersion() ) ) { diff --git a/maven-artifact-manager/src/main/java/org/apache/maven/artifact/transform/SnapshotTransformation.java b/maven-artifact-manager/src/main/java/org/apache/maven/artifact/transform/SnapshotTransformation.java index cf816f76a7..ac40147367 100644 --- a/maven-artifact-manager/src/main/java/org/apache/maven/artifact/transform/SnapshotTransformation.java +++ b/maven-artifact-manager/src/main/java/org/apache/maven/artifact/transform/SnapshotTransformation.java @@ -17,7 +17,6 @@ package org.apache.maven.artifact.transform; */ import org.apache.maven.artifact.Artifact; -import org.apache.maven.artifact.metadata.ArtifactMetadata; import org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException; import org.apache.maven.artifact.metadata.LegacyArtifactMetadata; import org.apache.maven.artifact.metadata.SnapshotArtifactMetadata; @@ -75,16 +74,14 @@ public class SnapshotTransformation { int buildNumber = resolveLatestSnapshotBuildNumber( artifact, localRepository, remoteRepository ); - // TODO: Better way to create this - should have to construct Versioning Snapshot snapshot = new Snapshot(); snapshot.setTimestamp( getDeploymentTimestamp() ); snapshot.setBuildNumber( buildNumber + 1 ); - ArtifactMetadata metadata = new SnapshotArtifactRepositoryMetadata( artifact, snapshot ); + RepositoryMetadata metadata = new SnapshotArtifactRepositoryMetadata( artifact, snapshot ); - Versioning versioning = new Versioning(); - versioning.setSnapshot( snapshot ); - artifact.setResolvedVersion( constructVersion( versioning, artifact.getBaseVersion() ) ); + artifact.setResolvedVersion( + constructVersion( metadata.getMetadata().getVersioning(), artifact.getBaseVersion() ) ); artifact.addMetadata( metadata ); } @@ -127,7 +124,6 @@ public class SnapshotTransformation ArtifactRepository remoteRepository ) throws ArtifactMetadataRetrievalException { - // TODO: can we improve on this? RepositoryMetadata metadata = new SnapshotArtifactRepositoryMetadata( artifact ); getLogger().info( "Retrieving previous build number from " + remoteRepository.getId() ); diff --git a/maven-plugins/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/metadata/AddPluginArtifactMetadataMojo.java b/maven-plugins/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/metadata/AddPluginArtifactMetadataMojo.java index 5531f58e03..a29065cb79 100644 --- a/maven-plugins/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/metadata/AddPluginArtifactMetadataMojo.java +++ b/maven-plugins/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/metadata/AddPluginArtifactMetadataMojo.java @@ -40,7 +40,6 @@ public class AddPluginArtifactMetadataMojo { Artifact projectArtifact = project.getArtifact(); - // TODO: clean up Versioning versioning = new Versioning(); versioning.setLatest( projectArtifact.getVersion() ); ArtifactRepositoryMetadata metadata = new ArtifactRepositoryMetadata( projectArtifact, versioning );