Created
September 24, 2016 11:46
-
-
Save mikroskeem/8a6ecaa21742ee18686fc07563b6459a to your computer and use it in GitHub Desktop.
Obfuscate with yGuard in Maven
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<plugin> | |
<artifactId>maven-antrun-plugin</artifactId> | |
<version>1.8</version> | |
<executions> | |
<execution> | |
<phase>package</phase> | |
<goals> | |
<goal>run</goal> | |
</goals> | |
<configuration> | |
<tasks> | |
<property refid="maven.compile.classpath" name="mvn.classpath"></property> | |
<taskdef name="yguard" classname="com.yworks.yguard.YGuardTask" | |
classpath="lib/yguard.jar"/> | |
<yguard> | |
<inoutpair in="${project.build.directory}/${project.build.finalName}.jar" | |
out="${project.build.directory}/${project.build.finalName}.jar" /> | |
<rename logfile="${project.build.directory}/yguard.log.xml" | |
replaceClassNameStrings="true"> | |
<property name="obfuscation-prefix" value="new.target.package"/> | |
<keep> | |
<class classes="private" methods="private" fields="private"> | |
<patternset> | |
<include name="class.to.keep"/> | |
</patternset> | |
</class> | |
</keep> | |
</rename> | |
<externalclasses> | |
<pathelement path="${mvn.classpath}" /> | |
</externalclasses> | |
</yguard> | |
</tasks> | |
</configuration> | |
</execution> | |
</executions> | |
</plugin> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment