Does ProGuard work with JavaEE 6 applications?

谁说我不能喝 提交于 2019-12-06 07:32:21

问题


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?

来源:https://stackoverflow.com/questions/8071281/does-proguard-work-with-javaee-6-applications

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!