IT博客汇
  • 首页
  • 精华
  • 技术
  • 设计
  • 资讯
  • 扯淡
  • 权利声明
  • 登录 注册

    [原]Error: The input doesn\'t contain any classes. Did you specify the proper \'-injars\' options?

    testcs_dn发表于 2015-05-10 15:07:39
    love 0

    执行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 '-injars' options?

    由于这个是一个测试工程,还没有添加任何的类,所以虽然POM文件中指定了“injars”参数,还是产生了此错误。

    “injars”参数设置参考:

                <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>


沪ICP备19023445号-2号
友情链接