450 lines
24 KiB
XML
450 lines
24 KiB
XML
<?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>
|
||
|
||
<parent>
|
||
<groupId>me.sashegdev</groupId>
|
||
<artifactId>ZernMCLauncher</artifactId>
|
||
<version>${revision}</version>
|
||
</parent>
|
||
|
||
<artifactId>zernmclauncher</artifactId>
|
||
<packaging>jar</packaging>
|
||
|
||
<name>ZernMC Launcher</name>
|
||
<description>Main launcher module with JFX UI</description>
|
||
|
||
<dependencies>
|
||
<!-- HTTP Client -->
|
||
<dependency>
|
||
<groupId>org.apache.httpcomponents</groupId>
|
||
<artifactId>httpclient</artifactId>
|
||
</dependency>
|
||
|
||
<!-- JSON -->
|
||
<dependency>
|
||
<groupId>com.fasterxml.jackson.core</groupId>
|
||
<artifactId>jackson-databind</artifactId>
|
||
</dependency>
|
||
<dependency>
|
||
<groupId>com.google.code.gson</groupId>
|
||
<artifactId>gson</artifactId>
|
||
</dependency>
|
||
<dependency>
|
||
<groupId>org.json</groupId>
|
||
<artifactId>json</artifactId>
|
||
</dependency>
|
||
|
||
<!-- Console/Terminal -->
|
||
<dependency>
|
||
<groupId>org.fusesource.jansi</groupId>
|
||
<artifactId>jansi</artifactId>
|
||
</dependency>
|
||
<dependency>
|
||
<groupId>org.jline</groupId>
|
||
<artifactId>jline</artifactId>
|
||
</dependency>
|
||
<dependency>
|
||
<groupId>me.tongfei</groupId>
|
||
<artifactId>progressbar</artifactId>
|
||
</dependency>
|
||
|
||
<!-- IO -->
|
||
<dependency>
|
||
<groupId>commons-io</groupId>
|
||
<artifactId>commons-io</artifactId>
|
||
</dependency>
|
||
|
||
<!-- JavaFX - Windows -->
|
||
<dependency>
|
||
<groupId>org.openjfx</groupId>
|
||
<artifactId>javafx-controls</artifactId>
|
||
<version>23.0.1</version>
|
||
<classifier>win</classifier>
|
||
<scope>provided</scope>
|
||
</dependency>
|
||
<dependency>
|
||
<groupId>org.openjfx</groupId>
|
||
<artifactId>javafx-web</artifactId>
|
||
<version>23.0.1</version>
|
||
<classifier>win</classifier>
|
||
<scope>provided</scope>
|
||
</dependency>
|
||
<dependency>
|
||
<groupId>org.openjfx</groupId>
|
||
<artifactId>javafx-graphics</artifactId>
|
||
<version>23.0.1</version>
|
||
<classifier>win</classifier>
|
||
<scope>provided</scope>
|
||
</dependency>
|
||
<dependency>
|
||
<groupId>org.openjfx</groupId>
|
||
<artifactId>javafx-base</artifactId>
|
||
<version>23.0.1</version>
|
||
<classifier>win</classifier>
|
||
<scope>provided</scope>
|
||
</dependency>
|
||
<dependency>
|
||
<groupId>org.openjfx</groupId>
|
||
<artifactId>javafx-media</artifactId>
|
||
<version>23.0.1</version>
|
||
<classifier>win</classifier>
|
||
<scope>provided</scope>
|
||
</dependency>
|
||
|
||
<!-- Test -->
|
||
<dependency>
|
||
<groupId>org.junit.jupiter</groupId>
|
||
<artifactId>junit-jupiter</artifactId>
|
||
<version>5.10.1</version>
|
||
<scope>test</scope>
|
||
</dependency>
|
||
</dependencies>
|
||
|
||
<build>
|
||
<resources>
|
||
<resource>
|
||
<directory>src/resources</directory>
|
||
<targetPath>assets</targetPath>
|
||
<includes>
|
||
<include>ui/**</include>
|
||
</includes>
|
||
</resource>
|
||
</resources>
|
||
<plugins>
|
||
<plugin>
|
||
<groupId>org.apache.maven.plugins</groupId>
|
||
<artifactId>maven-shade-plugin</artifactId>
|
||
<version>3.5.0</version>
|
||
<executions>
|
||
<execution>
|
||
<phase>package</phase>
|
||
<goals>
|
||
<goal>shade</goal>
|
||
</goals>
|
||
<configuration>
|
||
<outputFile>../../server/builds/zernmclauncher.jar</outputFile>
|
||
<transformers>
|
||
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
|
||
<mainClass>me.sashegdev.zernmc.launcher.Main</mainClass>
|
||
<manifestEntries>
|
||
<Implementation-Version>${project.version}.${hotfix}</Implementation-Version>
|
||
<Implementation-Title>ZernMC Launcher</Implementation-Title>
|
||
</manifestEntries>
|
||
</transformer>
|
||
</transformers>
|
||
</configuration>
|
||
</execution>
|
||
</executions>
|
||
</plugin>
|
||
|
||
<!-- Launch4j для создания .exe из bootstrap JAR -->
|
||
<plugin>
|
||
<groupId>com.akathist.maven.plugins.launch4j</groupId>
|
||
<artifactId>launch4j-maven-plugin</artifactId>
|
||
<version>2.5.0</version>
|
||
<executions>
|
||
<!-- GUI версия (основная) - без консоли -->
|
||
<execution>
|
||
<id>l4j-gui</id>
|
||
<phase>package</phase>
|
||
<goals>
|
||
<goal>launch4j</goal>
|
||
</goals>
|
||
<configuration>
|
||
<outfile>../../server/builds/zernmc.exe</outfile>
|
||
<jar>../../server/builds/zernmc-bootstrap.jar</jar>
|
||
<icon>${project.basedir}/src/main/icons/zernmc.ico</icon>
|
||
<headerType>gui</headerType>
|
||
<dontWrapJar>false</dontWrapJar>
|
||
<classPath>
|
||
<mainClass>me.sashegdev.zernmc.launcher.Bootstrap</mainClass>
|
||
<addDependencies>false</addDependencies>
|
||
</classPath>
|
||
<cmdLine>--jfx</cmdLine>
|
||
<jre>
|
||
<path>lib/jre21</path>
|
||
<minVersion>21</minVersion>
|
||
</jre>
|
||
<versionInfo>
|
||
<fileVersion>${project.version}.${hotfix}</fileVersion>
|
||
<txtFileVersion>${project.version}.${hotfix}</txtFileVersion>
|
||
<fileDescription>ZernMC Launcher</fileDescription>
|
||
<copyright>Copyright (c) 2023-2026 ZernMC</copyright>
|
||
<productVersion>${project.version}.${hotfix}</productVersion>
|
||
<txtProductVersion>${project.version}.${hotfix}</txtProductVersion>
|
||
<productName>ZernMC</productName>
|
||
<companyName>ZernMC</companyName>
|
||
<trademarks>ZernMC</trademarks>
|
||
<internalName>zernmc</internalName>
|
||
<originalFilename>zernmc.exe</originalFilename>
|
||
</versionInfo>
|
||
</configuration>
|
||
</execution>
|
||
|
||
<!-- CLI версия - с консолью -->
|
||
<execution>
|
||
<id>l4j-cli</id>
|
||
<phase>package</phase>
|
||
<goals>
|
||
<goal>launch4j</goal>
|
||
</goals>
|
||
<configuration>
|
||
<outfile>../../server/builds/zernmc-cli.exe</outfile>
|
||
<jar>../../server/builds/zernmc-bootstrap.jar</jar>
|
||
<headerType>console</headerType>
|
||
<dontWrapJar>false</dontWrapJar>
|
||
<classPath>
|
||
<mainClass>me.sashegdev.zernmc.launcher.Bootstrap</mainClass>
|
||
<addDependencies>false</addDependencies>
|
||
</classPath>
|
||
<cmdLine>--cli</cmdLine>
|
||
<jre>
|
||
<path>lib/jre21</path>
|
||
<minVersion>21</minVersion>
|
||
</jre>
|
||
<versionInfo>
|
||
<fileVersion>${project.version}.${hotfix}</fileVersion>
|
||
<txtFileVersion>${project.version}.${hotfix}</txtFileVersion>
|
||
<fileDescription>ZernMC Launcher CLI</fileDescription>
|
||
<copyright>Copyright (c) 2023-2026 ZernMC</copyright>
|
||
<productVersion>${project.version}.${hotfix}</productVersion>
|
||
<txtProductVersion>${project.version}.${hotfix}</txtProductVersion>
|
||
<productName>ZernMC CLI</productName>
|
||
<companyName>ZernMC</companyName>
|
||
<trademarks>ZernMC</trademarks>
|
||
<internalName>zernmc-cli</internalName>
|
||
<originalFilename>zernmc-cli.exe</originalFilename>
|
||
</versionInfo>
|
||
</configuration>
|
||
</execution>
|
||
|
||
<!-- CLI+JFX версия: консоль видима + форсим JFX UI -->
|
||
<execution>
|
||
<id>l4j-cli-jfx</id>
|
||
<phase>package</phase>
|
||
<goals>
|
||
<goal>launch4j</goal>
|
||
</goals>
|
||
<configuration>
|
||
<outfile>../../server/builds/zernmc-cli-jfx.exe</outfile>
|
||
<jar>../../server/builds/zernmc-bootstrap.jar</jar>
|
||
<headerType>console</headerType>
|
||
<dontWrapJar>false</dontWrapJar>
|
||
<classPath>
|
||
<mainClass>me.sashegdev.zernmc.launcher.Bootstrap</mainClass>
|
||
<addDependencies>false</addDependencies>
|
||
</classPath>
|
||
<cmdLine>--jfx</cmdLine>
|
||
<jre>
|
||
<path>lib/jre21</path>
|
||
<minVersion>21</minVersion>
|
||
</jre>
|
||
<versionInfo>
|
||
<fileVersion>${project.version}.${hotfix}</fileVersion>
|
||
<txtFileVersion>${project.version}.${hotfix}</txtFileVersion>
|
||
<fileDescription>ZernMC Launcher CLI + JFX</fileDescription>
|
||
<copyright>Copyright (c) 2023-2026 ZernMC</copyright>
|
||
<productVersion>${project.version}.${hotfix}</productVersion>
|
||
<txtProductVersion>${project.version}.${hotfix}</txtProductVersion>
|
||
<productName>ZernMC CLI JFX</productName>
|
||
<companyName>ZernMC</companyName>
|
||
<trademarks>ZernMC</trademarks>
|
||
<internalName>zernmc-cli-jfx</internalName>
|
||
<originalFilename>zernmc-cli-jfx.exe</originalFilename>
|
||
</versionInfo>
|
||
</configuration>
|
||
</execution>
|
||
</executions>
|
||
</plugin>
|
||
|
||
<!-- Post-build: копирование JRE и создание ZIP -->
|
||
<plugin>
|
||
<groupId>org.apache.maven.plugins</groupId>
|
||
<artifactId>maven-antrun-plugin</artifactId>
|
||
<version>3.1.0</version>
|
||
<executions>
|
||
<execution>
|
||
<phase>package</phase>
|
||
<goals><goal>run</goal></goals>
|
||
<configuration>
|
||
<target>
|
||
<echo file="../../server/builds/build.version">${project.version}.${hotfix}</echo>
|
||
|
||
<!-- Удаляем старую папку lib если есть -->
|
||
<delete dir="../../server/builds/lib"/>
|
||
|
||
<!-- Создаем папку lib -->
|
||
<mkdir dir="../../server/builds/lib"/>
|
||
|
||
<!-- Копируем JRE в lib/jre21 -->
|
||
<copy todir="../../server/builds/lib/jre21" overwrite="true">
|
||
<fileset dir="${user.home}/launcher/jre/jre21">
|
||
<include name="*"/>
|
||
<include name="**/*"/>
|
||
</fileset>
|
||
</copy>
|
||
|
||
<!-- Копируем JavaFX модули в lib/javafx -->
|
||
<mkdir dir="../../server/builds/lib/javafx"/>
|
||
<copy todir="../../server/builds/lib/javafx" overwrite="true">
|
||
<fileset dir="${user.home}/.m2/repository/org/openjfx/javafx-controls/23.0.1">
|
||
<include name="*win.jar"/>
|
||
</fileset>
|
||
</copy>
|
||
<copy todir="../../server/builds/lib/javafx" overwrite="true">
|
||
<fileset dir="${user.home}/.m2/repository/org/openjfx/javafx-graphics/23.0.1">
|
||
<include name="*win.jar"/>
|
||
</fileset>
|
||
</copy>
|
||
<copy todir="../../server/builds/lib/javafx" overwrite="true">
|
||
<fileset dir="${user.home}/.m2/repository/org/openjfx/javafx-base/23.0.1">
|
||
<include name="*win.jar"/>
|
||
</fileset>
|
||
</copy>
|
||
<copy todir="../../server/builds/lib/javafx" overwrite="true">
|
||
<fileset dir="${user.home}/.m2/repository/org/openjfx/javafx-web/23.0.1">
|
||
<include name="*win.jar"/>
|
||
</fileset>
|
||
</copy>
|
||
<copy todir="../../server/builds/lib/javafx" overwrite="true">
|
||
<fileset dir="${user.home}/.m2/repository/org/openjfx/javafx-media/23.0.1">
|
||
<include name="*win.jar"/>
|
||
</fileset>
|
||
</copy>
|
||
|
||
<!-- Создаем папку bin и копируем JAR -->
|
||
<mkdir dir="../../server/builds/bin"/>
|
||
<copy file="../../server/builds/zernmclauncher.jar"
|
||
tofile="../../server/builds/bin/zernmclauncher.jar" overwrite="true"/>
|
||
|
||
<!-- Копируем UI в assets -->
|
||
<mkdir dir="../../server/builds/assets"/>
|
||
<copy todir="../../server/builds/assets/ui" overwrite="true">
|
||
<fileset dir="${project.basedir}/src/resources/ui">
|
||
<include name="**/*"/>
|
||
</fileset>
|
||
</copy>
|
||
|
||
|
||
<!-- Подпись экзешников самоподписным сертификатом Zern.cc (publisher: ZernMC Launcher) -->
|
||
<loadfile property="pfxpass" srcFile="/root/cert/codesign/.pfxpass">
|
||
<filterchain>
|
||
<striplinebreaks/>
|
||
</filterchain>
|
||
</loadfile>
|
||
|
||
<exec executable="java" failonerror="true">
|
||
<arg value="-jar"/>
|
||
<arg value="${user.home}/tools/jsign/jsign.jar"/>
|
||
<arg value="--keystore"/>
|
||
<arg value="/root/cert/codesign/zerncc.pfx"/>
|
||
<arg value="--storepass"/>
|
||
<arg value="${pfxpass}"/>
|
||
<arg value="--alias"/>
|
||
<arg value="1"/>
|
||
<arg value="--tsaurl"/>
|
||
<arg value="http://timestamp.digicert.com"/>
|
||
<arg value="--alg"/>
|
||
<arg value="SHA-256"/>
|
||
<arg value="../../server/builds/zernmc.exe"/>
|
||
</exec>
|
||
|
||
<exec executable="java" failonerror="true">
|
||
<arg value="-jar"/>
|
||
<arg value="${user.home}/tools/jsign/jsign.jar"/>
|
||
<arg value="--keystore"/>
|
||
<arg value="/root/cert/codesign/zerncc.pfx"/>
|
||
<arg value="--storepass"/>
|
||
<arg value="${pfxpass}"/>
|
||
<arg value="--alias"/>
|
||
<arg value="1"/>
|
||
<arg value="--tsaurl"/>
|
||
<arg value="http://timestamp.digicert.com"/>
|
||
<arg value="--alg"/>
|
||
<arg value="SHA-256"/>
|
||
<arg value="../../server/builds/zernmc-cli.exe"/>
|
||
</exec>
|
||
|
||
<exec executable="java" failonerror="true">
|
||
<arg value="-jar"/>
|
||
<arg value="${user.home}/tools/jsign/jsign.jar"/>
|
||
<arg value="--keystore"/>
|
||
<arg value="/root/cert/codesign/zerncc.pfx"/>
|
||
<arg value="--storepass"/>
|
||
<arg value="${pfxpass}"/>
|
||
<arg value="--alias"/>
|
||
<arg value="1"/>
|
||
<arg value="--tsaurl"/>
|
||
<arg value="http://timestamp.digicert.com"/>
|
||
<arg value="--alg"/>
|
||
<arg value="SHA-256"/>
|
||
<arg value="../../server/builds/zernmc-cli-jfx.exe"/>
|
||
</exec>
|
||
|
||
<!-- Создаём README -->
|
||
<echo file="../../server/builds/README.txt">
|
||
ZernMC Launcher
|
||
|
||
Files:
|
||
- zernmc.exe - Main launcher with GUI (default)
|
||
- zernmc-cli.exe - CLI version (console, architecture-independent)
|
||
- zernmc-cli-jfx.exe - CLI + JFX UI (console visible + JavaFX frontend)
|
||
|
||
How to use:
|
||
Just run zernmc.exe (or zernmc-cli.exe / zernmc-cli-jfx.exe for CLI)
|
||
</echo>
|
||
|
||
<!-- Создаём один архив со всем -->
|
||
<zip destfile="../../server/builds/ZernMC-win-${revision}.${hotfix}.zip"
|
||
basedir="../../server/builds"
|
||
includes="zernmc.exe,zernmc-cli.exe,zernmc-cli-jfx.exe,bin/**,assets/**,lib/**,README.txt"
|
||
excludes="build.version,*.jar"/>
|
||
|
||
<!-- Go online/offline инсталляторы (нативные, без JRE) -->
|
||
<exec executable="bash" failonerror="false">
|
||
<arg value="-c"/>
|
||
<arg value="if command -v go >/dev/null 2>&1; then echo 'Building Go installers...'; mkdir -p ../../server/builds; GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -ldflags='-s -w' -o ../../server/builds/ZernMC-Online-Setup-${revision}.${hotfix}.exe ../../installer 2>&1 || echo 'Go build skipped (no go)'; cp ../../server/builds/ZernMC-Online-Setup-${revision}.${hotfix}.exe ../../server/builds/ZernMC-Offline-Setup-${revision}.${hotfix}.exe 2>/dev/null || true; fi"/>
|
||
</exec>
|
||
|
||
<!-- Подпись Go инсталляторов -->
|
||
<exec executable="java" failonerror="false">
|
||
<arg value="-jar"/>
|
||
<arg value="${user.home}/tools/jsign/jsign.jar"/>
|
||
<arg value="--keystore"/>
|
||
<arg value="/root/cert/codesign/zerncc.pfx"/>
|
||
<arg value="--storepass"/>
|
||
<arg value="${pfxpass}"/>
|
||
<arg value="--alias"/>
|
||
<arg value="1"/>
|
||
<arg value="--tsaurl"/>
|
||
<arg value="http://timestamp.digicert.com"/>
|
||
<arg value="--alg"/>
|
||
<arg value="SHA-256"/>
|
||
<arg value="../../server/builds/ZernMC-Online-Setup-${revision}.${hotfix}.exe"/>
|
||
</exec>
|
||
<exec executable="java" failonerror="false">
|
||
<arg value="-jar"/>
|
||
<arg value="${user.home}/tools/jsign/jsign.jar"/>
|
||
<arg value="--keystore"/>
|
||
<arg value="/root/cert/codesign/zerncc.pfx"/>
|
||
<arg value="--storepass"/>
|
||
<arg value="${pfxpass}"/>
|
||
<arg value="--alias"/>
|
||
<arg value="1"/>
|
||
<arg value="--tsaurl"/>
|
||
<arg value="http://timestamp.digicert.com"/>
|
||
<arg value="--alg"/>
|
||
<arg value="SHA-256"/>
|
||
<arg value="../../server/builds/ZernMC-Offline-Setup-${revision}.${hotfix}.exe"/>
|
||
</exec>
|
||
</target>
|
||
</configuration>
|
||
</execution>
|
||
</executions>
|
||
</plugin>
|
||
</plugins>
|
||
</build>
|
||
</project> |