-
Notifications
You must be signed in to change notification settings - Fork 19
/
pom.xml
253 lines (223 loc) · 11.2 KB
/
pom.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>no.tornado</groupId>
<artifactId>fxldemo</artifactId>
<version>2.0</version>
<name>FxlDemo</name>
<!--
This deployment descriptor features a complete example for building an auto updating JavaFX application
with FXLauncher, including native installers. ControlsFX is included just to have some additional dependencies :)
-->
<dependencies>
<dependency>
<groupId>no.tornado</groupId>
<artifactId>fxlauncher</artifactId>
<version>1.0.20</version>
</dependency>
<dependency>
<groupId>org.controlsfx</groupId>
<artifactId>controlsfx</artifactId>
<version>8.40.11</version>
</dependency>
</dependencies>
<!-- Everything you normally need to configure is done in this section -->
<properties>
<!-- Installer Filename without suffix -->
<app.filename>FxlDemo</app.filename>
<!-- The JavaFX Application class name -->
<app.mainClass>no.tornado.FxlDemo</app.mainClass>
<!-- Optional override to specify where the cached files are stored. Default is current working directory -->
<app.cacheDir>USERLIB/FxlDemo</app.cacheDir>
<!-- Optional parameters to the application, will be embedded in the launcher and can be overriden on the command line -->
<app.parameters>--myOption=myValue --myOtherOption=myOtherValue</app.parameters>
<!-- The Application vendor used by javapackager -->
<app.vendor>Acme Inc</app.vendor>
<!-- The Application version used by javapackager -->
<app.version>2.0</app.version>
<!-- Base URL where you will host the application artifacts -->
<app.url>http://fxldemo.tornado.no/</app.url>
<!-- Optional scp target for application artifacts hosted at the above url -->
<app.deploy.target>[email protected]:fxldemo</app.deploy.target>
<!-- The app and launcher will be assembled in this folder -->
<app.dir>${project.build.directory}/app</app.dir>
<!-- Native installers will be built in this folder -->
<app.installerdir>${project.build.directory}/installer</app.installerdir>
<!-- Should the client downgrade if the server version is older than the local version? -->
<app.acceptDowngrade>false</app.acceptDowngrade>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<!-- The build plugins below perform the following steps:
1. Compile project jar to app.dir
2. Copy dependencies to app.dir
3. Generate app.xml manifest and embed it into fxlauncher.jar
4. Create native installer
5. Upload application artifacts
Usage:
Generate a working app into app.dir (target/app by default):
mvn clean package
(You can now launch the app with java -jar fxlauncher.jar from target/app)
Deploy the application artifacts via scp
mvn exec:exec@deploy-app
(Auto update is now available. You can also run java -jar fxlauncher.jar)
Build a native installer for the platform you are on (only needed once)
mvn install
(Look in target/installer/bundles for your native installer)
-->
<build>
<plugins>
<!-- Compile project jar to appdir -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.6</version>
<configuration>
<outputDirectory>${app.dir}</outputDirectory>
</configuration>
</plugin>
<!-- Copy dependencies to appdir -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.10</version>
<configuration>
<excludeScope>provided</excludeScope>
<outputDirectory>${app.dir}</outputDirectory>
<stripVersion>true</stripVersion>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.4.0</version>
<!-- Generate app.xml manifest -->
<executions>
<execution>
<id>create-manifest</id>
<phase>package</phase>
<goals>
<goal>java</goal>
</goals>
<configuration>
<mainClass>fxlauncher.CreateManifest</mainClass>
<arguments>
<argument>${app.url}</argument>
<argument>${app.mainClass}</argument>
<argument>${app.dir}</argument>
<argument>--cache-dir=${app.cacheDir}</argument>
<argument>--accept-downgrade=${app.acceptDowngrade}</argument>
<argument>--include-extensions=jpg</argument>
<argument>${app.parameters}</argument>
</arguments>
</configuration>
</execution>
<!-- Embed app.xml inside fxlauncher.xml so we don't need to reference app.xml to start the app -->
<execution>
<id>embed-manifest-in-launcher</id>
<phase>package</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>jar</executable>
<workingDirectory>${app.dir}</workingDirectory>
<arguments>
<argument>uf</argument>
<argument>fxlauncher.jar</argument>
<argument>app.xml</argument>
</arguments>
</configuration>
</execution>
<!-- Optional step to include custom UI, see https://github.com/edvin/fxlauncher-custom-ui -->
<!--<execution>-->
<!--<id>embed-custom-ui-in-launcher</id>-->
<!--<phase>package</phase>-->
<!--<goals>-->
<!--<goal>exec</goal>-->
<!--</goals>-->
<!--<configuration>-->
<!--<executable>jar</executable>-->
<!--<workingDirectory>${app.dir}</workingDirectory>-->
<!--<arguments>-->
<!--<argument>uf</argument>-->
<!--<argument>fxlauncher.jar</argument>-->
<!--<argument>-C</argument>-->
<!--<argument>${project.basedir}/../fxlauncher-custom-ui/target/classes</argument>-->
<!--<argument>.</argument>-->
<!--</arguments>-->
<!--</configuration>-->
<!--</execution>-->
<!-- Create native installer. Feel free to add more arguments as needed.
https://docs.oracle.com/javase/8/docs/technotes/tools/windows/javapackager.html
-->
<execution>
<id>installer</id>
<phase>install</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>javapackager</executable>
<arguments>
<argument>-deploy</argument>
<argument>-native</argument>
<argument>-outdir</argument>
<argument>${app.installerdir}</argument>
<argument>-outfile</argument>
<argument>${app.filename}</argument>
<argument>-srcdir</argument>
<argument>${app.dir}</argument>
<argument>-srcfiles</argument>
<argument>fxlauncher.jar</argument>
<argument>-appclass</argument>
<argument>fxlauncher.Launcher</argument>
<argument>-name</argument>
<argument>${project.name}</argument>
<argument>-title</argument>
<argument>${project.name}</argument>
<argument>-vendor</argument>
<argument>${app.vendor}</argument>
<argument>-BappVersion=${app.version}</argument>
<argument>-Bidentifier=${project.groupId}.${project.artifactId}</argument>
</arguments>
</configuration>
</execution>
<!-- Copy application artifacts to remote site using scp (optional) -->
<execution>
<id>deploy-app</id>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>scp</executable>
<arguments>
<argument>-r</argument>
<argument>target/app/.</argument>
<argument>${app.deploy.target}</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
</project>