ProGuard 可以与 JavaEE 6 应用程序一起使用吗?
我试图让 Proguard 混淆一个简单的 .war 文件。根据文档,Proguard 处理 .war 文件,但是当我尝试时,我得到以下信息:
Warning: class [WEB-INF/classes/com/corp/gr/t2b/T2BChannel.class] unexpectedly contains class [com.corp.gr.t2b.T2BChannel]
文档提到 Proguard 不喜欢 WEB-INF/classes 目录中包含类的 .war 文件。所以我将所有 .class 文件放在 WEB-INF/lib 中它们自己的 .jar 文件中。
然后 Proguard 抱怨它找不到任何 JavaEE 6 类,即使我已经给它 javaee.jar 文件,
-libraryjars C:/bin/glassfish-3.0.1/.../lib/javaee.jar
所以我解析出 javaee.jar 文件 MANIFEST.MF 中的所有条目并添加其中的每一个有多个
-libraryjars C:/bin/glassfish-3.0.1/.../modules/javax.servlet.jar
语句。
Proguard 表明它正在读取各种库 jar,然后滚动数千条“库类的重复定义”消息和一些其他消息。 (消息没有被记录,所以它们只是滚动到屏幕之外。)在所有这些消息的末尾,它以
Note: there were 965 duplicate class definitions.
Warning: there were 816 classes in incorrectly named files.
There is also数百(或数千 - 我不知道,因为这些不能重定向到文件)形式的警告
Warning: class [1.0/org/apache/xml/resolver/tools/ResolvingXMLReader.class] unex
pectedly contains class [org.apache.xml.resolver.tools.ResolvingXMLReader]
所以 Proguard 似乎无法处理 JavaEE 6 库。
有人让 Proguard 来使用 JavaEE 6 应用程序吗?您需要做什么才能使其与 JavaEE 6 库一起工作?
I'm trying to get Proguard to obfuscate a simple .war file. According to the docs Proguard handles .war files, but when I try I get this:
Warning: class [WEB-INF/classes/com/corp/gr/t2b/T2BChannel.class] unexpectedly contains class [com.corp.gr.t2b.T2BChannel]
The docs mention something about Proguard not liking .war files with classes in the WEB-INF/classes directory. So I put all the .class files in their own .jar file in WEB-INF/lib.
Then Proguard complains that it cannot find any of the JavaEE 6 classes, even though I've given it the javaee.jar file with
-libraryjars C:/bin/glassfish-3.0.1/.../lib/javaee.jar
So I parse out all of the entries in the javaee.jar file MANIFEST.MF and add each one of them with multiple
-libraryjars C:/bin/glassfish-3.0.1/.../modules/javax.servlet.jar
statements.
Proguard indicates that it is reading the various library jars and then scrolls thousands of "duplicate definition of library class" messages and some other messages. (The messages aren't logged so they just scroll off the screen.) At the end of all of these messages it finishes with
Note: there were 965 duplicate class definitions.
Warning: there were 816 classes in incorrectly named files.
There are also hundreds (or thousands - I can't tell because these can't be redirected to a file) of warnings of the form
Warning: class [1.0/org/apache/xml/resolver/tools/ResolvingXMLReader.class] unex
pectedly contains class [org.apache.xml.resolver.tools.ResolvingXMLReader]
So Proguard doesn't seem to be able to deal with the JavaEE 6 libraries.
Has anyone gotten Proguard to work with a JavaEE 6 application? What did you have to do to make it work with the JavaEE 6 libraries?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论