forax / pro

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

modulefixer misses required module `java.compiler` #31

Closed sormuras closed 7 years ago

sormuras commented 7 years ago

[modulefixer] fix junit.platform.console.standalone succeeds with current SNAPSHOT version. At runtime, it throws:

java.lang.IllegalAccessError:
class org.junit.platform.commons.util.PackageUtils
 (in module junit.platform.console.standalone) 
cannot access class javax.lang.model.SourceVersion
 (in module java.compiler)
because module junit.platform.console.standalone
does not read module java.compiler

Usage of javax.lang.model.SourceVersion should trigger: requires java.compiler;

Testable with:

set("tester.overrideArguments", list("--select-package", "abc"))
run("tester")
forax commented 7 years ago

Obviously there is a bug here, I wonder if it's because the SourceVersion is used inside a method reference (if my bytecode reading fu is correct)

You can workaround it by using modulefixer.additionalRequires set("modulefixer.additionalRequires", list( "junit.platform.console.standalone=java.compiler" ));

forax commented 7 years ago

fixed by b1dd0c6e58d485b5afcae0f9ec42039443431888