44
55``` xml
66<plugin >
7- <groupId >io.github.fvarrui</groupId >
8- <artifactId >javapackager</artifactId >
9- <version >{latest-plugin-version-here}</version >
10- <executions >
11- <execution >
12- <phase >package</phase >
13- <goals >
14- <goal >package</goal >
15- </goals >
16- <configuration >
17- <mainClass >fvarrui.sample.Main</mainClass >
18- </configuration >
19- </execution >
20- </executions >
7+ <groupId >io.github.fvarrui</groupId >
8+ <artifactId >javapackager</artifactId >
9+ <version >{latest-plugin-version-here}</version >
10+ <executions >
11+ <execution >
12+ <phase >package</phase >
13+ <goals >
14+ <goal >package</goal >
15+ </goals >
16+ <configuration >
17+ <mainClass >fvarrui.sample.Main</mainClass >
18+ </configuration >
19+ </execution >
20+ </executions >
2121</plugin >
2222```
2323
2424Also, JavaPackager plugin is able to get some properties from ` pom.xml ` , so you don't need to specify them twice:
2525
2626``` xml
2727<project >
28- <properties >
29- <exec .mainClass>fvarrui.sample.Main</exec .mainClass>
30- </properties >
31- <build >
32- <plugins >
33- <plugin >
34- <groupId >io.github.fvarrui</groupId >
35- <artifactId >javapackager</artifactId >
36- <version >{latest-plugin-version-here}</version >
37- <executions >
38- <execution >
39- <phase >package</phase >
40- <goals >
41- <goal >package</goal >
42- </goals >
43- </execution >
44- </executions >
45- </plugin >
46- </plugins >
47- </build >
28+ <properties >
29+ <exec .mainClass>fvarrui.sample.Main</exec .mainClass>
30+ </properties >
31+ <build >
32+ <plugins >
33+ <plugin >
34+ <groupId >io.github.fvarrui</groupId >
35+ <artifactId >javapackager</artifactId >
36+ <version >{latest-plugin-version-here}</version >
37+ <executions >
38+ <execution >
39+ <phase >package</phase >
40+ <goals >
41+ <goal >package</goal >
42+ </goals >
43+ </execution >
44+ </executions >
45+ </plugin >
46+ </plugins >
47+ </build >
4848</project >
4949```
5050> :warning : This minimal configuration will not bundle a JRE, so final user will need one in order to run the app.
@@ -53,21 +53,21 @@ Also, JavaPackager plugin is able to get some properties from `pom.xml`, so you
5353
5454``` xml
5555<plugin >
56- <groupId >io.github.fvarrui</groupId >
57- <artifactId >javapackager</artifactId >
58- <version >{latest-plugin-version-here}</version >
59- <executions >
60- <execution >
61- <phase >package</phase >
62- <goals >
63- <goal >package</goal >
64- </goals >
65- <configuration >
66- <mainClass >fvarrui.sample.Main</mainClass >
67- <bundleJre >true</bundleJre >
68- </configuration >
69- </execution >
70- </executions >
56+ <groupId >io.github.fvarrui</groupId >
57+ <artifactId >javapackager</artifactId >
58+ <version >{latest-plugin-version-here}</version >
59+ <executions >
60+ <execution >
61+ <phase >package</phase >
62+ <goals >
63+ <goal >package</goal >
64+ </goals >
65+ <configuration >
66+ <mainClass >fvarrui.sample.Main</mainClass >
67+ <bundleJre >true</bundleJre >
68+ </configuration >
69+ </execution >
70+ </executions >
7171</plugin >
7272```
7373
@@ -77,107 +77,108 @@ Also, JavaPackager plugin is able to get some properties from `pom.xml`, so you
7777
7878``` xml
7979<plugin >
80- <groupId >io.github.fvarrui</groupId >
81- <artifactId >javapackager</artifactId >
82- <version >{latest-plugin-version-here}</version >
83- <executions >
84- <execution >
85- <phase >package</phase >
86- <goals >
87- <goal >package</goal >
88- </goals >
89- <configuration >
90- <mainClass >fvarrui.sample.Main</mainClass >
91- <bundleJre >true</bundleJre >
92- <customizedJre >false</customizedJre >
93- </configuration >
94- </execution >
95- </executions >
80+ <groupId >io.github.fvarrui</groupId >
81+ <artifactId >javapackager</artifactId >
82+ <version >{latest-plugin-version-here}</version >
83+ <executions >
84+ <execution >
85+ <phase >package</phase >
86+ <goals >
87+ <goal >package</goal >
88+ </goals >
89+ <configuration >
90+ <mainClass >fvarrui.sample.Main</mainClass >
91+ <bundleJre >true</bundleJre >
92+ <customizedJre >false</customizedJre >
93+ </configuration >
94+ </execution >
95+ </executions >
9696</plugin >
9797```
9898
9999## Bundle with an existing JRE
100100
101101``` xml
102102<plugin >
103- <groupId >io.github.fvarrui</groupId >
104- <artifactId >javapackager</artifactId >
105- <version >{latest-plugin-version-here}</version >
106- <executions >
107- <execution >
108- <phase >package</phase >
109- <goals >
110- <goal >package</goal >
111- </goals >
112- <configuration >
113- <mainClass >fvarrui.sample.Main</mainClass >
114- <bundleJre >true</bundleJre >
115- <jrePath >C:\Program Files\Java\jre1.8.0_231</jrePath >
116- </configuration >
117- </execution >
118- </executions >
103+ <groupId >io.github.fvarrui</groupId >
104+ <artifactId >javapackager</artifactId >
105+ <version >{latest-plugin-version-here}</version >
106+ <executions >
107+ <execution >
108+ <phase >package</phase >
109+ <goals >
110+ <goal >package</goal >
111+ </goals >
112+ <configuration >
113+ <mainClass >fvarrui.sample.Main</mainClass >
114+ <bundleJre >true</bundleJre >
115+ <jrePath >C:\Program Files\Java\jre1.8.0_231</jrePath >
116+ </configuration >
117+ </execution >
118+ </executions >
119119</plugin >
120120```
121121
122122## Bundle your own fat JAR
123123
124124``` xml
125125<plugin >
126- <groupId >io.github.fvarrui</groupId >
127- <artifactId >javapackager</artifactId >
128- <version >{latest-plugin-version-here}</version >
129- <executions >
130- <execution >
131- <phase >package</phase >
132- <goals >
133- <goal >package</goal >
134- </goals >
135- <configuration >
136- <mainClass >fvarrui.sample.Main</mainClass >
137- <bundleJre >true</bundleJre >
138- <runnableJar >path/to/your/own/fat.jar</runnableJar >
139- <copyDependencies >false</copyDependencies >
140- </configuration >
141- </execution >
142- </executions >
126+ <groupId >io.github.fvarrui</groupId >
127+ <artifactId >javapackager</artifactId >
128+ <version >{latest-plugin-version-here}</version >
129+ <executions >
130+ <execution >
131+ <phase >package</phase >
132+ <goals >
133+ <goal >package</goal >
134+ </goals >
135+ <configuration >
136+ <mainClass >fvarrui.sample.Main</mainClass >
137+ <bundleJre >true</bundleJre >
138+ <runnableJar >path/to/your/own/fat.jar</runnableJar >
139+ <copyDependencies >false</copyDependencies >
140+ </configuration >
141+ </execution >
142+ </executions >
143143</plugin >
144144```
145145
146146## Multiple executions
147147
148148``` xml
149149<plugin >
150- <groupId >io.github.fvarrui</groupId >
151- <artifactId >javapackager</artifactId >
152- <version >{latest-plugin-version-here}</version >
153- <executions >
154- <execution >
155- <id >bundle-with-jre</id >
156- <phase >package</phase >
157- <goals >
158- <goal >package</goal >
159- </goals >
160- <configuration >
161- <name >Sample</name >
162- <mainClass >fvarrui.sample.Main</mainClass >
163- <bundleJre >true</bundleJre >
164- </configuration >
165- </execution >
166- <execution >
167- <id >bundle-without-jre</id >
168- <phase >package</phase >
169- <goals >
170- <goal >package</goal >
171- </goals >
172- <configuration >
173- <name >Sample-nojre</name >
174- <mainClass >fvarrui.sample.Main</mainClass >
175- <bundleJre >false</bundleJre >
176- </configuration >
177- </execution >
178- </executions >
150+ <groupId >io.github.fvarrui</groupId >
151+ <artifactId >javapackager</artifactId >
152+ <version >{latest-plugin-version-here}</version >
153+ <executions >
154+ <execution >
155+ <id >bundle-with-jre</id >
156+ <phase >package</phase >
157+ <goals >
158+ <goal >package</goal >
159+ </goals >
160+ <configuration >
161+ <name >Sample</name >
162+ <mainClass >fvarrui.sample.Main</mainClass >
163+ <bundleJre >true</bundleJre >
164+ </configuration >
165+ </execution >
166+ <execution >
167+ <id >bundle-without-jre</id >
168+ <phase >package</phase >
169+ <goals >
170+ <goal >package</goal >
171+ </goals >
172+ <configuration >
173+ <name >Sample-nojre</name >
174+ <mainClass >fvarrui.sample.Main</mainClass >
175+ <bundleJre >false</bundleJre >
176+ </configuration >
177+ </execution >
178+ </executions >
179179</plugin >
180180```
181+
181182E.g. on Windows, last configuration will generate next artifacts:
182183* ` Sample_x.y.z.exe ` with a bundled JRE.
183184* ` Sample-nojre_x.y.z.exe ` without JRE.
0 commit comments