compile tests using maven-compiler and jdk9-ea+148

若如初见. 提交于 2019-12-05 17:59:04

The exception occurs when Maven tries to read the module-info.classs class name, which since a recent change was specified to be null. It looks like Maven uses ASM and according to Remi Forax ASM6 should already handle that case.

I suggest looking for an issue in the Maven issue tracker and open one if it can't be found.

Using the updated version of the maven-compiler-plugin:3.7.0 shall help you fix this:-

<plugins>
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.7.0</version>
        <configuration>
            <source>9</source>
            <target>9</target>
            <compilerArgument>-Xlint:all</compilerArgument>
        </configuration>
     </plugin>
</plugins>

I had the same problem with maven-compile-plugin:3.6.0 at jdk9-ea+149.

I noticed that the actual root cause for this was the test directory not having a module-info.java file (I had only added one to the src directory). As soon as I added a module-info file, the problem went away.

That said, I don't have a clue how the jigsaw directory/module structure should be laid out regarding unit tests - if tests are in a separate module, they can only access the public (exported) API.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!