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

问题场景



在使用Maven + Proguard打包项目进行混淆时,提示以下错误:

[proguard] ProGuard, version 4.4
 [proguard] Reading input...
 [proguard] java.io.IOException: The input doesn‘t contain any classes. Did you specify the 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)

问题分析



缺少injars配置项!

-injars {class_path} 指定要处理的应用程序jar,war,ear和目录

解决方案



添加injars配置项,由于是Web项目,所以这里指定的是war

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

完整示例:

            <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>
                    <!-- 添加依赖,这里你可以按你的需要修改 -->
                    <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>
                    <!-- 使用4.4版本来混淆 -->
                    <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

时间: 2024-10-12 20:32:15

java.io.IOException: The input doesn't contain any classes. Did you specify the proper '-injars' opt的相关文章

Error: The input doesn&#39;t contain any classes. Did you specify the proper &#39;-injars&#39; options?

执行Maven Install打包的时候,出现以下错误信息: [proguard] ProGuard, version 4.4 [proguard] Reading program war [F:\Workspaces\pro-test\target\pro-test-0.0.1-SNAPSHOT.war] (filtered) [proguard] Error: The input doesn't contain any classes. Did you specify the proper

解决Caused by: java.io.IOException: java.io.IOException: error=12, Cannot allocate memory

最近公司一台线上服务器的hbase的regionserver挂掉之后起不起来报错OOM. 这台机器同时装有cassandra,于是停掉cassandra释放内存,重启regionserver失败,同时cassandra再尝试启动也报错Caused by: java.io.IOException: java.io.IOException: error=12, Cannot allocate memory ps -ef发现有很多类似/bin/bash /opt/cloudera-manager/cm

java.io.IOException: The same input jar is specified twice

简介: eclipse android proguard 打包时出现 java.io.IOException: The same input jar is specified twice 错误, 这里给出解决办法 升级到高版本的 android sdk 之后发现 proguard 打包app 时出现The same input jar ***.jar is specified twice 的错误,导致混淆失败无法打包出新版本, 百度google 都不能解决 愁死了. 通过一天的折腾人都要崩溃了,

java.io.IOException: The same input jar [E:\Jre\lib\rt.jar] is specified twice.

执行Maven Install打包的时候,出现以下错误信息: [INFO] proguard jar: E:\maven\mvnRespo\net\sf\proguard\proguard-base\5.2\proguard-base-5.2.jar [proguard] ProGuard, version 5.2 [proguard] java.io.IOException: The same input jar [E:\Jre\lib\rt.jar] is specified twice.

java.io.IOException: java.io.EOFException: Unexpected end of input stream错误

报错现象: Diagnostic Messages for this Task:Error: java.io.IOException: java.io.EOFException: Unexpected end of input stream at org.apache.hadoop.hive.io.HiveIOExceptionHandlerChain.handleRecordReaderNextException(HiveIOExceptionHandlerChain.java:121) at

spark程序异常:Exception in thread &quot;main&quot; java.io.IOException: No FileSystem for scheme: hdfs

命令: java -jar myspark-1.0-SNAPSHOT.jar myspark-1.0-SNAPSHOT.jar hdfs://single:9000/input/word.txt hdfs://single:9000/output/out1 错误信息: .......... 14/11/23 06:14:18 INFO SparkDeploySchedulerBackend: Granted executor ID app-20141123061418-0011/0 on hos

sqoop1.4.5 导入 hive IOException running import job: java.io.IOException: Hive exited with status 1

sqoop 导入 hive hive.HiveImport: Exception in thread "main" java.lang.NoSuchMethodError: org.apache.thrift.EncodingUtils.setBit(BIZ)B ERROR tool.ImportTool: Encountered IOException running import job: java.io.IOException: Hive exited with status 1

hadoop异常 java.io.IOException: Job status not available

[[email protected] conf]$ hadoop jar /usr/lib/hadoop-mapreduce/hadoop-mapreduce-examples.jar wordcount /user/lizeyi/people.txt  /user/lizeyi/wordcount7 15/06/08 18:36:16 INFO client.RMProxy: Connecting to ResourceManager at master.hadoop/10.3.4.35:80

java.io.IOException: Can&#39;t read [[email&#160;protected]] (Can&#39;t process class [WEB-INF/clas

执行Maven Install打包的时候,出现以下错误信息: [proguard] ProGuard, version 4.4 [proguard] Reading input... [proguard] Reading program war [F:\Workspaces\pro-test\target\pro-test-0.0.1-SNAPSHOT.war] (filtered) [proguard] java.io.IOException: Can't read [[email prote