diff --git a/artifact/src/main/org/apache/maven/artifact/deployer/DefaultArtifactDeployer.java b/artifact/src/main/org/apache/maven/artifact/deployer/DefaultArtifactDeployer.java index d2afc97c..3ceb57fc 100644 --- a/artifact/src/main/org/apache/maven/artifact/deployer/DefaultArtifactDeployer.java +++ b/artifact/src/main/org/apache/maven/artifact/deployer/DefaultArtifactDeployer.java @@ -77,6 +77,8 @@ public class DefaultArtifactDeployer */ private final static String SNAPSHOT_FORMAT = "yyyyMMdd.HHmmss"; + private String snapshotSignature; + private static final Log LOG = LogFactory.getLog( DefaultArtifactDeployer.class ); /** @@ -118,6 +120,9 @@ public class DefaultArtifactDeployer } doDeploy( file, project, handler, version, type ); + + snapshotSignature = null; + } /** @@ -245,8 +250,8 @@ public class DefaultArtifactDeployer if ( version.indexOf( MavenConstants.SNAPSHOT_SIGNIFIER ) >= 0 ) { - String snapshotSignature = getSnapshotSignature(); - String v = StringUtils.replace( version, MavenConstants.SNAPSHOT_SIGNIFIER, snapshotSignature ); + String signature = getSnapshotSignature(); + String v = StringUtils.replace( version, MavenConstants.SNAPSHOT_SIGNIFIER, signature ); File snapshotVersionFile = createSnapshotVersionFile( file, v, project, type ); @@ -455,9 +460,13 @@ public class DefaultArtifactDeployer private String getSnapshotSignature() { - DateFormat fmt = new SimpleDateFormat( SNAPSHOT_FORMAT ); - fmt.setTimeZone( TimeZone.getTimeZone( "GMT" ) ); - return fmt.format( new Date() ); + if ( snapshotSignature == null ) + { + DateFormat fmt = new SimpleDateFormat( SNAPSHOT_FORMAT ); + fmt.setTimeZone( TimeZone.getTimeZone( "GMT" ) ); + snapshotSignature = fmt.format( new Date() ); + } + return snapshotSignature; } private File getFileForArtifact( String artifact ) diff --git a/artifact/xdocs/changes.xml b/artifact/xdocs/changes.xml index e812bdba..d11a1645 100644 --- a/artifact/xdocs/changes.xml +++ b/artifact/xdocs/changes.xml @@ -25,6 +25,7 @@ + When deploying a snapshot, jar and pom have different timestamped version. Make deploying a timestamped SNAPSHOT artifact configurable. Update dependencies to match ones in maven 1.1 core and to unify them between plugins. The following dependencies are updated :