[ 
http://jira.codehaus.org/browse/MJAVADOC-115?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_89918
 ] 

Mark Proctor commented on MJAVADOC-115:
---------------------------------------

Please replace the existing method with these two new methods:

    /**
     * Method to get the path of the doclet artifacts used in the -docletpath 
option.
     *
     * Either docletArtifact or doclectArtifacts can be defined and used, not 
both, docletArtifact 
     * takes precedence over doclectArtifacts. docletPath is always appended to 
any result path 
     * definition.
     * 
     * @return the path to jar file that contains doclet class file separated 
with a colon (:)
     * on Solaris and a semi-colon (;) on Windows
     * @throws MavenReportException
     */
    private String getDocletPath()
        throws MavenReportException
    {
        StringBuffer path = new StringBuffer();
        
        if ( !isDocletArtifactEmpty( docletArtifact ) ) 
        {
            path.append( getArtifactAbsolutePath( docletArtifact ) );
        }
        else if ( docletArtifacts != null )
        {
            for ( int i = 0; i < docletArtifacts.length; i++ )
            {
                if ( !isDocletArtifactEmpty( docletArtifacts[i] ) )
                {
                    path.append( getArtifactAbsolutePath( docletArtifacts[i] ) 
);

                    if ( i < docletArtifacts.length - 1 )
                    {
                        path.append( File.pathSeparator );
                    }
                }
            }
        }
        
        if ( !StringUtils.isEmpty( docletPath ) )
        {
            path.append( docletPath );
        }        
        
        if ( StringUtils.isEmpty( path.toString() ) )
        {
            getLog().warn( "No docletpath option was found. Please review 
<docletpath/> or <docletArtifact/>"
                               + " or <doclets/>." );
        }

        return path.toString();
    }
    
    private boolean isDocletArtifactEmpty(DocletArtifact docletArtifact) {
        if ( docletArtifact == null ) {
            return true;
        }
        return (  StringUtils.isEmpty( docletArtifact.getGroupId() )
                && StringUtils.isEmpty( docletArtifact.getArtifactId() ) 
                && StringUtils.isEmpty( docletArtifact.getVersion() ) ) ;       
    }


> getDocletPath does not return correct path
> ------------------------------------------
>
>                 Key: MJAVADOC-115
>                 URL: http://jira.codehaus.org/browse/MJAVADOC-115
>             Project: Maven 2.x Javadoc Plugin
>          Issue Type: Bug
>    Affects Versions: 2.0
>            Reporter: Mark Proctor
>
> docletArtifacts is now never null, so really need an undefined check on each 
> array entry. Further to that docletPath should always be appened, as its 
> additional path info, at the moment its one or the other.

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

        

Reply via email to