Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9039179
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T09:40:12+00:00 2026-06-16T09:40:12+00:00

I’m a little puzzled by proguard. I have this setting in my pom.xml Firstly,

  • 0

I’m a little puzzled by proguard.
I have this setting in my pom.xml
Firstly, < 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.

<plugin>
        <groupId>com.pyx4me</groupId>
        <artifactId>proguard-maven-plugin</artifactId>
        <version>2.0.4</version>
        <executions>
            <execution>
                <phase>package</phase>
                <goals>
                    <goal>proguard</goal>
                </goals>
            </execution>
        </executions>
        <configuration>
            <proguardVersion>4.8</proguardVersion>
            <obfuscate>true</obfuscate>
            <maxMemory>1024m</maxMemory>
            <includeDependency>false</includeDependency> 
            <options>
                <option>-injars target/Test.war</option>
                <option>-ignorewarnings</option>
            </options>
            <outjar>target/Test-obf.war</outjar> 

            <attach>false</attach>
            <outputDirectory>${project.build.directory}</outputDirectory>
                <proguardInclude>${basedir}\proguard.conf</proguardInclude>
        <libs>
            <lib>${java.home}/lib/rt.jar</lib>
        </libs>
        <addMavenDescriptor>false</addMavenDescriptor>
        <skip>false</skip>
    </configuration>
    <dependencies>
        <dependency>
            <groupId>net.sf.proguard</groupId>
            <artifactId>proguard</artifactId>
            <version>4.4</version>
            <scope>runtime</scope>
        </dependency>
    </dependencies>
</plugin>

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.

Added:
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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T09:40:14+00:00Added an answer on June 16, 2026 at 9:40 am

    First of all, I have never used ProGuard from Maven, only from Ant.

    I compare your configuration file with one in here

     <options>
         <option>-allowaccessmodification</option>
         <option>-keep public class com.degoo.ui.ClientBackendStarter { public *; public static *; }</option>
     </options>
     <injar>${project.build.finalName}.jar</injar>
     <outjar>${project.build.finalName}-small.jar</outjar>
    

    In your case you configure injars and outjar in different manner which is strange to see.

    (I compile all my code in the one jar) and filter every other libs.
    I have a lot of warnings cause it seems that proguard tries to obfuscate every jar in WEB-INF/lib

    In that case warnings come not from the fact that ProGuard tries to compile all the libs, but because when it obfuscates your filtered code it wants to see reference to extarnal libs. See this.

    You would need to add for every external jar referenced in your code

    <lib>path/lib.jar</lib>
    

    This would probably help you to avoid many warning, but the real art start when you configure -keep options.
    I would recommend to start with this configuration https://stackoverflow.com/a/7511926/1360074
    If that works eventually try to get more obfuscation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
In my XML file chapters tag has more chapter tag.i need to display chapters
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
This could be a duplicate question, but I have no idea what search terms
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.