You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by lt...@apache.org on 2005/12/01 02:04:15 UTC
svn commit: r350091 - in /maven/maven-1/plugins/trunk/artifact:
src/main/org/apache/maven/artifact/deployer/DefaultArtifactDeployer.java
xdocs/changes.xml
Author: ltheussl
Date: Wed Nov 30 17:04:13 2005
New Revision: 350091
URL: http://svn.apache.org/viewcvs?rev=350091&view=rev
Log:
PR: MPARTIFACT-56
When deploying a snapshot, jar and pom have different timestamped version
Modified:
maven/maven-1/plugins/trunk/artifact/src/main/org/apache/maven/artifact/deployer/DefaultArtifactDeployer.java
maven/maven-1/plugins/trunk/artifact/xdocs/changes.xml
Modified: maven/maven-1/plugins/trunk/artifact/src/main/org/apache/maven/artifact/deployer/DefaultArtifactDeployer.java
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/artifact/src/main/org/apache/maven/artifact/deployer/DefaultArtifactDeployer.java?rev=350091&r1=350090&r2=350091&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/artifact/src/main/org/apache/maven/artifact/deployer/DefaultArtifactDeployer.java (original)
+++ maven/maven-1/plugins/trunk/artifact/src/main/org/apache/maven/artifact/deployer/DefaultArtifactDeployer.java Wed Nov 30 17:04:13 2005
@@ -77,6 +77,8 @@
*/
private final static String SNAPSHOT_FORMAT = "yyyyMMdd.HHmmss";
+ private String snapshotSignature;
+
private static final Log LOG = LogFactory.getLog( DefaultArtifactDeployer.class );
/**
@@ -118,6 +120,9 @@
}
doDeploy( file, project, handler, version, type );
+
+ snapshotSignature = null;
+
}
/**
@@ -245,8 +250,8 @@
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 @@
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 )
Modified: maven/maven-1/plugins/trunk/artifact/xdocs/changes.xml
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/artifact/xdocs/changes.xml?rev=350091&r1=350090&r2=350091&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/artifact/xdocs/changes.xml (original)
+++ maven/maven-1/plugins/trunk/artifact/xdocs/changes.xml Wed Nov 30 17:04:13 2005
@@ -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>