Skip to content

Commit a53c65a

Browse files
build: 支持打包zip产物 (#2129)
* build: 支持打包zip产物 Close #2084 Signed-off-by: unknowIfGuestInDream <liang.tang.cx@gmail.com> * build: 支持打包zip产物 Close #2084 Signed-off-by: unknowIfGuestInDream <liang.tang.cx@gmail.com> * build: 支持打包zip产物 Close #2084 Signed-off-by: unknowIfGuestInDream <liang.tang.cx@gmail.com> * build: 支持打包zip产物 Close #2084 Signed-off-by: unknowIfGuestInDream <liang.tang.cx@gmail.com> --------- Signed-off-by: unknowIfGuestInDream <liang.tang.cx@gmail.com>
1 parent 4fc278d commit a53c65a

File tree

7 files changed

+285
-6
lines changed

7 files changed

+285
-6
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,14 @@ The build commands require the installation and setup of Java 17 or higher and M
6060

6161
# Pack
6262

63-
1. IDEA artifact packaging\
63+
1. IDEA artifact aggregation packaging\
6464
Configuration: Project Structure -> Artifacts -> Add New JAR -> Extract to Target JAR -> Choose your own manifest
6565
file
6666
path -> Done\
6767
Package: Build -> Build Artifacts -> Build
68-
2. It is recommended to package through `mvn package`.
68+
2. It is recommended to package with `mvn package`, and the dependencies are in the lib folder
69+
3. For smc and qe projects, you can also generate zip products by specifying Profile=zip (javafx.platform=win/mac/linux)
70+
`mvn -Djavafx.platform=win -Dmaven.test.skip=true -Pzip package`
6971

7072
# Integration builds
7173

README_jp.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,13 @@ frameとloginは基本モジュールで、Java SPI経由でプラグイン可
4545

4646
# パッケージ化
4747

48-
1. IDEA アーティファクトのパッケージ化\
48+
1. IDEAアーティファクト集約パッケージ\
4949
構成:プロジェクト構造 -> アーティファクト -> JARを追加 -> ターゲットJARに展開 ->
5050
独自のマニフェスト・ファイル・パスを選択 -> 完了\
5151
パッケージング:ビルド -> アーティファクトのビルド -> ビルド
52-
2.`mvn package`」を通じてパッケージ化することをお勧めします
52+
2. `mvn package`でパッケージ化することが推奨され、依存関係はlibフォルダにあります。
53+
3. smc および qe プロジェクトでは、Profile=zip (javafx.platform=win/mac/linux) を指定して zip 製品を生成することもできます。
54+
`mvn -Djavafx.platform=win -Dmaven.test.skip=true -Pzip package`
5355

5456
# インテグレーションのビルド
5557

README_zh.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,12 @@ frame 和 login 是基础模块, 通过java SPI实现可拔插,方便应用模
4444

4545
# 打包
4646

47-
1. IDEA工件打包\
47+
1. IDEA工件打聚合包\
4848
配置: 项目结构 -> 工件 -> 新增JAR -> 提取到目标JAR -> 选择自己的清单文件路径 -> 完成\
4949
打包: 构建 -> 构建工件 -> 构建
50-
2. 推荐`mvn package`打包
50+
2. 推荐`mvn package`打包, 依赖在lib文件夹下
51+
3. 对于smc和qe工程,通过指定Profile=zip还可以生成zip产物 (javafx.platform=win/mac/linux)
52+
`mvn -Djavafx.platform=win -Dmaven.test.skip=true -Pzip package`
5153

5254
# 集成构建
5355

qe/config/zip.xml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
<!--
2+
~ Copyright (c) 2025 unknowIfGuestInDream.
3+
~ All rights reserved.
4+
~
5+
~ Redistribution and use in source and binary forms, with or without
6+
~ modification, are permitted provided that the following conditions are met:
7+
~ * Redistributions of source code must retain the above copyright
8+
~ notice, this list of conditions and the following disclaimer.
9+
~ * Redistributions in binary form must reproduce the above copyright
10+
~ notice, this list of conditions and the following disclaimer in the
11+
~ documentation and/or other materials provided with the distribution.
12+
~ * Neither the name of unknowIfGuestInDream, any associated website, nor the
13+
~ names of its contributors may be used to endorse or promote products
14+
~ derived from this software without specific prior written permission.
15+
~
16+
~ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17+
~ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18+
~ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19+
~ DISCLAIMED. IN NO EVENT SHALL UNKNOWIFGUESTINDREAM BE LIABLE FOR ANY
20+
~ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21+
~ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22+
~ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23+
~ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24+
~ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25+
~ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26+
-->
27+
28+
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
29+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
30+
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
31+
<id>zip</id>
32+
<formats>
33+
<format>zip</format>
34+
</formats>
35+
<baseDirectory>/</baseDirectory>
36+
<includeBaseDirectory>false</includeBaseDirectory>
37+
<fileSets>
38+
<fileSet>
39+
<directory>${project.build.directory}</directory>
40+
<useDefaultExcludes>true</useDefaultExcludes>
41+
<outputDirectory>/</outputDirectory>
42+
<includes>
43+
<include>${project.build.finalName}.jar</include>
44+
<include>lib/*</include>
45+
<include>license/*</include>
46+
<include>CHANGELOG.md</include>
47+
</includes>
48+
</fileSet>
49+
<fileSet>
50+
<directory>${project.build.directory}/reports</directory>
51+
<useDefaultExcludes>true</useDefaultExcludes>
52+
<outputDirectory>/</outputDirectory>
53+
<includes>
54+
<include>apidocs/*</include>
55+
</includes>
56+
</fileSet>
57+
<fileSet>
58+
<directory>../</directory>
59+
<useDefaultExcludes>true</useDefaultExcludes>
60+
<outputDirectory>/</outputDirectory>
61+
<includes>
62+
<include>docs/*</include>
63+
</includes>
64+
</fileSet>
65+
<fileSet>
66+
<directory>../jenkins/${javafx.platform}/qe</directory>
67+
<useDefaultExcludes>true</useDefaultExcludes>
68+
<outputDirectory>/</outputDirectory>
69+
<includes>
70+
<include>*</include>
71+
</includes>
72+
</fileSet>
73+
</fileSets>
74+
</assembly>

qe/pom.xml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,4 +235,68 @@
235235
</plugin>
236236
</plugins>
237237
</build>
238+
239+
<profiles>
240+
<profile>
241+
<id>zip</id>
242+
<properties>
243+
<!-- win/mac/linux -->
244+
<javafx.platform>win</javafx.platform>
245+
</properties>
246+
<build>
247+
<plugins>
248+
<plugin>
249+
<groupId>org.apache.maven.plugins</groupId>
250+
<artifactId>maven-assembly-plugin</artifactId>
251+
<configuration>
252+
<appendAssemblyId>false</appendAssemblyId>
253+
<finalName>qeTool-${javafx.platform}</finalName>
254+
<descriptors>
255+
<descriptor>config/zip.xml</descriptor>
256+
</descriptors>
257+
</configuration>
258+
<executions>
259+
<execution>
260+
<id>make-assembly</id>
261+
<phase>package</phase>
262+
<goals>
263+
<goal>single</goal>
264+
</goals>
265+
</execution>
266+
</executions>
267+
</plugin>
268+
<plugin>
269+
<groupId>org.apache.maven.plugins</groupId>
270+
<artifactId>maven-antrun-plugin</artifactId>
271+
<dependencies>
272+
<dependency>
273+
<groupId>commons-codec</groupId>
274+
<artifactId>commons-codec</artifactId>
275+
<version>${commons-codec.version}</version>
276+
</dependency>
277+
</dependencies>
278+
<executions>
279+
<execution>
280+
<id>generate-zip-sha256</id>
281+
<phase>package</phase>
282+
<goals>
283+
<goal>run</goal>
284+
</goals>
285+
<configuration>
286+
<target>
287+
<checksum algorithm="SHA-256"
288+
file="${project.build.directory}/qeTool-${javafx.platform}.zip"
289+
property="file.sha256"/>
290+
<!--suppress UnresolvedMavenProperty -->
291+
<echo file="${project.build.directory}/qeTool-${javafx.platform}.zip.sha256"
292+
message="${file.sha256}"/>
293+
</target>
294+
</configuration>
295+
</execution>
296+
</executions>
297+
</plugin>
298+
</plugins>
299+
</build>
300+
</profile>
301+
</profiles>
238302
</project>

smc/config/zip.xml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
<!--
2+
~ Copyright (c) 2025 unknowIfGuestInDream.
3+
~ All rights reserved.
4+
~
5+
~ Redistribution and use in source and binary forms, with or without
6+
~ modification, are permitted provided that the following conditions are met:
7+
~ * Redistributions of source code must retain the above copyright
8+
~ notice, this list of conditions and the following disclaimer.
9+
~ * Redistributions in binary form must reproduce the above copyright
10+
~ notice, this list of conditions and the following disclaimer in the
11+
~ documentation and/or other materials provided with the distribution.
12+
~ * Neither the name of unknowIfGuestInDream, any associated website, nor the
13+
~ names of its contributors may be used to endorse or promote products
14+
~ derived from this software without specific prior written permission.
15+
~
16+
~ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17+
~ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18+
~ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19+
~ DISCLAIMED. IN NO EVENT SHALL UNKNOWIFGUESTINDREAM BE LIABLE FOR ANY
20+
~ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21+
~ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22+
~ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23+
~ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24+
~ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25+
~ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26+
-->
27+
28+
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
29+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
30+
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
31+
<id>zip</id>
32+
<formats>
33+
<format>zip</format>
34+
</formats>
35+
<baseDirectory>/</baseDirectory>
36+
<includeBaseDirectory>false</includeBaseDirectory>
37+
<fileSets>
38+
<fileSet>
39+
<directory>${project.build.directory}</directory>
40+
<useDefaultExcludes>true</useDefaultExcludes>
41+
<outputDirectory>/</outputDirectory>
42+
<includes>
43+
<include>${project.build.finalName}.jar</include>
44+
<include>lib/*</include>
45+
<include>license/*</include>
46+
<include>CHANGELOG.md</include>
47+
</includes>
48+
</fileSet>
49+
<fileSet>
50+
<directory>${project.build.directory}/reports</directory>
51+
<useDefaultExcludes>true</useDefaultExcludes>
52+
<outputDirectory>/</outputDirectory>
53+
<includes>
54+
<include>apidocs/*</include>
55+
</includes>
56+
</fileSet>
57+
<fileSet>
58+
<directory>../</directory>
59+
<useDefaultExcludes>true</useDefaultExcludes>
60+
<outputDirectory>/</outputDirectory>
61+
<includes>
62+
<include>docs/*</include>
63+
</includes>
64+
</fileSet>
65+
<fileSet>
66+
<directory>../jenkins/${javafx.platform}/smc</directory>
67+
<useDefaultExcludes>true</useDefaultExcludes>
68+
<outputDirectory>/</outputDirectory>
69+
<includes>
70+
<include>*</include>
71+
</includes>
72+
</fileSet>
73+
</fileSets>
74+
</assembly>

smc/pom.xml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,5 +309,66 @@
309309
</plugins>
310310
</build>
311311
</profile>
312+
<profile>
313+
<id>zip</id>
314+
<properties>
315+
<!-- win/mac/linux -->
316+
<javafx.platform>win</javafx.platform>
317+
</properties>
318+
<build>
319+
<plugins>
320+
<plugin>
321+
<groupId>org.apache.maven.plugins</groupId>
322+
<artifactId>maven-assembly-plugin</artifactId>
323+
<configuration>
324+
<appendAssemblyId>false</appendAssemblyId>
325+
<finalName>smcTool-${javafx.platform}</finalName>
326+
<descriptors>
327+
<descriptor>config/zip.xml</descriptor>
328+
</descriptors>
329+
</configuration>
330+
<executions>
331+
<execution>
332+
<id>make-assembly</id>
333+
<phase>package</phase>
334+
<goals>
335+
<goal>single</goal>
336+
</goals>
337+
</execution>
338+
</executions>
339+
</plugin>
340+
<plugin>
341+
<groupId>org.apache.maven.plugins</groupId>
342+
<artifactId>maven-antrun-plugin</artifactId>
343+
<dependencies>
344+
<dependency>
345+
<groupId>commons-codec</groupId>
346+
<artifactId>commons-codec</artifactId>
347+
<version>${commons-codec.version}</version>
348+
</dependency>
349+
</dependencies>
350+
<executions>
351+
<execution>
352+
<id>generate-zip-sha256</id>
353+
<phase>package</phase>
354+
<goals>
355+
<goal>run</goal>
356+
</goals>
357+
<configuration>
358+
<target>
359+
<checksum algorithm="SHA-256"
360+
file="${project.build.directory}/smcTool-${javafx.platform}.zip"
361+
property="file.sha256"/>
362+
<!--suppress UnresolvedMavenProperty -->
363+
<echo file="${project.build.directory}/smcTool-${javafx.platform}.zip.sha256"
364+
message="${file.sha256}"/>
365+
</target>
366+
</configuration>
367+
</execution>
368+
</executions>
369+
</plugin>
370+
</plugins>
371+
</build>
372+
</profile>
312373
</profiles>
313374
</project>

0 commit comments

Comments
 (0)