fix error reporting

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@163986 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2005-04-20 16:52:32 +00:00
parent efebad61dc
commit 4b0f51b9a1
1 changed files with 20 additions and 23 deletions

View File

@ -139,22 +139,11 @@ public class SnapshotTransformation
resolvedArtifactCache.add( getCacheKey( artifact ) ); resolvedArtifactCache.add( getCacheKey( artifact ) );
} }
// 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 ( !alreadyResolved )
{
// Locally installed file is newer, don't use the resolved version
getLogger().info( artifact.getArtifactId() + ": using locally installed snapshot" );
}
}
else
{
String version = localMetadata.constructVersion(); String version = localMetadata.constructVersion();
if ( getLogger().isInfoEnabled() ) if ( getLogger().isInfoEnabled() && !alreadyResolved )
{ {
if ( !version.equals( artifact.getBaseVersion() ) && !alreadyResolved ) if ( !version.equals( artifact.getBaseVersion() ) )
{ {
String message = artifact.getArtifactId() + ": resolved to version " + version; String message = artifact.getArtifactId() + ": resolved to version " + version;
if ( artifact.getRepository() != null ) if ( artifact.getRepository() != null )
@ -167,8 +156,16 @@ public class SnapshotTransformation
} }
getLogger().info( message ); 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 ); artifact.setVersion( version );
try try
{ {