How to work with resources in Java 9 modules

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-01 20:29:15

This appears to be a Gradle bug.

When I run Gradle with the -i option, I see that the actual command it’s executing to run your program includes this:

--patch-module resourceTest=/home/vgr/src/java_9_resource_test/build/classes/java/test

As you can see, it’s including the build/classes directory, but not the build/resources directory.

Since the build places the classes and resources in separate places, there is no way to use --patch-module. The classes and resources must be together, in one file tree or one .jar file.

Whether this is a flaw in the org.gradle.java.experimental-jigsaw plugin, or Gradle itself, I’m not sure.

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