|
1 | 1 | # Plugin configuration samples for Maven
|
2 |
| - |
3 | 2 | ## Minimal config
|
4 |
| - |
5 | 3 | ```xml
|
6 | 4 | <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> |
| 5 | + <groupId>io.github.fvarrui</groupId> |
| 6 | + <artifactId>javapackager</artifactId> |
| 7 | + <version>{latest-plugin-version-here}</version> |
| 8 | + <executions> |
| 9 | + <execution> |
| 10 | + <phase>package</phase> |
| 11 | + <goals> |
| 12 | + <goal>package</goal> |
| 13 | + </goals> |
| 14 | + <configuration> |
| 15 | + <mainClass>fvarrui.sample.Main</mainClass> |
| 16 | + </configuration> |
| 17 | + </execution> |
| 18 | + </executions> |
21 | 19 | </plugin>
|
22 | 20 | ```
|
23 |
| - |
24 | 21 | Also, JavaPackager plugin is able to get some properties from `pom.xml`, so you don't need to specify them twice:
|
25 |
| - |
26 | 22 | ```xml
|
27 | 23 | <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> |
| 24 | + <properties> |
| 25 | + <exec.mainClass>fvarrui.sample.Main</exec.mainClass> |
| 26 | + </properties> |
| 27 | + <build> |
| 28 | + <plugins> |
| 29 | + <plugin> |
| 30 | + <groupId>io.github.fvarrui</groupId> |
| 31 | + <artifactId>javapackager</artifactId> |
| 32 | + <version>{latest-plugin-version-here}</version> |
| 33 | + <executions> |
| 34 | + <execution> |
| 35 | + <phase>package</phase> |
| 36 | + <goals> |
| 37 | + <goal>package</goal> |
| 38 | + </goals> |
| 39 | + </execution> |
| 40 | + </executions> |
| 41 | + </plugin> |
| 42 | + </plugins> |
| 43 | + </build> |
48 | 44 | </project>
|
49 | 45 | ```
|
50 | 46 | > :warning: This minimal configuration will not bundle a JRE, so final user will need one in order to run the app.
|
51 |
| -
|
52 | 47 | ## Bundle with a customized JRE
|
53 |
| - |
54 | 48 | ```xml
|
55 | 49 | <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> |
| 50 | + <groupId>io.github.fvarrui</groupId> |
| 51 | + <artifactId>javapackager</artifactId> |
| 52 | + <version>{latest-plugin-version-here}</version> |
| 53 | + <executions> |
| 54 | + <execution> |
| 55 | + <phase>package</phase> |
| 56 | + <goals> |
| 57 | + <goal>package</goal> |
| 58 | + </goals> |
| 59 | + <configuration> |
| 60 | + <mainClass>fvarrui.sample.Main</mainClass> |
| 61 | + <bundleJre>true</bundleJre> |
| 62 | + </configuration> |
| 63 | + </execution> |
| 64 | + </executions> |
71 | 65 | </plugin>
|
72 | 66 | ```
|
73 |
| - |
74 | 67 | > `customizedJre` is `true` by default, so you don't have to specify it.
|
75 |
| -
|
76 | 68 | ## Bundle with a full JRE
|
77 |
| - |
78 | 69 | ```xml
|
79 | 70 | <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> |
| 71 | + <groupId>io.github.fvarrui</groupId> |
| 72 | + <artifactId>javapackager</artifactId> |
| 73 | + <version>{latest-plugin-version-here}</version> |
| 74 | + <executions> |
| 75 | + <execution> |
| 76 | + <phase>package</phase> |
| 77 | + <goals> |
| 78 | + <goal>package</goal> |
| 79 | + </goals> |
| 80 | + <configuration> |
| 81 | + <mainClass>fvarrui.sample.Main</mainClass> |
| 82 | + <bundleJre>true</bundleJre> |
| 83 | + <customizedJre>false</customizedJre> |
| 84 | + </configuration> |
| 85 | + </execution> |
| 86 | + </executions> |
96 | 87 | </plugin>
|
97 | 88 | ```
|
98 |
| - |
99 | 89 | ## Bundle with an existing JRE
|
100 |
| - |
101 | 90 | ```xml
|
102 | 91 | <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> |
| 92 | + <groupId>io.github.fvarrui</groupId> |
| 93 | + <artifactId>javapackager</artifactId> |
| 94 | + <version>{latest-plugin-version-here}</version> |
| 95 | + <executions> |
| 96 | + <execution> |
| 97 | + <phase>package</phase> |
| 98 | + <goals> |
| 99 | + <goal>package</goal> |
| 100 | + </goals> |
| 101 | + <configuration> |
| 102 | + <mainClass>fvarrui.sample.Main</mainClass> |
| 103 | + <bundleJre>true</bundleJre> |
| 104 | + <jrePath>C:\Program Files\Java\jre1.8.0_311</jrePath> |
| 105 | + </configuration> |
| 106 | + </execution> |
| 107 | + </executions> |
119 | 108 | </plugin>
|
120 | 109 | ```
|
121 |
| - |
122 | 110 | ## Bundle your own fat JAR
|
123 |
| - |
124 | 111 | ```xml
|
125 | 112 | <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> |
| 113 | + <groupId>io.github.fvarrui</groupId> |
| 114 | + <artifactId>javapackager</artifactId> |
| 115 | + <version>{latest-plugin-version-here}</version> |
| 116 | + <executions> |
| 117 | + <execution> |
| 118 | + <phase>package</phase> |
| 119 | + <goals> |
| 120 | + <goal>package</goal> |
| 121 | + </goals> |
| 122 | + <configuration> |
| 123 | + <mainClass>fvarrui.sample.Main</mainClass> |
| 124 | + <bundleJre>true</bundleJre> |
| 125 | + <runnableJar>path/to/your/own/fat.jar</runnableJar> |
| 126 | + <copyDependencies>false</copyDependencies> |
| 127 | + </configuration> |
| 128 | + </execution> |
| 129 | + </executions> |
143 | 130 | </plugin>
|
144 | 131 | ```
|
145 |
| - |
146 | 132 | ## Multiple executions
|
147 |
| - |
148 | 133 | ```xml
|
149 | 134 | <plugin>
|
150 |
| - <groupId>io.github.fvarrui</groupId> |
151 |
| - <artifactId>javapackager</artifactId> |
152 |
| - <version>{latest-plugin-version-here}</version> |
| 135 | + <groupId>io.github.fvarrui</groupId> |
| 136 | + <artifactId>javapackager</artifactId> |
| 137 | + <version>{latest-plugin-version-here}</version> |
153 | 138 | <configuration>
|
154 |
| - <mainClass>fvarrui.sample.Main</mainClass> |
| 139 | + <mainClass>fvarrui.sample.Main</mainClass> |
155 | 140 | </configuration>
|
156 |
| - <executions> |
157 |
| - <execution> |
158 |
| - <id>bundle-with-jre</id> |
159 |
| - <phase>package</phase> |
160 |
| - <goals> |
161 |
| - <goal>package</goal> |
162 |
| - </goals> |
163 |
| - <configuration> |
164 |
| - <name>Sample</name> |
165 |
| - <bundleJre>true</bundleJre> |
166 |
| - </configuration> |
167 |
| - </execution> |
168 |
| - <execution> |
169 |
| - <id>bundle-without-jre</id> |
170 |
| - <phase>package</phase> |
171 |
| - <goals> |
172 |
| - <goal>package</goal> |
173 |
| - </goals> |
174 |
| - <configuration> |
175 |
| - <name>Sample-nojre</name> |
176 |
| - <bundleJre>false</bundleJre> |
177 |
| - </configuration> |
178 |
| - </execution> |
179 |
| - </executions> |
| 141 | + <executions> |
| 142 | + <execution> |
| 143 | + <id>bundle-with-jre</id> |
| 144 | + <phase>package</phase> |
| 145 | + <goals> |
| 146 | + <goal>package</goal> |
| 147 | + </goals> |
| 148 | + <configuration> |
| 149 | + <name>Sample</name> |
| 150 | + <bundleJre>true</bundleJre> |
| 151 | + </configuration> |
| 152 | + </execution> |
| 153 | + <execution> |
| 154 | + <id>bundle-without-jre</id> |
| 155 | + <phase>package</phase> |
| 156 | + <goals> |
| 157 | + <goal>package</goal> |
| 158 | + </goals> |
| 159 | + <configuration> |
| 160 | + <name>Sample-nojre</name> |
| 161 | + <bundleJre>false</bundleJre> |
| 162 | + </configuration> |
| 163 | + </execution> |
| 164 | + </executions> |
180 | 165 | </plugin>
|
181 | 166 | ```
|
182 |
| - |
183 | 167 | E.g. on Windows, last configuration will generate next artifacts:
|
184 | 168 | * `Sample_x.y.z.exe` with a bundled JRE.
|
185 | 169 | * `Sample-nojre_x.y.z.exe` without JRE.
|
186 |
| - |
187 | 170 | ## Bundling for multiple platforms
|
188 |
| - |
189 | 171 | ```xml
|
190 | 172 | <plugin>
|
191 |
| - <groupId>io.github.fvarrui</groupId> |
192 |
| - <artifactId>javapackager</artifactId> |
193 |
| - <version>{latest-plugin-version-here}</version> |
| 173 | + <groupId>io.github.fvarrui</groupId> |
| 174 | + <artifactId>javapackager</artifactId> |
| 175 | + <version>{latest-plugin-version-here}</version> |
194 | 176 | <configuration>
|
195 | 177 | <bundleJre>true</bundleJre>
|
196 |
| - <mainClass>fvarrui.sample.Main</mainClass> |
| 178 | + <mainClass>fvarrui.sample.Main</mainClass> |
197 | 179 | <generateInstaller>false</generateInstaller>
|
198 |
| - </configuration> |
199 |
| - <executions> |
200 |
| - <execution> |
201 |
| - <id>bundling-for-windows</id> |
202 |
| - <phase>package</phase> |
203 |
| - <goals> |
204 |
| - <goal>package</goal> |
205 |
| - </goals> |
206 |
| - <configuration> |
| 180 | + </configuration> |
| 181 | + <executions> |
| 182 | + <execution> |
| 183 | + <id>bundling-for-windows</id> |
| 184 | + <phase>package</phase> |
| 185 | + <goals> |
| 186 | + <goal>package</goal> |
| 187 | + </goals> |
| 188 | + <configuration> |
207 | 189 | <platform>windows</platform>
|
208 | 190 | <createZipball>true</createZipball>
|
209 |
| - </configuration> |
210 |
| - </execution> |
211 |
| - <execution> |
212 |
| - <id>bundling-for-linux</id> |
213 |
| - <phase>package</phase> |
214 |
| - <goals> |
215 |
| - <goal>package</goal> |
216 |
| - </goals> |
217 |
| - <configuration> |
| 191 | + </configuration> |
| 192 | + </execution> |
| 193 | + <execution> |
| 194 | + <id>bundling-for-linux</id> |
| 195 | + <phase>package</phase> |
| 196 | + <goals> |
| 197 | + <goal>package</goal> |
| 198 | + </goals> |
| 199 | + <configuration> |
218 | 200 | <platform>linux</platform>
|
219 | 201 | <createTarball>true</createTarball>
|
220 | 202 | <jdkPath>X:\\path\to\linux\jdk</jdkPath>
|
221 |
| - </configuration> |
222 |
| - </execution> |
223 |
| - <execution> |
224 |
| - <id>bundling-for-mac</id> |
225 |
| - <phase>package</phase> |
226 |
| - <goals> |
227 |
| - <goal>package</goal> |
228 |
| - </goals> |
229 |
| - <configuration> |
| 203 | + </configuration> |
| 204 | + </execution> |
| 205 | + <execution> |
| 206 | + <id>bundling-for-mac</id> |
| 207 | + <phase>package</phase> |
| 208 | + <goals> |
| 209 | + <goal>package</goal> |
| 210 | + </goals> |
| 211 | + <configuration> |
230 | 212 | <platform>mac</platform>
|
231 | 213 | <createTarball>true</createTarball>
|
232 | 214 | <jdkPath>X:\\path\to\mac\jdk</jdkPath>
|
233 |
| - </configuration> |
234 |
| - </execution> |
235 |
| - </executions> |
| 215 | + </configuration> |
| 216 | + </execution> |
| 217 | + </executions> |
236 | 218 | </plugin>
|
237 | 219 | ```
|
238 | 220 |
|
|
0 commit comments