Skip to content

Commit a996e22

Browse files
authored
Merge pull request #10 from mlopezFC/master
Fixes #7 and solves #8 and #9
2 parents 0e2800f + 70e4d2c commit a996e22

File tree

3 files changed

+30
-19
lines changed

3 files changed

+30
-19
lines changed

README.md

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -64,22 +64,24 @@ And the following `plugin` tag to your `pom.xml`.
6464

6565
Where:
6666

67-
| Property | Mandatory | Default value | Description |
68-
| ----------------------- | --------- | ------------------------------ | ------------------------------------------------------------ |
69-
| `mainClass` | Yes | `null` | Full path to your app main class. |
70-
| `bundleJre` | No | `false` | Embed a customized JRE with the app. |
71-
| `forceJreOptimization` | No | `false` | Although JDK version < 13, it will try to reduce the bundled JRE. |
72-
| `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. |
73-
| `administratorRequired` | No | `false` | If true, app will run with administrator privileges. |
74-
| `additionalResources` | No | [] | Additional files and folders to include in the bundled app. |
75-
| `generateInstaller` | No | `true` | Generate an installer for the app. |
76-
| `displayName` | No | `${project.name}` | App name to show. |
77-
| `iconFile` | No | `null` | Path to the app icon file (PNG, ICO or ICNS). |
78-
| `licenseFile` | No | `${project.licenses[0].url}` | Path to project license file. |
79-
| `url` | No | `null` | App website URL. |
80-
| `organizationName` | No | `${project.organization.name}` | Organization name. |
81-
| `organizationUrl` | No | `${project.organization.url}` | Organization website URL. |
82-
| `organizationEmail` | No | `null` | Organization email. |
67+
| Property | Mandatory | Default value | Description |
68+
| --------------------------------- | --------- | ------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
69+
| `mainClass` | Yes | `null` | Full path to your app main class. |
70+
| `bundleJre` | No | `false` | Embed a customized JRE with the app. |
71+
| `forceJreOptimization` | No | `false` | Although JDK version < 13, it will try to reduce the bundled JRE. |
72+
| `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. |
73+
| `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 |
74+
| `additionalModules` | No | `""` | When generating a customized JRE, allows adding aditional modules other than the ones identified by jdeps before calling jlink. |
75+
| `administratorRequired` | No | `false` | If true, app will run with administrator privileges. |
76+
| `additionalResources` | No | [] | Additional files and folders to include in the bundled app. |
77+
| `generateInstaller` | No | `true` | Generate an installer for the app. |
78+
| `displayName` | No | `${project.name}` | App name to show. |
79+
| `iconFile` | No | `null` | Path to the app icon file (PNG, ICO or ICNS). |
80+
| `licenseFile` | No | `${project.licenses[0].url}` | Path to project license file. |
81+
| `url` | No | `null` | App website URL. |
82+
| `organizationName` | No | `${project.organization.name}` | Organization name. |
83+
| `organizationUrl` | No | `${project.organization.url}` | Organization website URL. |
84+
| `organizationEmail` | No | `null` | Organization email. |
8385

8486
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:
8587

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<groupId>fvarrui.maven</groupId>
77
<artifactId>javapackager</artifactId>
8-
<version>0.8.4</version>
8+
<version>0.8.5-SNAPSHOT</version>
99
<packaging>maven-plugin</packaging>
1010

1111
<name>JavaPackager Maven Plugin</name>

src/main/java/fvarrui/maven/plugin/javapackager/PackageMojo.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,12 @@ public class PackageMojo extends AbstractMojo {
125125
@Parameter(property = "additionalResources", required = false)
126126
private List<File> additionalResources;
127127

128+
@Parameter(defaultValue = "--list-deps", property = "moduleDependenceAnalysisOption", required = false)
129+
private String moduleDependenceAnalysisOption;
130+
131+
@Parameter(defaultValue = "", property = "additionalModules", required = false)
132+
private String additionalModules;
133+
128134
public PackageMojo() {
129135
super();
130136
Logger.init(getLog());
@@ -674,9 +680,9 @@ private String getRequiredModules(File libsFolder) throws MojoExecutionException
674680
jdeps.getAbsolutePath(),
675681
"-q",
676682
additionalArguments,
677-
"--list-deps",
683+
moduleDependenceAnalysisOption,
678684
"--multi-release", JavaUtils.getJavaMajorVersion(),
679-
new File(libsFolder, "*"),
685+
new File(libsFolder, "*.jar"),
680686
jarFile
681687
);
682688

@@ -686,6 +692,9 @@ private String getRequiredModules(File libsFolder) throws MojoExecutionException
686692
.map(module -> module.trim())
687693
.filter(module -> !module.startsWith("JDK removed internal"))
688694
.collect(Collectors.toList());
695+
if (!StringUtils.isEmpty(additionalModules)) {
696+
modulesList.addAll(Arrays.asList(additionalModules.split(",")).stream().map(module->module.trim()).collect(Collectors.toList()));
697+
}
689698

690699
return StringUtils.join(modulesList, ",");
691700
}

0 commit comments

Comments
 (0)