-
Notifications
You must be signed in to change notification settings - Fork 70
/
pom.xml
434 lines (416 loc) · 17.9 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
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
<?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>com.acgist</groupId>
<artifactId>snail.parent</artifactId>
<version>2.17.0</version>
<packaging>pom</packaging>
<properties>
<snail.vendor>acgist</snail.vendor>
<snail.module>${project.groupId}.${project.artifactId}</snail.module>
<snail.version>${project.version}</snail.version>
<snail.encoding>UTF-8</snail.encoding>
<java.version>17</java.version>
<javafx.version>17.0.11</javafx.version>
<junit.version>5.10.2</junit.version>
<maven.gpg.version>3.2.4</maven.gpg.version>
<maven.jar.version>3.4.1</maven.jar.version>
<maven.source.version>3.3.1</maven.source.version>
<maven.javadoc.version>3.7.0</maven.javadoc.version>
<maven.compiler.version>3.13.0</maven.compiler.version>
<maven.resources.version>3.3.1</maven.resources.version>
<maven.dependency.version>3.6.1</maven.dependency.version>
<project.build.sourceEncoding>${snail.encoding}</project.build.sourceEncoding>
</properties>
<!-- 模块 -->
<modules>
<module>snail</module>
<module>snail-javafx</module>
</modules>
<dependencies>
<!-- 测试:JUnit -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<!-- 环境:-P develop|release -->
<profiles>
<profile>
<id>develop</id>
<activation>
<!-- 设置默认 -->
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<package.environment>develop</package.environment>
</properties>
</profile>
<profile>
<id>release</id>
<properties>
<package.environment>release</package.environment>
</properties>
</profile>
</profiles>
<build>
<!-- 配置文件属性替换路径 -->
<!--
<filters></filters>
-->
<!-- 资源文件 -->
<!--
<resources></resources>
-->
<!-- Maven插件 -->
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
</plugin>
</plugins>
<!-- 插件管理 -->
<pluginManagement>
<plugins>
<!--
生成签名:mvn verify
跳过签名:-D gpg.skip=true
-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>${maven.gpg.version}</version>
<executions>
<!-- 自动生成签名 -->
<execution>
<id>auto-build-sign</id>
<phase>install</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
<!--
打包项目:mvn package
-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>${maven.jar.version}</version>
<configuration>
<!-- MANIFEST.MF -->
<archive>
<manifestEntries>
<Built-By>${snail.vendor}</Built-By>
<Home-Page>${project.url}</Home-Page>
<Automatic-Module-Name>${snail.module}</Automatic-Module-Name>
<Specification-Title>${project.artifactId}</Specification-Title>
<Specification-Vendor>${snail.vendor}</Specification-Vendor>
<Specification-Version>${snail.version}</Specification-Version>
<Implementation-Title>${project.artifactId}</Implementation-Title>
<Implementation-Vendor>${snail.vendor}</Implementation-Vendor>
<Implementation-Version>${snail.version}</Implementation-Version>
</manifestEntries>
</archive>
</configuration>
</plugin>
<!--
打包源码:
mvn source:jar
mvn source:test-jar
跳过源码:-D maven.source.skip=true
-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>${maven.source.version}</version>
<configuration>
<attach>true</attach>
</configuration>
<executions>
<!-- 自动打包源码 -->
<execution>
<id>auto-build-source</id>
<!--
打包源码:mvn install|deploy
生命周期:
package不用打包源码
install|deploy不能正常签名
-->
<phase>verify</phase>
<goals>
<!-- 和jar一样:不会分叉构建 -->
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<!--
打包文档:
mvn site
mvn javadoc:jar
mvn javadoc:javadoc
跳过文档:-D maven.javadoc.skip=true
-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven.javadoc.version}</version>
<configuration>
<!-- 忽略警告:注解、标签等等 -->
<doclint>none</doclint>
<charset>${snail.encoding}</charset>
<encoding>${snail.encoding}</encoding>
<docencoding>${snail.encoding}</docencoding>
<description>${project.description}</description>
<!-- 忽略模块描述 -->
<!--
<sourceFileExcludes>
<sourceFileExclude>**/module-info.java</sourceFileExclude>
</sourceFileExcludes>
-->
</configuration>
<executions>
<!-- 自动打包文档 -->
<execution>
<id>auto-build-javadoc</id>
<!--
打包文档:mvn install|deploy
生命周期:
package不用打包文档
install|deploy不能正常签名
-->
<phase>verify</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<!--
编译代码:
mvn compile
mvn test-compile
-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven.compiler.version}</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<encoding>${snail.encoding}</encoding>
</configuration>
</plugin>
<!--
打包资源:
mvn resources:resources
mvn resources:testResources
mvn resources:copy-resources
-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>${maven.resources.version}</version>
<configuration>
<resources>
<!-- 配置文件 -->
<resource>
<directory>src/main/resources</directory>
<!-- 配置文件属性替换:properties -->
<filtering>false</filtering>
<includes>
<include>**</include>
</includes>
<!-- 排除环境资源文件 -->
<excludes>
<exclude>profiles/**</exclude>
</excludes>
</resource>
<!-- 开源协议 -->
<resource>
<directory>./</directory>
<filtering>false</filtering>
<targetPath>META-INF/</targetPath>
<includes>
<include>LICENSE</include>
</includes>
</resource>
</resources>
</configuration>
<executions>
<!-- 自动复制环境资源 -->
<execution>
<id>auto-copy-resources</id>
<phase>compile</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<!-- 遗传 -->
<inherited>true</inherited>
<configuration>
<!-- 覆盖资源 -->
<overwrite>true</overwrite>
<outputDirectory>${project.build.outputDirectory}</outputDirectory>
<resources>
<!-- 环境资源 -->
<resource>
<directory>src/main/resources/profiles/${package.environment}</directory>
<filtering>false</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<!--
复制依赖:
mvn dependency:copy
mvn dependency:copy-dependencies
-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>${maven.dependency.version}</version>
<configuration>
<stripVersion>false</stripVersion>
<includeScope>compile</includeScope>
<excludeTransitive>false</excludeTransitive>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
</configuration>
<executions>
<!-- 自动复制依赖 -->
<execution>
<id>auto-copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
<!-- 依赖管理 -->
<dependencyManagement>
<dependencies>
<!--
GUI:JavaFX
隐式依赖:javafx-base、javafx-controls、javafx-graphics
编译系统和运行系统不一致时:
1.添加编译参数:-D javafx.platform=win|mac|linux
2.添加依赖属性:<classifier>win|mac|linux</classifier>
-->
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>${javafx.version}</version>
</dependency>
<!-- 蜗牛:Snail -->
<dependency>
<groupId>com.acgist</groupId>
<artifactId>snail</artifactId>
<version>${snail.version}</version>
</dependency>
<dependency>
<groupId>com.acgist</groupId>
<artifactId>snail.javafx</artifactId>
<version>${snail.version}</version>
</dependency>
<!-- 测试:JUnit -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>${junit.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<!-- 基本信息 -->
<url>https://gitee.com/acgist/snail</url>
<name>snail.parent</name>
<description>基于Java、JavaFX开发的下载工具,支持下载协议:BT(BitTorrent、磁力链接、种子文件)、HLS(M3U8)、FTP、HTTP。</description>
<inceptionYear>2019</inceptionYear>
<!-- 仓库信息 -->
<scm>
<tag>HEAD</tag>
<url>https://gitee.com/acgist/snail</url>
<connection>scm:git:git://gitee.com/acgist/snail</connection>
<developerConnection>scm:git:[email protected]:acgist/snail</developerConnection>
</scm>
<!-- 开源许可 -->
<licenses>
<license>
<url>https://opensource.org/licenses/Apache-2.0</url>
<name>Apache-2.0</name>
</license>
</licenses>
<!-- 开发人员 -->
<developers>
<developer>
<id>acgist</id>
<url>https://gitee.com/acgist</url>
<name>Sheng Yu</name>
<email>[email protected]</email>
<timezone>+8</timezone>
<organization>https://www.acgist.com</organization>
<roles>
<role>master</role>
<role>developer</role>
</roles>
</developer>
</developers>
<!-- 组织信息 -->
<organization>
<url>https://www.acgist.com</url>
<name>acgist</name>
</organization>
<!-- issues -->
<issueManagement>
<url>https://gitee.com/acgist/snail/issues</url>
<system>Gitee Issues</system>
</issueManagement>
<!-- https://oss.sonatype.org/ -->
<!-- https://issues.sonatype.org/browse/OSSRH-51336 -->
<!-- mvn clean package deploy -P release -D skipTests -->
<distributionManagement>
<repository>
<id>sonatype_releases</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
<name>Nexus Release Repository</name>
</repository>
<snapshotRepository>
<id>sonatype_snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<name>Nexus Snapshot Repository</name>
</snapshotRepository>
</distributionManagement>
</project>