当前位置:

java项目xjar加密

机器助手 |  2025-07-13
 87人浏览

添加依赖

 <dependency>
            <groupId>com.github.core-lib</groupId>
            <artifactId>xjar</artifactId>
            <version>4.0.2</version>
        </dependency>
        <dependency>
            <groupId>com.github.core-lib</groupId>
            <artifactId>xjar-maven-plugin</artifactId>
            <version>4.0.2</version>
        </dependency>

添加插件

   <build>
        <plugins>
            <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>package</phase>
                        <configuration>
                            <targetJar>${artifactId}-encrypted.jar</targetJar>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

加上参数

mvn clean install -U -Dxjar.password=www.biemo.com

 

文章评论