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

后端 未结 5 2148
感动是毒
感动是毒 2020-12-02 05:44

You\'ll quickly realize that JDK8 is a lot more strict (by default) when it comes to Javadoc. (link - see last bullet point)

If you never generate any Javadoc then o

5条回答
  •  有刺的猬
    2020-12-02 06:16

    For now, the easiest way I know to work around the stricter Java 8 Javadoc when using Maven is deactivating it.

    Since the parameter -Xdoclint:none only exists in Java 8, defining this parameter breaks the build for any other Java. To prevent this, we can create a profile that will be active only for Java 8, making sure our solution works regardless of the Java version.

    
        
            disable-java8-doclint
            
                [1.8,)
            
            
                -Xdoclint:none
            
        
    
    

    Just add that to your POM and you're good to go.


    For maven-javadoc-plugin 3.0.0 users:

    Replace

    -Xdoclint:none

    by

    none

    Thanks @banterCZ!

提交回复
热议问题