use maven.compiler.release instead of .target#165
Conversation
|
Will redo this on maven-core first. |
|
this means all plugins will be 17 required. |
slawekjaranowski
left a comment
There was a problem hiding this comment.
We can not bump JDK in parent ... it will have an impact for all plugins ... but plugins should stay at JDK 8
plugins parent can have but anyway this need more residents as I guess some plugins will now maven4 API directly so there will be branches... |
|
can we split this PR to 2 - one to replace parameters to use .target - with the latest m-compiler-p it no longer requires special profile. That is only technical cleanup. |
|
and can we avoid MNG issue for a change that is related to Maven parent POM? |
Sure, both works for me. Will update soon. |
457ab8e to
a82b8eb
Compare
What exactly are you thinking of? // Edit: got it :) |
a82b8eb to
8939751
Compare
maven.compiler.release instead of .target
Bukama
left a comment
There was a problem hiding this comment.
Thanks for updating this dormant PR :)
+1 (nb)
| <javaVersion>8</javaVersion> | ||
| <maven.compiler.source>${javaVersion}</maven.compiler.source> | ||
| <maven.compiler.target>${javaVersion}</maven.compiler.target> | ||
| <maven.compiler.release>${javaVersion}</maven.compiler.release> |
There was a problem hiding this comment.
Should we left old properties and allow to m-compiler-p to use proper one?
What java version will be used by m-compiler-p when we have only maven.compiler.release and build on JDK 8?
There was a problem hiding this comment.
Since version 3.13.0 of the Compiler Plugin together with the default javac compilerId you don't need conditional parametrisation of release. The release parameter will only be effective for Java 9 or above, otherwise the source and target will be passed to the compiler.
There was a problem hiding this comment.
yes, leave original .source and .target properties.
There was a problem hiding this comment.
Done for main properties, not sure whether we need them in other places, too
There was a problem hiding this comment.
in ale place should be the same
|
Do we want/need an issue? Merge now or later? |
|
I think that we need preserve also source and target - it will be used for jdk8 |
8939751 to
7b7f534
Compare
| <invoker.maven.compiler.source>${maven.compiler.source}</invoker.maven.compiler.source> | ||
| <invoker.maven.compiler.target>${maven.compiler.target}</invoker.maven.compiler.target> |
There was a problem hiding this comment.
please also preserver here
| <maven.compiler.source>${invoker.maven.compiler.source}</maven.compiler.source> | ||
| <maven.compiler.target>${invoker.maven.compiler.target}</maven.compiler.target> |
There was a problem hiding this comment.
please also preserver here
| <invoker.maven.compiler.source>${maven.compiler.source}</invoker.maven.compiler.source> | ||
| <invoker.maven.compiler.target>${maven.compiler.target}</invoker.maven.compiler.target> |
There was a problem hiding this comment.
please also preserver here
| <maven.compiler.source>${invoker.maven.compiler.source}</maven.compiler.source> | ||
| <maven.compiler.target>${invoker.maven.compiler.target}</maven.compiler.target> |
There was a problem hiding this comment.
please also preserver here
| <javaVersion>8</javaVersion> | ||
| <maven.compiler.source>${javaVersion}</maven.compiler.source> | ||
| <maven.compiler.target>${javaVersion}</maven.compiler.target> | ||
| <maven.compiler.release>${javaVersion}</maven.compiler.release> |
There was a problem hiding this comment.
in ale place should be the same
|
This pull request is stale because it has been waiting for feedback for 60 days. Remove the stale label or comment on this PR, or it will be automatically closed in 30 days. |
Actually, if using version 4 of |
But it can still apply |
Yes, but this is not useful since the plugin requires Java 17 for execution anyway. Therefore, user should specify If we keep default values for source and target, then in the current version of compiler plugin 4, the configuration needs to look like that: <source/> <!-- Erase the source configuration inherited from the parent pom -->
<target/>
<release>8</release> |
|
I guess I was not clear what I mean. As of kno (3.x) you can specifiy release8 and the compiler plugin turns that into source/target if you are on JDK 8, which does not know release. But with Maven 4 and JDK 17 this is only a thing if you use another JDK via toolchains or something, right? so I'm okay to remove sourge/target parameters in the 4x plugin |
|
Maven-parent is used for other Maven projects that we maintain, where the base is java 8. If we remove it now - we need to adjust around 100 repos. Please think also about backward compatibility for us but also for users (m-compiler-p) as they usually expect that the project should build smoothly with Maven 3 and 4 should be also without issues |
Change the properties as mentioned by Sylvester, so we have #224 for the actual Java 17 change