m2e and Java 9 support

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

m2e and Java 9 support

Fred Bricon
Hi,

FYI I published a snapshot build of initial m2e support for Java 9, working with the Java 9 support for Eclipse bits[1], available from this p2 repo:


It was built from this fork[2].

In a nutshell: 
- depends on new Oxygen 1.a JDT (internal) API for Java 9, but should work with current/previous Eclipse versions.
- JavaSE-9 is set according to source/target or release setting in maven-compiler-setting
- Run As > Maven Build is fixed (apparently)
- Dependencies are added to the module path, as per the `requires` statements in module-info.java, same behaviour as maven-compiler-plugin. Which leads us to a chicken/egg problem:

In module-info.java, when autocompleting on modules, only the dependencies with the module flag are found. But we need to know which modules to flag by reading the module-info.java in the 1st place. Which makes a really bad UX, when the workflow becomes:
- add dependency to pom.xml
- add required module to module-info.java. Crap, no autocompletion!
- guess a module name anyway, save file
- update Maven project configuration
- module name now available for autocompletion in module-info.java. Too late!

So, the alternatives are:
1 - put all maven dependencies on the module path. So easy but yuck!
2 - make jdt search for candidate modules both in the modulepath and classpath, regardless of the module flag, when autocompleting. Then add a resource listener on module-info,java to update the module flag on Maven dependencies, when a new required module is added. No need for Maven project configuration update.
3 - Other?

WDYT?

There certainly are use cases that will break with, so please give 1.8.2 a try. 



--
"Have you tried turning it off and on again" - The IT Crowd
And if that fails, then http://goo.gl/tnBgH5

_______________________________________________
jdt-core-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jdt-core-dev