Skip to content

Commit 02c2d7f

Browse files
petebankheadxzel23
authored andcommitted
Make jmods directory optional to cope with JEP 493
1 parent e94f795 commit 02c2d7f

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

src/main/groovy/org/beryx/runtime/impl/JreTaskImpl.groovy

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,17 @@ abstract class JreTaskImpl extends BaseTaskImpl<JreTaskData> {
4949
void createJre(File jreDir, String jdkHome, List<String> options) {
5050
project.delete(jreDir)
5151

52-
if(!project.file("$jdkHome/jmods").directory) {
53-
throw new GradleException("Directory not found: $jdkHome/jmods")
54-
}
5552
def cmd = ["$td.javaHome/bin/jlink",
5653
'-v',
5754
*options,
58-
'--module-path',
59-
"$jdkHome/jmods/",
6055
'--add-modules', modules.join(','),
6156
'--output', jreDir]
57+
58+
if (project.file("$jdkHome/jmods").directory) {
59+
cmd += ['--module-path',
60+
"$jdkHome/jmods/"]
61+
}
62+
6263
LOGGER.info("Executing: $cmd")
6364
def result = exec {
6465
ignoreExitValue = true

0 commit comments

Comments
 (0)