PR: MPARTIFACT-56

When deploying a snapshot, jar and pom have different timestamped version

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@350091 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
ltheussl 2005-12-01 01:04:13 +00:00
parent 101c548127
commit 3997bdfcfe
2 changed files with 15 additions and 5 deletions

View File

@ -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 )

View File

@ -25,6 +25,7 @@
</properties>
<body>
<release version="1.7-SNAPSHOT" date="in SVN">
<action dev="ltheussl" type="fix" issue="MPARTIFACT-56">When deploying a snapshot, jar and pom have different timestamped version.</action>
<action dev="ltheussl" type="add" issue="MPARTIFACT-59">Make deploying a timestamped SNAPSHOT artifact configurable.</action>
<action dev="aheritier" type="update" issue="MAVEN-1712">Update dependencies to match ones in maven 1.1 core and to unify them between plugins. The following dependencies are updated :
<ul>