java - Proguard 不在正确的目录中生成类
问题描述
我正在使用 Proguard 优化.war
文件,但它不起作用。我遇到的问题之一是它没有生成它应该生成的类。
在这里,可以看到主类____EntryPoint
并没有放在____embedded
目录下,而是放在了classes.____embedded
,但是程序运行的时候在里面找这个类____embedded
,所以失败了。
这只是我面临的问题之一,因为它显示了许多警告:
Warning: library class javax.sql.XAConnection depends on program class javax.transaction.xa.XAResource
Note: there were 13 classes trying to access generic signatures using reflection.
You should consider keeping the signature attributes
(using '-keepattributes Signature').
(https://www.guardsquare.com/proguard/manual/troubleshooting#attributes)
Note: there were 3 classes trying to access enclosing classes using reflection.
You should consider keeping the inner classes attributes
(using '-keepattributes InnerClasses').
(https://www.guardsquare.com/proguard/manual/troubleshooting#attributes)
Note: there were 15 unresolved dynamic references to classes or interfaces.
You should check if you need to specify additional program jars.
(https://www.guardsquare.com/proguard/manual/troubleshooting#dynamicalclass)
Note: there were 3 class casts of dynamically created class instances.
You might consider explicitly keeping the mentioned classes and/or
their implementations (using '-keep').
(https://www.guardsquare.com/proguard/manual/troubleshooting#dynamicalclasscast)
Note: there were 34 accesses to class members by means of reflection.
You should consider explicitly keeping the mentioned class members
(using '-keep' or '-keepclassmembers').
(https://www.guardsquare.com/proguard/manual/troubleshooting#dynamicalclassmember)
Warning: there were 787 unresolved references to classes or interfaces.
You may need to add missing library jars or update their versions.
If your code works fine without the missing classes, you can suppress
the warnings with '-dontwarn' options.
(https://www.guardsquare.com/proguard/manual/troubleshooting#unresolvedclass)
Warning: there were 1 instances of library classes depending on program classes.
You must avoid such dependencies, since the program classes will
be processed, while the library classes will remain unchanged.
(https://www.guardsquare.com/proguard/manual/troubleshooting#dependency)
Warning: there were 3 unresolved references to program class members.
Your input classes appear to be inconsistent.
You may need to recompile the code.
(https://www.guardsquare.com/proguard/manual/troubleshooting#unresolvedprogramclassmember)
Note: you're ignoring all warnings!
似乎在清单上指定了主类:
Manifest-Version: 1.0
Created-By: 1.7.0_03 (Oracle Corporation)
Main-Class: ____embedded.____EntryPoint
也许如果它要改变放置类的地方,清单应该更新。
我的配置文件:
-injars apex.war
-outjars apex_out.war
-ignorewarnings
-keepattributes *Annotation*
-libraryjars <java.home>/lib/
-keep public class ____embedded.____EntryPoint {
public static void main(java.lang.String[]);
}
-keep,includedescriptorclasses public class ____bootstrap.____Bootstrap {
<methods>;
}
解决方案
推荐阅读
- r - R在仪表板上显示SQL最后更新
- python - 删除列表周围的方括号和撇号
- c# - MPMediaPickerController-> MPmediaitem -> NSDATA (xamarin, c#, ios)
- c - 如何从文本文件中读取并使用结构将其加载到内存中?
- file - 在 COBOL 中,如何将符号 comp-3 值与符号一起转换为可读格式
- reactjs - ReactJS:使用上一个和下一个按钮更改当前显示的图像
- apache-spark - Spark我可以在执行textFile时手动指定分区数吗
- python - 加载 Keras 模型 KeyError:'weighted_metrics'
- android - 在 Android 应用程序中嵌入 YouTube 直播
- csv - 将csv科学记数法转换为unix中的数字