Details
Description
We recently had an issue where the local repo could not be created due to permissions issues. Unfortunately the default output of mvn -X is not helpful in debugging this issue.
In org.apache.maven.wagon.AbstractWagon:
protected void createParentDirectories( File destination )
throws TransferFailedException
{
File destinationDirectory = destination.getParentFile();
if ( destinationDirectory != null && !destinationDirectory.exists() )
{
if ( !destinationDirectory.mkdirs() )
}
}
if TransferFailedException("Specified destination directory cannot be created: " + destinationDirectory ); is thrown it eventually bubbles up to org.apache.maven.artifact.manager.DefaultWagonManager and is caught in the second catch block from this snippet of public void getArtifact( Artifact artifact, List remoteRepositories ):
try
{ getArtifact( artifact, repository ); successful = artifact.isResolved(); }catch ( ResourceDoesNotExistException e )
{ // This one we will eat when looking through remote repositories // because we want to cycle through them all before squawking. getLogger().debug( "Unable to get resource '" + artifact.getId() + "' from repository " + repository.getId() + " (" + repository.getUrl() + ")" ); }catch ( TransferFailedException e )
{ getLogger().debug( "Unable to get resource '" + artifact.getId() + "' from repository " + repository.getId() + " (" + repository.getUrl() + ")" ); }Can we also include the exception in the debug log message? e.g. make this call:
getLogger().debug( "Unable to get resource '" + artifact.getId() + "' from repository " +
repository.getId() + " (" + repository.getUrl() + ")" , e);