Java 8 Yguard 3.1.0 POM配置问题,JAR是在目标文件夹中生成的,但是未生成混淆的JAR?

发布于 2025-02-04 05:32:13 字数 7193 浏览 2 评论 0原文

我试图通过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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

变身佩奇 2025-02-11 05:32:13

您的&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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文