[ 
https://issues.apache.org/jira/browse/MJAVADOC-347?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17957713#comment-17957713
 ] 

Olivier Lamy commented on MJAVADOC-347:
---------------------------------------

This project has moved from Jira to GitHub Issues. This issue was migrated to 
[apache/maven-javadoc-plugin#650|https://github.com/apache/maven-javadoc-plugin/issues/650].
 

> javadoc:aggregate-jar doesn't create Javadoc JAR if failOnError=false and 
> there is an error
> -------------------------------------------------------------------------------------------
>
>                 Key: MJAVADOC-347
>                 URL: https://issues.apache.org/jira/browse/MJAVADOC-347
>             Project: Maven Javadoc Plugin (Moved to GitHub Issues)
>          Issue Type: Bug
>    Affects Versions: 2.8.1
>            Reporter: Luis Miranda
>            Assignee: Karl Heinz Marbaise
>            Priority: Major
>             Fix For: 2.10.3
>
>         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
(v8.20.10#820010)

Reply via email to