diff --git a/README.md b/README.md index cab96bff..c10e5b77 100644 --- a/README.md +++ b/README.md @@ -64,22 +64,24 @@ And the following `plugin` tag to your `pom.xml`. Where: -| Property | Mandatory | Default value | Description | -| ----------------------- | --------- | ------------------------------ | ------------------------------------------------------------ | -| `mainClass` | Yes | `null` | Full path to your app main class. | -| `bundleJre` | No | `false` | Embed a customized JRE with the app. | -| `forceJreOptimization` | No | `false` | Although JDK version < 13, it will try to reduce the bundled JRE. | -| `jrePath` | No | `""` | Path to JRE folder. If specified, it will bundle this JRE with the app, and won't generate a customized JRE. For Java 8 version or least. | -| `administratorRequired` | No | `false` | If true, app will run with administrator privileges. | -| `additionalResources` | No | [] | Additional files and folders to include in the bundled app. | -| `generateInstaller` | No | `true` | Generate an installer for the app. | -| `displayName` | No | `${project.name}` | App name to show. | -| `iconFile` | No | `null` | Path to the app icon file (PNG, ICO or ICNS). | -| `licenseFile` | No | `${project.licenses[0].url}` | Path to project license file. | -| `url` | No | `null` | App website URL. | -| `organizationName` | No | `${project.organization.name}` | Organization name. | -| `organizationUrl` | No | `${project.organization.url}` | Organization website URL. | -| `organizationEmail` | No | `null` | Organization email. | +| Property | Mandatory | Default value | Description | +| --------------------------------- | --------- | ------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `mainClass` | Yes | `null` | Full path to your app main class. | +| `bundleJre` | No | `false` | Embed a customized JRE with the app. | +| `forceJreOptimization` | No | `false` | Although JDK version < 13, it will try to reduce the bundled JRE. | +| `jrePath` | No | `""` | Path to JRE folder. If specified, it will bundle this JRE with the app, and won't generate a customized JRE. For Java 8 version or least. | +| `moduleDependenceAnalysisOption` | No | `"--list-deps"` | When generating a customized JRE, this option allows to specify a different Module dependence analysis option other than the default (--list-deps) for jdeps | +| `additionalModules` | No | `""` | When generating a customized JRE, allows adding aditional modules other than the ones identified by jdeps before calling jlink. | +| `administratorRequired` | No | `false` | If true, app will run with administrator privileges. | +| `additionalResources` | No | [] | Additional files and folders to include in the bundled app. | +| `generateInstaller` | No | `true` | Generate an installer for the app. | +| `displayName` | No | `${project.name}` | App name to show. | +| `iconFile` | No | `null` | Path to the app icon file (PNG, ICO or ICNS). | +| `licenseFile` | No | `${project.licenses[0].url}` | Path to project license file. | +| `url` | No | `null` | App website URL. | +| `organizationName` | No | `${project.organization.name}` | Organization name. | +| `organizationUrl` | No | `${project.organization.url}` | Organization website URL. | +| `organizationEmail` | No | `null` | Organization email. | Some assets, such as application icons, could be located in `assets` folder organized by platform, and so it would not be necessary to specify the `iconFile` property: diff --git a/pom.xml b/pom.xml index 4ada825a..a0c3dc8a 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ fvarrui.maven javapackager - 0.8.4 + 0.8.5-SNAPSHOT maven-plugin JavaPackager Maven Plugin diff --git a/src/main/java/fvarrui/maven/plugin/javapackager/PackageMojo.java b/src/main/java/fvarrui/maven/plugin/javapackager/PackageMojo.java index d42d8be4..bcfd711b 100644 --- a/src/main/java/fvarrui/maven/plugin/javapackager/PackageMojo.java +++ b/src/main/java/fvarrui/maven/plugin/javapackager/PackageMojo.java @@ -125,6 +125,12 @@ public class PackageMojo extends AbstractMojo { @Parameter(property = "additionalResources", required = false) private List additionalResources; + @Parameter(defaultValue = "--list-deps", property = "moduleDependenceAnalysisOption", required = false) + private String moduleDependenceAnalysisOption; + + @Parameter(defaultValue = "", property = "additionalModules", required = false) + private String additionalModules; + public PackageMojo() { super(); Logger.init(getLog()); @@ -674,9 +680,9 @@ private String getRequiredModules(File libsFolder) throws MojoExecutionException jdeps.getAbsolutePath(), "-q", additionalArguments, - "--list-deps", + moduleDependenceAnalysisOption, "--multi-release", JavaUtils.getJavaMajorVersion(), - new File(libsFolder, "*"), + new File(libsFolder, "*.jar"), jarFile ); @@ -686,6 +692,9 @@ private String getRequiredModules(File libsFolder) throws MojoExecutionException .map(module -> module.trim()) .filter(module -> !module.startsWith("JDK removed internal")) .collect(Collectors.toList()); + if (!StringUtils.isEmpty(additionalModules)) { + modulesList.addAll(Arrays.asList(additionalModules.split(",")).stream().map(module->module.trim()).collect(Collectors.toList())); + } return StringUtils.join(modulesList, ","); }