fix error reporting

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@164797 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2005-04-26 14:34:47 +00:00
parent 687d9de104
commit 350d51ce5c
1 changed files with 25 additions and 22 deletions

View File

@ -141,6 +141,9 @@ public class SnapshotTransformation
String version = localMetadata.constructVersion();
// TODO: if the POM and JAR are inconsistent, this might mean that different version of each are used
if ( !artifact.getFile().exists() || localMetadata.newerThanFile( artifact.getFile() ) )
{
if ( getLogger().isInfoEnabled() && !alreadyResolved )
{
if ( !version.equals( artifact.getBaseVersion() ) )
@ -156,16 +159,8 @@ public class SnapshotTransformation
}
getLogger().info( message );
}
else
{
// Locally installed file is newer, don't use the resolved version
getLogger().info( artifact.getArtifactId() + ": using locally installed snapshot" );
}
}
// TODO: if the POM and JAR are inconsistent, this might mean that different version of each are used
if ( !artifact.getFile().exists() || localMetadata.newerThanFile( artifact.getFile() ) )
{
artifact.setVersion( version );
try
{
@ -176,6 +171,14 @@ public class SnapshotTransformation
throw new ArtifactMetadataRetrievalException( "Error reading local metadata", e );
}
}
else
{
if ( getLogger().isInfoEnabled() && !alreadyResolved )
{
// Locally installed file is newer, don't use the resolved version
getLogger().info( artifact.getArtifactId() + ": using locally installed snapshot" );
}
}
}
}