Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to obfuscate one jar from war using proguard and maven
    primarykey
    data
    text
    <p>I'm a little puzzled by proguard. I have this setting in my pom.xml Firstly, &lt; injar > tag doesn't work...final call of proguard doesn't contain -injars if I use this tag. Secondly, I'm not sure if it's possible to obfuscate only one jar that takes place in WEB-INF/lib(I compile all my code in the one jar) and filter every other libs.</p> <pre><code>&lt;plugin&gt; &lt;groupId&gt;com.pyx4me&lt;/groupId&gt; &lt;artifactId&gt;proguard-maven-plugin&lt;/artifactId&gt; &lt;version&gt;2.0.4&lt;/version&gt; &lt;executions&gt; &lt;execution&gt; &lt;phase&gt;package&lt;/phase&gt; &lt;goals&gt; &lt;goal&gt;proguard&lt;/goal&gt; &lt;/goals&gt; &lt;/execution&gt; &lt;/executions&gt; &lt;configuration&gt; &lt;proguardVersion&gt;4.8&lt;/proguardVersion&gt; &lt;obfuscate&gt;true&lt;/obfuscate&gt; &lt;maxMemory&gt;1024m&lt;/maxMemory&gt; &lt;includeDependency&gt;false&lt;/includeDependency&gt; &lt;options&gt; &lt;option&gt;-injars target/Test.war&lt;/option&gt; &lt;option&gt;-ignorewarnings&lt;/option&gt; &lt;/options&gt; &lt;outjar&gt;target/Test-obf.war&lt;/outjar&gt; &lt;attach&gt;false&lt;/attach&gt; &lt;outputDirectory&gt;${project.build.directory}&lt;/outputDirectory&gt; &lt;proguardInclude&gt;${basedir}\proguard.conf&lt;/proguardInclude&gt; &lt;libs&gt; &lt;lib&gt;${java.home}/lib/rt.jar&lt;/lib&gt; &lt;/libs&gt; &lt;addMavenDescriptor&gt;false&lt;/addMavenDescriptor&gt; &lt;skip&gt;false&lt;/skip&gt; &lt;/configuration&gt; &lt;dependencies&gt; &lt;dependency&gt; &lt;groupId&gt;net.sf.proguard&lt;/groupId&gt; &lt;artifactId&gt;proguard&lt;/artifactId&gt; &lt;version&gt;4.4&lt;/version&gt; &lt;scope&gt;runtime&lt;/scope&gt; &lt;/dependency&gt; &lt;/dependencies&gt; &lt;/plugin&gt; </code></pre> <p>With that configuration I have a lot of warnings cause it seems that proguard tries to obfuscate every jar in WEB-INF/lib Could someone spread the light on that. Thank you in advance.</p> <p><strong>Added:</strong> The problem with output that stands in front of all parameters was very tricky for me. As I understood you should not use ${basedir} when you specify both injars and outjars in pom.xml. Cause ${basedir} turns to absolute path and intenaly proguard also put an absolute path.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload