Mohasin Mujawar
Mohasin Mujawar

Reputation: 130

proguard : Error: Expecting keyword 'class', 'interface', or 'enum' before '-dontwarn' in argument number 208

I am novice I don't know how to use proguard to optimize code I am digging on google I implement it with my maven java Desktop Application which in swing . but now it show me above Exception .. I don't know how to solve it ...need help . POM.XML

    <plugin>
        <groupId>com.github.wvengen</groupId>
        <artifactId>proguard-maven-plugin</artifactId>
        <version>2.0.6</version>
        <executions>
            <execution>
                <phase>package</phase>
                <goals>
                    <goal>proguard</goal>
                </goals>
            </execution>
        </executions>
        <configuration>
            <proguardVersion>5.0</proguardVersion>
            <obfuscate>true</obfuscate>
            <injar>${project.build.finalName}.jar</injar>
            <outjar>${project.build.finalName}-small.jar</outjar>

            <outputDirectory>${project.build.directory}</outputDirectory>
            <proguardInclude>${basedir}/config.pro</proguardInclude>
                                <proguardInclude>${basedir}/proguard.conf</proguardInclude>
            <libs>
                <lib>${java.home}/lib/rt.jar</lib>
                <lib>${java.home}/lib/jsse.jar</lib>
            </libs>
             <options>
                  <option>-keepclasseswithmembers</option>
                  <option>-dontwarn</option>
             </options>
        </configuration>
        <dependencies>
            <dependency>
                <groupId>net.sf.proguard</groupId>
                <artifactId>proguard-base</artifactId>
                <version>5.0</version>
                <scope>runtime</scope>
            </dependency>
        </dependencies>
    </plugin>

Upvotes: 1

Views: 1095

Answers (1)

P. Pandey
P. Pandey

Reputation: 108

-keepclasseswithmembers expects more args thats why you are getting error. here is correct syntax -

-keepclasseswithmembers class_specification

you can find usage here

Upvotes: 2

Related Questions