Proguard-whyareyoukeeping的输出在哪里?

时间:2014-10-14 18:15:27

标签: java eclipse maven proguard m2eclipse

我正在使用Eclipse Luna Service Release 1(4.4.1 build id 20140925-1800)和M2E for Maven。我想知道保留a.company.Clazz的原因。我在配置中添加了<option>-whyareyoukeeping class a.company.Clazz</option>(见下文)。 Eclipse Console显示输出(见下文)。执行暂停在Explaining why classes and class members are being kept...,但没有任何内容输出到控制台。

我使用Sysinternal's Process Monitor来查看是否有任何输出转到文件。我看到输出被写入...\target\proguard_seeds.txt...\target\glass.jar,但这些都不包含保留a.company.Clazz的原因。

配置

...

      <plugin>
        <groupId>com.github.wvengen</groupId>
        <artifactId>proguard-maven-plugin</artifactId>
        <version>2.0.8</version>
        ...
        <configuration>
          <proguardVersion>5.0</proguardVersion>
          <injar>${project.build.finalName}.jar</injar>
          <outjar>glass.jar</outjar>
          <includeDependency>true</includeDependency>
          <obfuscate>false</obfuscate>
          <options>
            <option>-verbose</option>
            <option>-whyareyoukeeping class a.company.Clazz</option>
            <option>-dontnote</option>
            <option>-dontoptimize</option>
            ...
          </options>
          ...
        </configuration>
      </plugin>

...

输出

...

 [proguard] Printing kept classes, fields, and methods...
 [proguard] Shrinking...
 [proguard] Explaining why classes and class members are being kept...
 [proguard] 
 [proguard] Removing unused program classes and class elements...
 [proguard]   Original number of program classes: 1988
 [proguard]   Final number of program classes:    136
 [proguard] Inlining subroutines...
 [proguard] Preverifying...
 [proguard] Writing output...

...

1 个答案:

答案 0 :(得分:1)

如果没有保留课程或课程甚至不存在,Proguard不会输出任何内容。