RFR: JDK-8261518: jpackage looks for main module in current dir when there is no module-path [v2]

Alexey Semenyuk asemenyuk at openjdk.java.net
Wed Mar 3 00:42:41 UTC 2021


On Tue, 2 Mar 2021 19:47:04 GMT, Andy Herrick <herrick at openjdk.org> wrote:

>> when the app modules have already been jlinked with the runtime, and there is no need for module-path, jpackage was acting as if the module-path was "." and picking up jars in the current directory.
>
> Andy Herrick has updated the pull request incrementally with one additional commit since the last revision:
> 
>   JDK-8261518: jpackage looks for main module in current dir when there is no module-path

Changes requested by asemenyuk (Committer).

test/jdk/tools/jpackage/share/jdk/jpackage/tests/NoMPathRuntimeTest.java line 137:

> 135:     public static Collection data() {
> 136:         final List<String> javaAppDescs = List.of("Hello",
> 137:                 "com.foo/com.foo.main.Aloha");

Why do you need "Hello" non-modular app?

test/jdk/tools/jpackage/share/jdk/jpackage/tests/NoMPathRuntimeTest.java line 125:

> 123:                 .addArguments("-cvf", "junk.jar",
> 124:                         "-C", tmpdir.toString(), "Hello.class")
> 125:                 .execute();

Single line `HelloApp.createBundle("junk.jar:Hello", tmpdir);` would compile source class and put it into "junk.jar" in `tmpdir` folder. It can be used to replace lines from [109, 125] range.

test/jdk/tools/jpackage/share/jdk/jpackage/tests/NoMPathRuntimeTest.java line 66:

> 64:         final Path tmpdir = TKit.createTempDirectory("tmpdir");
> 65:         try {
> 66:             Files.createFile(tmpdir.resolve("tmpfile"));

Is this leftover from something or on purpose?

-------------

PR: https://git.openjdk.java.net/jdk/pull/2781


More information about the core-libs-dev mailing list