Maven works fine when I run my pom having <additionalparam>-Xdoclint:none</additionalparam>
with JAVA 8, since -Xdoclint
was added in JAVA 8. However, it throws an error when I run maven with JAVA 7 since it is not there in JAVA 7.
But I want to make the pom generalized for JAVA 7 and JAVA 8, i.e. if JAVA 8 I should be able to use the specified "additionalparam" but when using JAVA 7, it should exclude that parameter.
Found 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 - https://stackoverflow.com/a/26806103
Instead of using the
<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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With