Skip to content

build: 支持打包zip产物 #2129

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,14 @@ The build commands require the installation and setup of Java 17 or higher and M

# Pack

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

# Integration builds

Expand Down
6 changes: 4 additions & 2 deletions README_jp.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,13 @@ frameとloginは基本モジュールで、Java SPI経由でプラグイン可

# パッケージ化

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

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

Expand Down
6 changes: 4 additions & 2 deletions README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@ frame 和 login 是基础模块, 通过java SPI实现可拔插,方便应用模

# 打包

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

# 集成构建

Expand Down
74 changes: 74 additions & 0 deletions qe/config/zip.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<!--
~ Copyright (c) 2025 unknowIfGuestInDream.
~ All rights reserved.
~
~ Redistribution and use in source and binary forms, with or without
~ modification, are permitted provided that the following conditions are met:
~ * Redistributions of source code must retain the above copyright
~ notice, this list of conditions and the following disclaimer.
~ * Redistributions in binary form must reproduce the above copyright
~ notice, this list of conditions and the following disclaimer in the
~ documentation and/or other materials provided with the distribution.
~ * Neither the name of unknowIfGuestInDream, any associated website, nor the
~ names of its contributors may be used to endorse or promote products
~ derived from this software without specific prior written permission.
~
~ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
~ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
~ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
~ DISCLAIMED. IN NO EVENT SHALL UNKNOWIFGUESTINDREAM BE LIABLE FOR ANY
~ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
~ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
~ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
~ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
~ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
~ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->

<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
<id>zip</id>
<formats>
<format>zip</format>
</formats>
<baseDirectory>/</baseDirectory>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<fileSet>
<directory>${project.build.directory}</directory>
<useDefaultExcludes>true</useDefaultExcludes>
<outputDirectory>/</outputDirectory>
<includes>
<include>${project.build.finalName}.jar</include>
<include>lib/*</include>
<include>license/*</include>
<include>CHANGELOG.md</include>
</includes>
</fileSet>
<fileSet>
<directory>${project.build.directory}/reports</directory>
<useDefaultExcludes>true</useDefaultExcludes>
<outputDirectory>/</outputDirectory>
<includes>
<include>apidocs/*</include>
</includes>
</fileSet>
<fileSet>
<directory>../</directory>
<useDefaultExcludes>true</useDefaultExcludes>
<outputDirectory>/</outputDirectory>
<includes>
<include>docs/*</include>
</includes>
</fileSet>
<fileSet>
<directory>../jenkins/${javafx.platform}/qe</directory>
<useDefaultExcludes>true</useDefaultExcludes>
<outputDirectory>/</outputDirectory>
<includes>
<include>*</include>
</includes>
</fileSet>
</fileSets>
</assembly>
64 changes: 64 additions & 0 deletions qe/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -235,4 +235,68 @@
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>zip</id>
<properties>
<!-- win/mac/linux -->
<javafx.platform>win</javafx.platform>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<finalName>qeTool-${javafx.platform}</finalName>
<descriptors>
<descriptor>config/zip.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<dependencies>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>${commons-codec.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>generate-zip-sha256</id>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<checksum algorithm="SHA-256"
file="${project.build.directory}/qeTool-${javafx.platform}.zip"
property="file.sha256"/>
<!--suppress UnresolvedMavenProperty -->
<echo file="${project.build.directory}/qeTool-${javafx.platform}.zip.sha256"
message="${file.sha256}"/>
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
74 changes: 74 additions & 0 deletions smc/config/zip.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<!--
~ Copyright (c) 2025 unknowIfGuestInDream.
~ All rights reserved.
~
~ Redistribution and use in source and binary forms, with or without
~ modification, are permitted provided that the following conditions are met:
~ * Redistributions of source code must retain the above copyright
~ notice, this list of conditions and the following disclaimer.
~ * Redistributions in binary form must reproduce the above copyright
~ notice, this list of conditions and the following disclaimer in the
~ documentation and/or other materials provided with the distribution.
~ * Neither the name of unknowIfGuestInDream, any associated website, nor the
~ names of its contributors may be used to endorse or promote products
~ derived from this software without specific prior written permission.
~
~ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
~ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
~ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
~ DISCLAIMED. IN NO EVENT SHALL UNKNOWIFGUESTINDREAM BE LIABLE FOR ANY
~ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
~ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
~ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
~ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
~ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
~ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->

<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
<id>zip</id>
<formats>
<format>zip</format>
</formats>
<baseDirectory>/</baseDirectory>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<fileSet>
<directory>${project.build.directory}</directory>
<useDefaultExcludes>true</useDefaultExcludes>
<outputDirectory>/</outputDirectory>
<includes>
<include>${project.build.finalName}.jar</include>
<include>lib/*</include>
<include>license/*</include>
<include>CHANGELOG.md</include>
</includes>
</fileSet>
<fileSet>
<directory>${project.build.directory}/reports</directory>
<useDefaultExcludes>true</useDefaultExcludes>
<outputDirectory>/</outputDirectory>
<includes>
<include>apidocs/*</include>
</includes>
</fileSet>
<fileSet>
<directory>../</directory>
<useDefaultExcludes>true</useDefaultExcludes>
<outputDirectory>/</outputDirectory>
<includes>
<include>docs/*</include>
</includes>
</fileSet>
<fileSet>
<directory>../jenkins/${javafx.platform}/smc</directory>
<useDefaultExcludes>true</useDefaultExcludes>
<outputDirectory>/</outputDirectory>
<includes>
<include>*</include>
</includes>
</fileSet>
</fileSets>
</assembly>
61 changes: 61 additions & 0 deletions smc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -309,5 +309,66 @@
</plugins>
</build>
</profile>
<profile>
<id>zip</id>
<properties>
<!-- win/mac/linux -->
<javafx.platform>win</javafx.platform>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<finalName>smcTool-${javafx.platform}</finalName>
<descriptors>
<descriptor>config/zip.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<dependencies>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>${commons-codec.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>generate-zip-sha256</id>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<checksum algorithm="SHA-256"
file="${project.build.directory}/smcTool-${javafx.platform}.zip"
property="file.sha256"/>
<!--suppress UnresolvedMavenProperty -->
<echo file="${project.build.directory}/smcTool-${javafx.platform}.zip.sha256"
message="${file.sha256}"/>
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Loading