Javadoc: error - invalid flag: -Xdoclint: none when I use java 7, but it works in java 8

Maven works fine when I run my pom with -Xdoclint: there is no this option with JAVA 8 since Xdoclint was added in JAVA 8 and an error occurs when starting maven with JAVA 7, since it is not in JAVA 7.

But I want the pom generator to be generalized for JAVA 7 and JAVA 8, that is, if JAVA 8 I have to use the specified "extra pair", but when using JAVA 7 it should exclude this parameter.

+5
source share
2 answers

Found a solution -

<profiles> <profile> <id>doclint-java8-disable</id> <activation> <jdk>[1.8,)</jdk> </activation> <properties> <javadoc.opts>-Xdoclint:none</javadoc.opts> </properties> </profile> </profiles> 

And then use $ {javadoc.opts}

Credit - fooobar.com/questions/27634 / ...

+5
source

Instead of using

 <properties> <javadoc.opts>-Xdoclint:none</javadoc.opts> </properties> 

I used:

  <profile> <id>doclint-java8-disable</id> <activation> <jdk>[1.8,)</jdk> </activation> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> <version>2.10.2</version> <configuration> <additionalparam>-Xdoclint:none</additionalparam> </configuration> </plugin> </plugins> </build> </profile> 
+1
source

Source: https://habr.com/ru/post/1210204/


All Articles