snapshot.setTimestamp( utcDateFormatter.format( new Date() ) );
snapshot.setTimestamp( matcher.group( 2 ) ); try
snapshot.setTimestamp( interpolatedTrimmed( parser.nextText(), "timestamp" ) );
: !s.getTimestamp().equals( snapshot.getTimestamp() ) ) s.setTimestamp( snapshot.getTimestamp() ); changed = true;
public void transformForDeployment( Artifact artifact, ArtifactRepository remoteRepository, ArtifactRepository localRepository ) throws ArtifactDeploymentException { if ( artifact.isSnapshot() ) { Snapshot snapshot = new Snapshot(); snapshot.setTimestamp( getDeploymentTimestamp() ); // we update the build number anyway so that it doesn't get lost. It requires the timestamp to take effect try { int buildNumber = resolveLatestSnapshotBuildNumber( artifact, localRepository, remoteRepository ); snapshot.setBuildNumber( buildNumber + 1 ); } catch ( RepositoryMetadataResolutionException e ) { throw new ArtifactDeploymentException( "Error retrieving previous build number for artifact '" + artifact.getDependencyConflictId() + "': " + e.getMessage(), e ); } RepositoryMetadata metadata = new SnapshotArtifactRepositoryMetadata( artifact, snapshot ); artifact.setResolvedVersion( constructVersion( metadata.getMetadata().getVersioning(), artifact.getBaseVersion() ) ); artifact.addMetadata( metadata ); } }
/** * update snapshot timestamp to now * * @param target */ public static void updateTimestamp( Snapshot target ) { target.setTimestamp( TimeUtil.getUTCTimestamp() ); }
public static Snapshot createSnapshot( String version ) { Snapshot sn = new Snapshot(); if ( version == null || version.length() < 3 ) { return sn; } String utc = TimeUtil.getUTCTimestamp(); sn.setTimestamp( utc ); if ( version.endsWith( "-SNAPSHOT" ) ) { return sn; } int pos = version.lastIndexOf( '-' ); if ( pos == -1 ) { throw new IllegalArgumentException(); } String sbn = version.substring( pos + 1 ); int bn = Integer.parseInt( sbn ); sn.setBuildNumber( bn ); String sts = version.substring( 0, pos ); pos = sts.lastIndexOf( '-' ); if ( pos == -1 ) { throw new IllegalArgumentException(); } sn.setTimestamp( sts.substring( pos + 1 ) ); return sn; }
private Snapshot buildSnapshot( Gav gav ) { Snapshot result = new Snapshot(); final String version = gav.getVersion(); if ( version.equals( gav.getBaseVersion() ) ) { return null; } int lastHyphenPos = version.lastIndexOf( '-' ); int buildNumber = Integer.parseInt( version.substring( lastHyphenPos + 1 ) ); String timestamp = version.substring( gav.getBaseVersion().length() - 8, lastHyphenPos ); result.setLocalCopy( false ); result.setBuildNumber( buildNumber ); result.setTimestamp( timestamp ); return result; }
snapshot.setTimestamp( utcDateFormatter.format( new Date() ) );
snapshot.setTimestamp( utcDateFormatter.format( new Date() ) );
snapshot.setTimestamp( utcDateFormatter.format( new Date() ) );
snapshot.setTimestamp( matcher.group( 2 ) ); versioning.setSnapshot( snapshot );
snapshot.setTimestamp( matcher.group( 2 ) ); versioning.setSnapshot( snapshot );
snapshot.setTimestamp( matcher.group( 2 ) ); versioning.setSnapshot( snapshot );
snapshot.setTimestamp( matcher.group( 2 ) ); versioning.setSnapshot( snapshot );
snapshot.setTimestamp( getTrimmedValue( parser.nextText() ) );
: !s.getTimestamp().equals( snapshot.getTimestamp() ) ) s.setTimestamp( snapshot.getTimestamp() ); changed = true;
final Versioning versioning = result.getVersioning() != null ? result.getVersioning() : new Versioning(); final org.apache.maven.artifact.repository.metadata.Snapshot snapshot = new org.apache.maven.artifact.repository.metadata.Snapshot(); snapshot.setTimestamp(Constants.METADATA_DOTTED_TIMESTAMP.print( new DateTime(maven2Metadata.getSnapshots().getSnapshotTimestamp()))); snapshot.setBuildNumber(maven2Metadata.getSnapshots().getSnapshotBuildNumber());
: !s.getTimestamp().equals( snapshot.getTimestamp() ) ) s.setTimestamp( snapshot.getTimestamp() ); changed = true;