- 配置 XJar加密依赖
- 在pom.xml文件配置XJar加密依赖
点击查看代码
<!--反编译依赖类-->
<pluginRepositories>
<pluginRepository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</pluginRepository>
</pluginRepositories>
<configuration>
<!--修改打包类型-->
<layout>JAR</layout>
</configuration>
<!--反编译安装包生成路径-->
<plugin>
<groupId>com.github.core-lib</groupId>
<artifactId>xjar-maven-plugin</artifactId>
<version>4.0.2</version>
<executions>
<execution>
<goals>
<goal>build</goal>
</goals>
<phase>install</phase>
<configuration>
<password>7788995</password>
<sourceDir>target/</sourceDir>
<sourceJar>test.jar</sourceJar>
<targetDir>../Test</targetDir>
<targetJar>test.jar</targetJar>
</configuration>
</execution>
</executions>
</plugin>
点击查看代码
@echo off
:again
cd /d "%~dp0"
SET pwddir=%cd%
cd /d %pwddir%\Test
go build xjar.go
mv xjar.exe boot.exe
rm -rf logs xjar*
pause
- 启动服务
点击查看代码
@echo off
cd /D %~dp0
set currentPath=%~dp0
set path=%currentPath%\boot.exe
set SRVNAME=test
install %SRVNAME% %path% ..\jre\bin\java.exe -Xmx512m -jar test.jar
sc start %SRVNAME% > nul
pause