How to work around the stricter Java 8 Javadoc when using Maven -


you'll realize jdk8 lot more strict (by default) when comes javadoc. (link - see last bullet point)

if never generate javadoc of course you'll not experience problems things maven release process , possibly ci builds fail worked fine jdk7. checks exit value of javadoc tool fail. jdk8 javadoc more verbose in terms of warnings compared jdk7 that's not scope here. talking errors!

this question exist collect proposals on it. best approach ? should these errors fixed once , in source code files? if have huge code base might lot of work. other options exist ?

you welcome comment stories of fails pass.

horror stories of fails

wsimport tools

wsimport tool code generator creating web service consumers. included in jdk. if use wsimport tool jdk8 nevertheless produce source code that cannot compiled javadoc compiler jdk8.

@author tag

i'm opening source code files 3-4 years old , see this:

/**  * best class  * @author john <john.doe@mine.com>   */ 

this fails because of < character. strictly speaking justified, not forgiving.

html tables

html tables in javadoc? consider valid html:

/**  *  * <table>  *   <tr>  *      <td>col1</td><td>col2</td><td>col3</td>  *   </tr>  * </table>  */ 

this fails error message no summary or caption table. 1 quick fix this:

/**  *  * <table summary="">  *   <tr>  *      <td>col1</td><td>col2</td><td>col3</td>  *   </tr>  * </table>  */ 

but why has stop-the-world error javadoc tool beats me??

things fail more obvious reasons

  1. invalid links, e.g. {@link notexist}
  2. malformed html, e.g. always returns <code>true<code> if ...

update

links:

excellent blog on subject stephen colebourne.

for now, easiest way know work around stricter java 8 javadoc when using maven deactivating it.

since parameter -xdoclint:none exists in java 8, defining parameter breaks build other java. prevent this, can create profile active java 8, making sure our solution works regardless of java version.

<profiles>     <profile>         <id>disable-java8-doclint</id>         <activation>             <jdk>[1.8,)</jdk>         </activation>         <properties>             <additionalparam>-xdoclint:none</additionalparam>         </properties>     </profile> </profiles> 

just add pom , you're go.


Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -