o Improved logging

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@806639 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2009-08-21 16:53:53 +00:00
parent 1b57686445
commit 4f49a5c76e
3 changed files with 32 additions and 13 deletions

View File

@ -87,7 +87,8 @@ public class DefaultWagonManager
if ( !policy.isEnabled() )
{
logger.debug( "Skipping disabled repository " + repository.getId() );
logger.debug( "Skipping disabled repository " + repository.getId() + " for resolution of "
+ artifact.getId() );
}
// If the artifact is a snapshot, we need to determine whether it's time to check this repository for an update:
@ -95,7 +96,7 @@ public class DefaultWagonManager
// 2. If the updateInterval has been exceeded since the last check for this artifact on this repository, then check.
else if ( artifact.isSnapshot() && updateCheckIsRequired )
{
logger.debug( "Trying repository " + repository.getId() );
logger.debug( "Trying repository " + repository.getId() + " for resolution of " + artifact.getId() );
try
{
@ -106,7 +107,7 @@ public class DefaultWagonManager
updateCheckManager.touch( artifact, repository );
}
logger.debug( " Artifact resolved" );
logger.debug( " Artifact " + artifact.getId() + " resolved" );
artifact.setResolved( true );
}
@ -120,7 +121,7 @@ public class DefaultWagonManager
// if POM is not present locally, try and get it if it's forced, out of date, or has not been attempted yet
if ( updateCheckManager.isPomUpdateRequired( artifact, repository ) )
{
logger.debug( "Trying repository " + repository.getId() );
logger.debug( "Trying repository " + repository.getId() + " for resolution of " + artifact.getId() );
try
{
@ -134,7 +135,7 @@ public class DefaultWagonManager
throw e;
}
logger.debug( " Artifact resolved" );
logger.debug( " Artifact " + artifact.getId() + " resolved" );
artifact.setResolved( true );
}
@ -154,11 +155,11 @@ public class DefaultWagonManager
// don't write touch-file for release artifacts.
else if ( !artifact.isSnapshot() )
{
logger.debug( "Trying repository " + repository.getId() );
logger.debug( "Trying repository " + repository.getId() + " for resolution of " + artifact.getId() );
getRemoteFile( repository, artifact.getFile(), remotePath, downloadMonitor, policy.getChecksumPolicy(), false );
logger.debug( " Artifact resolved" );
logger.debug( " Artifact " + artifact.getId() + " resolved" );
artifact.setResolved( true );
}
@ -183,7 +184,7 @@ public class DefaultWagonManager
// This one we will eat when looking through remote repositories
// because we want to cycle through them all before squawking.
logger.debug( "Unable to get resource '" + artifact.getId() + "' from repository " + repository.getId() + " (" + repository.getUrl() + ")", e );
logger.debug( "Unable to find resource '" + artifact.getId() + "' in repository " + repository.getId() + " (" + repository.getUrl() + ")", e );
}
catch ( TransferFailedException e )
{
@ -385,7 +386,7 @@ public class DefaultWagonManager
}
catch ( ResourceDoesNotExistException sha1TryException )
{
logger.debug( "SHA1 not found, trying MD5", sha1TryException );
logger.debug( "SHA1 not found, trying MD5: " + sha1TryException.getMessage() );
// if this IS NOT a ChecksumFailedException, it was a problem with transfer/read of the checksum
// file...we'll try again with the MD5 checksum.

View File

@ -119,7 +119,7 @@ public class DefaultProjectBuilder
}
catch ( ModelBuildingException e )
{
throw new ProjectBuildingException( e.getModelId(), "Encountered POM errors", pomFile, e );
throw new ProjectBuildingException( e.getModelId(), e.getMessage(), pomFile, e );
}
modelProblems = result.getProblems();
@ -237,7 +237,8 @@ public class DefaultProjectBuilder
}
catch ( ArtifactResolutionException e )
{
throw new ProjectBuildingException( artifact.getId(), "Error resolving project artifact.", e );
throw new ProjectBuildingException( artifact.getId(),
"Error resolving project artifact: " + e.getMessage(), e );
}
return build( artifact.getFile(), false, configuration );

View File

@ -38,6 +38,7 @@ import org.apache.maven.artifact.repository.metadata.Metadata;
import org.apache.maven.artifact.repository.metadata.RepositoryMetadata;
import org.apache.maven.artifact.repository.metadata.RepositoryMetadataManager;
import org.apache.maven.artifact.repository.metadata.RepositoryMetadataResolutionException;
import org.apache.maven.artifact.resolver.ArtifactResolutionException;
import org.apache.maven.artifact.resolver.filter.AndArtifactFilter;
import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
import org.apache.maven.artifact.resolver.filter.ExcludesArtifactFilter;
@ -478,8 +479,24 @@ public class MavenMetadataSource
}
catch ( ProjectBuildingException e )
{
// bad/incompatible POM
logger.debug( "Invalid artifact metadata for " + artifact.getId() + ": " + e.getMessage() );
String message;
// missing/incompatible POM (e.g. a Maven 1 POM)
if ( e.getCause() instanceof ArtifactResolutionException )
{
message = "Missing artifact metadata for " + artifact.getId();
}
else
{
message = "Invalid artifact metadata for " + artifact.getId();
}
if ( logger.isDebugEnabled() )
{
message += ": " + e.getMessage();
}
logger.warn( message );
}
if ( project != null )