You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "sumit shah (JIRA)" <ji...@codehaus.org> on 2009/01/07 23:20:19 UTC

[jira] Created: (MNG-3975) getArtifact(Artifact artifact, List remoteRepositories) should include Exception in debug log messages.

getArtifact(Artifact artifact, List remoteRepositories) should include Exception in debug log messages.
-------------------------------------------------------------------------------------------------------

                 Key: MNG-3975
                 URL: http://jira.codehaus.org/browse/MNG-3975
             Project: Maven 2
          Issue Type: Improvement
          Components: Logging
    Affects Versions: 2.0.9
         Environment: Any environment.
            Reporter: sumit shah
            Priority: Minor


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() )
            {
                throw new TransferFailedException(
                    "Specified destination directory cannot be created: " + destinationDirectory );
            }
        }
    }

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);



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Closed: (MNG-3975) getArtifact(Artifact artifact, List remoteRepositories) should include Exception in debug log messages.

Posted by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-3975?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Bentmann closed MNG-3975.
----------------------------------

         Assignee: Benjamin Bentmann
       Resolution: Fixed
    Fix Version/s: 2.1.0-M2
                   2.0.11

Fixed in [r734502|http://svn.eu.apache.org/viewvc?view=rev&revision=734502] and [r734503|http://svn.eu.apache.org/viewvc?view=rev&revision=734503], respectively.

I opted to only output the message of the inner exception instead of the entire stack trace. This should be sufficient to diagnose the problem ("Specified destination directory cannot be created: <path>") and doesn't cause excessive debug output which I doubt is useful for the normal user who is not going to jump into the sources.

> getArtifact(Artifact artifact, List remoteRepositories) should include Exception in debug log messages.
> -------------------------------------------------------------------------------------------------------
>
>                 Key: MNG-3975
>                 URL: http://jira.codehaus.org/browse/MNG-3975
>             Project: Maven 2
>          Issue Type: Improvement
>          Components: Logging
>    Affects Versions: 2.0.9
>         Environment: Any environment.
>            Reporter: sumit shah
>            Assignee: Benjamin Bentmann
>            Priority: Minor
>             Fix For: 2.0.11, 2.1.0-M2
>
>
> 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() )
>             {
>                 throw new TransferFailedException(
>                     "Specified destination directory cannot be created: " + destinationDirectory );
>             }
>         }
>     }
> 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);

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (MNG-3975) getArtifact(Artifact artifact, List remoteRepositories) should include Exception in debug log messages.

Posted by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-3975?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Bentmann updated MNG-3975:
-----------------------------------

    Fix Version/s:     (was: 2.0.11)
                   2.0.10

Also merged into 2.0.10 branch in [r737502|http://svn.eu.apache.org/viewvc?view=rev&revision=737502].

> getArtifact(Artifact artifact, List remoteRepositories) should include Exception in debug log messages.
> -------------------------------------------------------------------------------------------------------
>
>                 Key: MNG-3975
>                 URL: http://jira.codehaus.org/browse/MNG-3975
>             Project: Maven 2
>          Issue Type: Improvement
>          Components: Logging
>    Affects Versions: 2.0.9
>         Environment: Any environment.
>            Reporter: sumit shah
>            Assignee: Benjamin Bentmann
>            Priority: Minor
>             Fix For: 2.0.10, 2.1.0-M2
>
>
> 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() )
>             {
>                 throw new TransferFailedException(
>                     "Specified destination directory cannot be created: " + destinationDirectory );
>             }
>         }
>     }
> 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);

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira