forax / pro

A Java build tool that works seamlessly with modules
GNU General Public License v3.0
103 stars 15 forks source link

Enclosed type is not compiled #8

Closed sormuras closed 7 years ago

sormuras commented 7 years ago

The @Counter.Mark annotation as defined here https://github.com/sormuras/beethoven/blob/java9_and_pro/src/test/java/de.sormuras.beethoven/de/sormuras/beethoven/Counter.java#L41 is not compiled into a Counter$Mark.class in the target/test/exploded/<module-name> directory.

That's why some tests fail here: https://travis-ci.org/sormuras/beethoven/builds/216939339

Is the a pro-related issue or perhaps a jdk-9 bug / feature?

sormuras commented 7 years ago

I tend to call it a feature. Inner classes are no longer written to Enclosing$Inner.class files but are compiled into Enclosing.class itself. The classpath / modulepath scanning has to adopt, I guess.

sormuras commented 7 years ago

Solved the issue by tuning the command line from

java -jar jupiter-standalone.jar --classpath target\test\exploded\<module-name> --scan-classpath

to

java -classpath jupiter-standalone.jar;target\test\exploded\<module-name> org.junit.platform.console.ConsoleLauncher --scan-classpath

Some tests need the compiled test classes in the class path. When running the executable jar, they are not present.