Java 8 Yguard 3.1.0 POM配置问题,JAR是在目标文件夹中生成的,但是未生成混淆的JAR?
我试图通过Yguard使我的课程混淆,这是除Yguard部分以外成功运行的POM。我用他们给出的例子,但没有快乐。这是POM ... 我不确定插件和相位的序列。不确定它是否以正确的顺序完成,我还必须说什么才能发布问题???
<?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>
<groupId>symbology</groupId>
<artifactId>SymbologyStudio</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<name>symbology-studioapp</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt-api</artifactId>
<version>0.10.5</version>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt-impl</artifactId>
<version>0.10.5</version>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt-jackson</artifactId>
<version>0.10.5</version>
</dependency>
<dependency>
<groupId>com.ximpleware</groupId>
<artifactId>vtd-xml</artifactId>
<version>2.11</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.1.1</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.5</version>
</dependency>
<dependency>
<groupId>com.yworks</groupId>
<artifactId>yguard</artifactId>
<version>3.1.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<finalName>Symbology-Studio</finalName>
<plugins>
<plugin>
<groupId>org.symbology</groupId>
<artifactId>appidgenerator</artifactId>
<version>1.0-SNAPSHOT</version>
<executions>
<execution>
<configuration>
<input>${project.basedir}/src/main/resources</input>
<archive>true</archive>
<src>Symbology-Studio-jar-with-dependencies.jar</src>
<directory>C:\symbology\STUDIO-APPS\</directory>
<prefix>SymStudio-</prefix>
<commit>true</commit>
</configuration>
<goals>
<goal>appKeyGenerator</goal>
<goal>appRegister</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>assembly</id>
<goals>
<goal>single</goal>
</goals>
<phase>package</phase>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>org.symbology.app.SymbologyStudio</mainClass>
</manifest>
</archive>
</configuration>
</execution>
</executions>
</plugin>
<!-- https://yworks.github.io/yGuard/setup/ -->
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<id>obfuscate</id>
<configuration>
<tasks>
<property name="runtime_classpath" refid="maven.runtime.classpath"/>
<taskdef name="yguard" classname="com.yworks.yguard.YGuardTask" classpath="${runtime_classpath}"/>
<yguard>
<inoutpair in="C:\Users\Temujinp\Documents\NetbeansProjects\SymbologyClient\target\Symbology-Studio.jar" out="C:\obfuscate\SymbologyClient.jar" />
</yguard>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
I am trying to obfuscate my classes through yguard and this is the pom that runs successfully except for the yguard part. I used the examples they gave but get no joy. Here is the pom ...
I am not sure about the sequence of the plugins and the phases. not sure if it is done in the correct sequence, what else must i say to get the question posted ???
<?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>
<groupId>symbology</groupId>
<artifactId>SymbologyStudio</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<name>symbology-studioapp</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt-api</artifactId>
<version>0.10.5</version>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt-impl</artifactId>
<version>0.10.5</version>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt-jackson</artifactId>
<version>0.10.5</version>
</dependency>
<dependency>
<groupId>com.ximpleware</groupId>
<artifactId>vtd-xml</artifactId>
<version>2.11</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.1.1</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.5</version>
</dependency>
<dependency>
<groupId>com.yworks</groupId>
<artifactId>yguard</artifactId>
<version>3.1.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<finalName>Symbology-Studio</finalName>
<plugins>
<plugin>
<groupId>org.symbology</groupId>
<artifactId>appidgenerator</artifactId>
<version>1.0-SNAPSHOT</version>
<executions>
<execution>
<configuration>
<input>${project.basedir}/src/main/resources</input>
<archive>true</archive>
<src>Symbology-Studio-jar-with-dependencies.jar</src>
<directory>C:\symbology\STUDIO-APPS\</directory>
<prefix>SymStudio-</prefix>
<commit>true</commit>
</configuration>
<goals>
<goal>appKeyGenerator</goal>
<goal>appRegister</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>assembly</id>
<goals>
<goal>single</goal>
</goals>
<phase>package</phase>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>org.symbology.app.SymbologyStudio</mainClass>
</manifest>
</archive>
</configuration>
</execution>
</executions>
</plugin>
<!-- https://yworks.github.io/yGuard/setup/ -->
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<id>obfuscate</id>
<configuration>
<tasks>
<property name="runtime_classpath" refid="maven.runtime.classpath"/>
<taskdef name="yguard" classname="com.yworks.yguard.YGuardTask" classpath="${runtime_classpath}"/>
<yguard>
<inoutpair in="C:\Users\Temujinp\Documents\NetbeansProjects\SymbologyClient\target\Symbology-Studio.jar" out="C:\obfuscate\SymbologyClient.jar" />
</yguard>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的
&lt; yguard&gt;
任务没有有关Yguard应该做的事情的说明。如果您希望Yguard混淆您的课程,至少需要添加行&lt; rename logFile =“ $ {project.build.directory} /yguard.log.xml”/&gt;
有关更多信息,请参见 yguard文档有关更多信息。
Your
<yguard>
task has no instructions on what yGuard is supposed to do. If you want yGuard to obfuscate your classes, at the very least you need to add the line<rename logfile="${project.build.directory}/yguard.log.xml"/>
See the yGuard Documentation for further information.