-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
One way sync for jpms args from maven compiler args to .classpath file #216
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice contribution! I've only skimmed it from the browser, so mostly bikeshed complaints for now, I'll get into more details later.
There's probably a couple utility methods that already exist that could be used in your test. But I'll look into it.
@@ -173,6 +173,21 @@ public static IClasspathEntry getMavenContainerEntry(IJavaProject javaProject) { | |||
return null; | |||
} | |||
|
|||
public static IClasspathEntry getJREContainerEntry(IJavaProject javaProject) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move to MavenClasspathHelpers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok. What about getMavenContainerEntry, isn't it a bit similar ?
org.eclipse.m2e.jdt.tests/src/org/eclipse/m2e/jdt/tests/JpmsConfigurationTest.java
Outdated
Show resolved
Hide resolved
org.eclipse.m2e.jdt.tests/src/org/eclipse/m2e/jdt/tests/JpmsConfigurationTest.java
Outdated
Show resolved
Hide resolved
assertTrue(m2eAttributes.get(ADD_READS_ATTR).equals(M2E_ADD_READS_VALUE1)); | ||
assertTrue(m2eAttributes.get(PATCH_MODULE_ATTR).equals(M2E_PATCH_MODULE_VALUE1)); | ||
|
||
String argsSet2Content = contents.replace(REPLACED_POM_STRING, argsSet2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be better to cover compilerArgument works as intended on the second test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not handle compilerArgument anymore in the getCompilerAgument method. As the maven-compiler-plugin doc states, all the jpms arguments are in fact two arguments so no complete jpms argument can be provided using compilerArgument.
And i think it is not worth supporting the following cases:
<compilerArgument>--add-exports</compilerArgument>
<compilerArgs>
<arg>somemodule/somepackage=someothermodule</arg>
</compilerArgs>
<compilerArgs>
<arg>--add-exports</arg>
</compilerArgs>
<compilerArgument>somemodule/somepackage=someothermodule</compilerArgument>
Do you agree ?
org.eclipse.m2e.jdt.tests/projects/compilerJpmsSettings/argsSet2.xml
Outdated
Show resolved
Hide resolved
org.eclipse.m2e.jdt.tests/src/org/eclipse/m2e/jdt/tests/JpmsConfigurationTest.java
Outdated
Show resolved
Hide resolved
org.eclipse.m2e.jdt.tests/src/org/eclipse/m2e/jdt/tests/JpmsConfigurationTest.java
Outdated
Show resolved
Hide resolved
org.eclipse.m2e.jdt.tests/src/org/eclipse/m2e/jdt/tests/JpmsConfigurationTest.java
Outdated
Show resolved
Hide resolved
org.eclipse.m2e.jdt.tests/src/org/eclipse/m2e/jdt/tests/JpmsConfigurationTest.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once jpms flags are removed from pom.xml, they should be removed from the eclipse classpath as well
org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/ModuleSupport.java
Outdated
Show resolved
Hide resolved
org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/ModuleSupport.java
Outdated
Show resolved
Hide resolved
org.eclipse.m2e.jdt.tests/src/org/eclipse/m2e/jdt/tests/JpmsConfigurationTest.java
Show resolved
Hide resolved
Also: sources updated according review comments
Hi @fbricon, I've checked the continuous integration logs and i'm wondering how my code could be the cause of the failures.
The last build failure seems even more unrelated to my code :
Rgds, |
testDownloadSources_006_nonMavenProject has been failing for quite some time, it's unrelated. That test (or the regression it seems to indicate) needs to be fixed, but that's another battle. Eclipse's nexus instance might be unstable and cause the other issue. |
Hi @fbricon, |
Sorry for the late reply. I need to take a closer look. I'll do a deeper review next week. |
Hi @fbricon |
I am also very interested in this fix. Is there any hope of getting this PR accepted? |
I did test this change by merging in to latest master branch and doing a local build. I have been running it for one week now with my daily driver eclipse setup. I have not found any issues related to this change. So @treilhes can we resolve the conflicts and make it ready to merge and @fbricon can we merge this so that we can have this support in the next release for Eclipse 4.22 ? |
Hello @gayanper, @fbricon, are you still around? I hope the covid did not get you and you are well ..... Can someone give us some feedback ? |
Rebased and merged as f23d3f8 ; thanks! |
Hello @mickaelistria, |
I thought this was going to be fixed in 4.22, but the problem is still there. In fact, it not only impacts compiler JPMS args specified with the compiler plugin, it also impacts JPMS args specified in the surefire plugin. This bug severely impacts smooth migration from Java 8 to Java 9+. |
@leerho: can you please report a new issue with details to easily reproduce against latest m2e release please? |
Will do. I figured it was already reported. It will take me some time to prepare the "easily reproduce" part :) |
This commit :