Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[m2e-dev] m2e and Java 9 support

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:

http://download.eclipse.org/technology/m2e/snapshots/1.8.2/java9

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. 


[1] https://waynebeaton.wordpress.com/2017/09/22/java-9-support-for-eclipse-ide-oxygen-edition/
[2] https://github.com/fbricon/m2e-core/tree/BETA-JAVA9-1.8.x

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

Back to the top