Java.io.IOException:The input doesn ' t contain any classes. Did you specify the proper '-injars ' opt

Source: Internet
Author: User

Problem Scenario

When confusing with the MAVEN + Proguard packaging project, the following errors are prompted:

version4.4doesn‘t containthe proper ‘-injars‘ options? [proguard]     at proguard.InputReader.execute(InputReader.java:91) [proguard]     at proguard.ProGuard.readInput(ProGuard.java:195) [proguard]     at proguard.ProGuard.execute(ProGuard.java:78) [proguard]     at proguard.ProGuard.main(ProGuard.java:499)
Problem analysis

Missing Injars configuration item!
-injars {Class_path} specifies the application jar,war,ear and directory to be processed

Solution Solutions

Add the Injars configuration item, because it is a Web project, so the war is specified here

<injar>${project.build.finalName}.war</injar>

Complete Example:

            <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>                    <obfuscate>True</obfuscate>                    <proguardinclude>${basedir}/proguard.conf</proguardinclude>                    <!--add dependencies, here you can modify as you need--                    <libs>                        <lib>${java.home}/lib/rt.jar</lib>                        <lib>Lib/jsp-api.jar</lib>                        <lib>Lib/servlet-api.jar</lib>                    </libs>                    <addmavendescriptor>False</addmavendescriptor>                    <Injar>${project.build.finalname}.war</Injar>                    <Outjar>${project.build.finalname}-pg.war</Outjar>                    <outputdirectory>${project.build.directory}</outputdirectory>                </configuration>                <dependencies>                     <!--using version 4.4 to confuse -                    <dependency>                        <groupId>Net.sf.proguard</groupId>                        <artifactid>Proguard</artifactid>                          <version>4.4</version>                        <scope>Runtime</Scope>                    </Dependency>                </dependencies>            </plugin>

Java.io.IOException:The input doesn ' t contain any classes. Did you specify the proper '-injars ' opt

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.