[ 
https://jira.codehaus.org/browse/MJAVADOC-347?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Robert Scholte updated MJAVADOC-347:
------------------------------------

    Testcase included: yes

> javadoc:aggregate-jar doesn't create Javadoc JAR if failOnError=false and 
> there is an error
> -------------------------------------------------------------------------------------------
>
>                 Key: MJAVADOC-347
>                 URL: https://jira.codehaus.org/browse/MJAVADOC-347
>             Project: Maven Javadoc Plugin
>          Issue Type: Bug
>    Affects Versions: 2.8.1
>            Reporter: Luis Miranda
>         Attachments: 
> 0001-MJAVADOC-347-added-JavadocJarTest.testContinueIfFail.patch, 
> 0002-MJAVADOC-347-continue-with-archive-creation-if-failO.patch
>
>
> We are generating Javadocs for a large multi-module build, so there are bound 
> to be some errors (for example, in 3rd party dependencies).
> Currently we set failOnError=false, but we found that the {{aggregate-jar}} 
> MOJO does not produce a JAR if there are errors. The problem comes down to 
> this code in JavadocJar:
> {code}
>         try
>         {
>             executeReport( Locale.getDefault() );
>             if ( innerDestDir.exists() )
>             {
>                 File outputFile = generateArchive( innerDestDir, finalName + 
> "-" + getClassifier() + ".jar" );
>                 if ( !attach )
>                 {
>                     getLog().info( "NOT adding javadoc to attached artifacts 
> list." );
>                 }
>                 else
>                 {
>                     // TODO: these introduced dependencies on the project are 
> going to become problematic - can we expor
>                     //  through metadata instead?
>                     projectHelper.attachArtifact( project, "javadoc", 
> getClassifier(), outputFile );
>                 }
>             }
>         }
>         catch ( ArchiverException e )
>         {
>             failOnError( "ArchiverException: Error while creating archive", e 
> );
>         }
>         catch ( IOException e )
>         {
>             failOnError( "IOException: Error while creating archive", e );
>         }
>         catch ( MavenReportException e )
>         {
>             failOnError( "MavenReportException: Error while creating 
> archive", e );
>         }
>         catch ( RuntimeException e )
>         {
>             failOnError( "RuntimeException: Error while creating archive", e 
> );
>         }
> {code}
> If there is an error in {{executeReport( Locale.getDefault() )}} then the 
> MOJO will just give up and not try to create the archive. I think that if 
> failOnError is set, then we should try to create the archive anyway.



--
This message was sent by Atlassian JIRA
(v6.1.6#6162)

Reply via email to