GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||
GeezerVison is showing github.com — [3.9.x] MavenPluginJavaPrerequisiteChecker: Handle 8/1.8 Java version in ranges as well by cstamas · Pull Request #11577 · apache/maven Conversation
| |||||||||||||||||||||
| } | ||
| VersionConstraint constraint; | ||
| try { | ||
| constraint = versionScheme.parseVersionConstraint(requiredVersion.equals("8") ? "1.8" : requiredVersion); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
two lines above you substring currentVersion here it's about requiredVersion. Is it intended or are you accidently mixing variables?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| @@ -30,7 +30,22 @@ public class MavenPluginJavaPrerequisiteCheckerTest { | |||
| public void testMatchesVersion() { | |||
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Use Parameterized tests here
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Did the change as you asked, but now fails with checkstyle:
Error: src/test/java/org/apache/maven/plugin/internal/MavenPluginJavaPrerequisiteCheckerTest.java:[67,19] (design) VisibilityModifier: Variable 'requiredVersion' must be private and have accessor methods.
Error: src/test/java/org/apache/maven/plugin/internal/MavenPluginJavaPrerequisiteCheckerTest.java:[70,19] (design) VisibilityModifier: Variable 'currentVersion' must be private and have accessor methods.
Error: src/test/java/org/apache/maven/plugin/internal/MavenPluginJavaPrerequisiteCheckerTest.java:[73,20] (design) VisibilityModifier: Variable 'expected' must be private and have accessor methods.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Clearly the two are not aligned: as if I make field private or just non-public, I get
Cannot set parameter 'requiredVersion'. Ensure that the field 'requiredVersion' is public.
So one want this, other want that.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
do it simple, you can try to add suppress for checkstyle, by the way I'm working on move test to JUnit 5 in #11547
Sorry, something went wrong.
There was an error while loading. Please reload this page.
This reverts commit 8c00268.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I would like to change a PR title to be more descriptive what is fixed 😄
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
What about Maven 4? Shouldn't the versions be interpreted the same? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Maven4 is Java 17+, hence it does not need to handle 8/1.8 (both are less than 17). Maven 3 can run on Java 8 and higher, and the problem is really ONLY when it runs on Java 8 (as it reports 1.8 as version), but users are inconsistent, and may use "8" or "1.8", depending on their mood. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Java prerequisites for Maven Plugins fails for Java 8
There was an error while loading. Please reload this page.