bsideup / jabel

Jabel - unlock Javac 9+ syntax when targeting Java 8
Apache License 2.0
803 stars 47 forks source link

modules are not supported in -source 8 #29

Open Treehopper opened 4 years ago

Treehopper commented 4 years ago

JPMS is causing trouble. I excluded module-info.java files via the Maven compiler plugin. Maybe there is a better solution.

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>

                    <excludes>
                        <exclude>**/module-info.java</exclude>
                    </excludes>
                </configuration>
            </plugin>
Glavo commented 2 years ago

Now I implemented a compiler that compiles module-info.java specifically to do this: Glavo/module-info-compiler

It just compiles module-info.java according to module-info.java's syntax, doesn't call javac, and doesn't do any actual checking of the module, so it can be done without configuring the module path, so it can easily be used in Java 8 projects.