I have a Dynamic Web Project in Eclipse. After building the java source code, I wanted to obfuscate the class files using yGuard
. The external Jar files have been put in the lib
folder in the Tomcat directory and the build path is configured according to that path. I included that path as a external classes in the build.xml
ANT file.
In the shrink log, I get warnings like mentioned below. Thinking that these are warnings, I proceed ahead, and replace the old class files with the new ones.
But when starting the server, the Web Project it doesn't work properly. Meaning that I am not able to login, or use the project in any other way.
I have tried Proguard as well but the same warnings persists there as well. Tried with -ignorewarnings
as well but the same problem persists when replaced the original class files.
The build.xml
file:
<project name="project" default="yguard" basedir=".">
<target depends="jar" name="yguard">
<taskdef name="yguard" classname="com.yworks.yguard.YGuardTask"
classpath="libs/yguard.jar"/>
<yguard>
<inoutpair in="project.jar" out="project-obf.jar"/>
<externalclasses>
<pathelement location="C:/Program Files/Apache Software Foundation/Tomcat 7.0/lib/*.jar"/>
</externalclasses>
<shrink logfile="${shrinklog}">
</shrink>
</yguard>
</target>
<!-- compile -->
<target name="compile" depends="init">
<javac srcdir="${srcDir}" includes="com/technomedia/**/*.java"
destdir="${classDir}">
</javac>
</target>
<!-- create .jar -->
<target name="jar" depends="compile">
<jar jarfile="project.jar"
basedir="build/classes"
includes="com/technomedia/**">
</jar>
</target>
</project>
The Waning messages that I get in shrink.xml
file:
<!-- no entrypoints given - using class access public and protected on all inoutpairs. -->
<!-- parsing D:\TMSS\Project\Proguard\src\Proguard\ProGuard.jar -->
<!-- WARNING:Unresolved external dependency: javax.servlet.http.HttpServlet not found! -->
<!-- WARNING:Unresolved external dependency: org.apache.catalina.websocket.MessageInbound not found! -->
<!-- WARNING:Unresolved external dependency: javax.servlet.http.HttpServlet not found! -->
<!-- WARNING:Unresolved external dependency: org.apache.catalina.websocket.WebSocketServlet not found! -->
<!-- WARNING:Unresolved external dependency: javax.servlet.http.HttpServlet not found! -->
<!-- WARNING:Unresolved external dependency: javax.servlet.http.HttpServlet not found! -->
I expect that after replacing the class files in build/classes
directory from project-obf.jar
(after extracting) should work fine.