mirror of https://github.com/apache/maven.git
[MNG-4500] [regression] Maven checks for updates of timestamped snapshots
git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@892597 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
3d94938663
commit
c0448b2def
|
@ -197,11 +197,9 @@ public class DefaultArtifactResolver
|
|||
|
||||
transformationManager.transformForResolve( artifact, request );
|
||||
|
||||
boolean localCopy = isLocalCopy( artifact );
|
||||
|
||||
destination = artifact.getFile();
|
||||
|
||||
if ( ( force || !destination.exists() || ( artifact.isSnapshot() && !localCopy ) ) && !request.isOffline() )
|
||||
if ( !request.isOffline() && ( force || !destination.exists() || isMutable( artifact ) ) )
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -258,7 +256,7 @@ public class DefaultArtifactResolver
|
|||
// 1) pom = 1.0-SNAPSHOT
|
||||
// 2) pom = 1.0-yyyymmdd.hhmmss
|
||||
// 3) baseVersion = 1.0-SNAPSHOT
|
||||
if ( artifact.isSnapshot() && !artifact.getBaseVersion().equals( artifact.getVersion() ) )
|
||||
if ( artifact.isSnapshot() && isTimestamped( artifact ) )
|
||||
{
|
||||
String version = artifact.getVersion();
|
||||
|
||||
|
@ -295,7 +293,17 @@ public class DefaultArtifactResolver
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private boolean isMutable( Artifact artifact )
|
||||
{
|
||||
return artifact.isSnapshot() && !isTimestamped( artifact ) && !isLocalCopy( artifact );
|
||||
}
|
||||
|
||||
private boolean isTimestamped( Artifact artifact )
|
||||
{
|
||||
return !artifact.getBaseVersion().equals( artifact.getVersion() );
|
||||
}
|
||||
|
||||
private boolean isLocalCopy( Artifact artifact )
|
||||
{
|
||||
boolean localCopy = false;
|
||||
|
|
Loading…
Reference in New Issue