What's the best way to modify a GWT library in a jar?
I want to change the way gwt-log works. I have the jar file with all of the开发者_开发技巧 source in it, and I'm using eclipse. How can I make a change to the source, recompile it, and export it as a jar file that I can just swap into my project?
You can do it by adding its path(desired class which you want to change) to your source path, packages should be the same with jar's path, but it should be created in your src.
You can checkout the sources from Google SVN repository in Eclipse which will create the project for you.
Another way is to simple create an empty Java project in Eclipse and dump the source files from the jar into the src folder.
To make the jar, typically you'll need an ant build file, as Eclipse doesn't make the jar for you. So something along these lines in the project root folder:
<?xml version="1.0" encoding="UTF-8"?>
<project name="GWTLog.makejar" default="makejar" basedir=".">
<target name ="makejar" description="Create a jar for the GWTLog project">
<jar jarfile="gwt-log-custom-3.0.4.jar" includes="*.class" basedir="bin"/>
</target>
</project>
精彩评论