You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Simon (Jira)" <ji...@apache.org> on 2020/06/18 15:39:00 UTC
[jira] [Commented] (MNG-6943) Activate profile depending of jdk
version used in toolchain
[ https://issues.apache.org/jira/browse/MNG-6943?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17139509#comment-17139509 ]
Simon commented on MNG-6943:
----------------------------
My current workaround : https://github.com/eclipse/leshan/pull/855
> Activate profile depending of jdk version used in toolchain
> -----------------------------------------------------------
>
> Key: MNG-6943
> URL: https://issues.apache.org/jira/browse/MNG-6943
> Project: Maven
> Issue Type: Improvement
> Reporter: Simon
> Priority: Major
>
> I have one profile to configure {{maven-javadoc-plugin}} which is only activate for jdk 1.8 or greater. (doclint exist since java 1.8)
> And another profile to use toolchain with jdk 1.7.
> {code:xml}
> <profile>
> <id>configure-doclint</id>
> <activation>
> <jdk>[1.8,)</jdk>
> </activation>
> <build>
> <plugins>
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-javadoc-plugin</artifactId>
> <configuration>
> <doclint>all,-missing</doclint>
> </configuration>
> </plugin>
> </plugins>
> </build>
> </profile>
> <profile>
> <id>useToolchain</id>
> <build>
> <plugins>
> <plugin>
> <artifactId>maven-toolchains-plugin</artifactId>
> <executions>
> <execution>
> <goals>
> <goal>toolchain</goal>
> </goals>
> </execution>
> </executions>
> <configuration>
> <toolchains>
> <jdk>
> <version>1.7</version>
> </jdk>
> </toolchains>
> </configuration>
> </plugin>
> </plugins>
> </build>
> </profile>
> {code}
> The issue is that if I run "{{mvn install javadoc:javadoc -PuseToolchain" with java 8 or greater, t}}his will failed with a "{{Exit code: 1 - javadoc: error - invalid flag: -Xdoclint:none"}}
> I guess this is because *jdk version* which run maven is used instead of *toolchain jdk version* to decide to activate or not "configure-doclint" profile.
> Maybe it could make sense to add a new profile activation field <toolchain-jdk>.
> If no toolchain is used the current running version of maven should be used and so in this case behave like <jdk>
> WDYT ?
--
This message was sent by Atlassian Jira
(v8.3.4#803005)