[MNG-6943] Activate profile depending of jdk version used in toolchain
- Dominant language
- Java
- Stars
- 5.3k
- Forks
- 3.1k
- Avg merge
- 20h 40m
- Merged PRs (30d)
- 275
Description
**[Simon](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=sbernard)** opened **[MNG-6943](https://issues.apache.org/jira/browse/MNG-6943?redirect=false)** and commented
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.
```xml
configure-doclint
[1.8,)
org.apache.maven.plugins
maven-javadoc-plugin
all,-missing
useToolchain
maven-toolchains-plugin
toolchain
1.7
```
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 \.
If no toolchain is used the current running version of maven should be used and so in this case behave like \
WDYT ?
---
**Issue Links:**
- [MPOM-264](https://issues.apache.org/jira/browse/MPOM-264) Parameterize maven-compiler-plugin with parameter "release" when running on JDK 9+
Contributor guide
Assessment
This issue has not been assessed yet.