Skip to content

Commit e1ef013

Browse files
committed
U v0.8.7
1 parent ab77551 commit e1ef013

File tree

5 files changed

+26
-26
lines changed

5 files changed

+26
-26
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ Where:
7373
| -------------------------------- | --------- | ------------------------------ | ------------------------------------------------------------ |
7474
| `mainClass` | Yes | `null` | Full path to your app main class. |
7575
| `bundleJre` | No | `false` | Embed a customized JRE with the app. |
76-
| `forceJreOptimization` | No | `false` | Although JDK version < 13, it will try to reduce the bundled JRE. |
76+
| `customizedJre` | No | `true` | If this option and `bundleJre` are `true`, a customized JRE will be generated, including only needed modules. |
77+
| `forceJreOptimization` | No | `false` | Although JDK version < 13, it will try to reduce the bundled JRE. :warning: **DEPRECATED since v0.8.7** |
7778
| `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. |
7879
| `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`. :warning: **DEPRECATED since v0.8.7** |
7980
| `additionalModules` | No | [] | When generating a customized JRE, allows adding aditional modules other than the ones identified by `jdeps` before calling `jlink`. |
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#NOTE: This is a Maven Resolver internal implementation file, its format can be changed without prior notice.
2-
#Thu Jan 09 12:04:14 GMT 2020
2+
#Thu Jan 09 12:19:54 GMT 2020
33
javapackager-0.8.7.pom>=
44
javapackager-0.8.7.jar>=
-205 Bytes
Binary file not shown.

releases/fvarrui/maven/javapackager/maven-metadata-local.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@
1818
<version>0.8.6</version>
1919
<version>0.8.7</version>
2020
</versions>
21-
<lastUpdated>20200109120414</lastUpdated>
21+
<lastUpdated>20200109121954</lastUpdated>
2222
</versioning>
2323
</metadata>

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

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ public class PackageMojo extends AbstractMojo {
117117
@Parameter(defaultValue = "false", property = "bundleJre", required = true)
118118
private Boolean bundleJre;
119119

120-
@Parameter(defaultValue = "false", property = "forceJreOptimization", required = true)
121-
private Boolean forceJreOptimization;
120+
@Parameter(defaultValue = "true", property = "customizedJre", required = false)
121+
private Boolean customizedJre;
122122

123123
@Parameter(defaultValue = "", property = "jrePath", required = false)
124124
private String jrePath;
@@ -602,7 +602,7 @@ private void createCustomizedJre(File jreFolder, File libsFolder) throws MojoExe
602602

603603
if (jrePath != null && !jrePath.isEmpty()) {
604604

605-
getLog().info("- Copying JRE from " + jrePath);
605+
getLog().info("- Embedding JRE from " + jrePath);
606606

607607
File jrePathFolder = new File(jrePath);
608608

@@ -626,25 +626,25 @@ private void createCustomizedJre(File jreFolder, File libsFolder) throws MojoExe
626626

627627
getLog().info("- Creating customized JRE ...");
628628

629-
String modules;
629+
String modules = getRequiredModules(libsFolder);
630630

631631
// warn and generate a non optimized JRE
632-
if (JavaUtils.getJavaMajorVersion() <= 12 && !forceJreOptimization) {
633-
634-
getLog().warn("We need JDK 12+ for correctly determining the dependencies. You run " + System.getProperty("java.home"));
635-
getLog().warn("All modules will be included in the generated JRE.");
636-
637-
modules = "ALL-MODULE-PATH";
638-
639-
} else { // generate an optimized JRE, including only required modules
640-
641-
if (forceJreOptimization) {
642-
getLog().warn("JRE optimization has been forced. It can cause issues with some JDKs.");
643-
}
644-
645-
modules = getRequiredModules(libsFolder);
646-
647-
}
632+
// if (JavaUtils.getJavaMajorVersion() < 12 && !forceJreOptimization) {
633+
//
634+
// getLog().warn("We need JDK 12+ for correctly determining the dependencies. You run " + System.getProperty("java.home"));
635+
// getLog().warn("All modules will be included in the generated JRE.");
636+
//
637+
// modules = "ALL-MODULE-PATH";
638+
//
639+
// } else { // generate an optimized JRE, including only required modules
640+
//
641+
// if (forceJreOptimization) {
642+
// getLog().warn("JRE optimization has been forced. It can cause issues with some JDKs.");
643+
// }
644+
//
645+
// modules = getRequiredModules(libsFolder);
646+
//
647+
// }
648648

649649
File modulesDir = new File(System.getProperty("java.home"), "jmods");
650650

@@ -668,11 +668,10 @@ private String getRequiredModules(File libsFolder) throws MojoExecutionException
668668
File jdeps = new File(System.getProperty("java.home"), "/bin/jdeps");
669669

670670
File [] jarLibs = libsFolder.listFiles(new FilenameExtensionFilter("jar"));
671-
// File jarLibs = new File(libsFolder, "*.jar");
672671

673672
List<String> modulesList;
674673

675-
if (JavaUtils.getJavaMajorVersion() >= 13) {
674+
if (customizedJre && JavaUtils.getJavaMajorVersion() >= 13) {
676675

677676
String modules =
678677
ProcessUtils.execute(
@@ -691,7 +690,7 @@ private String getRequiredModules(File libsFolder) throws MojoExecutionException
691690
.collect(Collectors.toList());
692691

693692

694-
} else if (JavaUtils.getJavaMajorVersion() >= 9) {
693+
} else if (customizedJre && JavaUtils.getJavaMajorVersion() >= 9) {
695694

696695
String modules =
697696
ProcessUtils.execute(

0 commit comments

Comments
 (0)