ant中使用eclipse编译器
问题场景: java代码里有些字符串常量太长了,超过了64k,使用默认的JDK编译是无法编译成功的,出现Constant string too long的exception.但是这个class在Eclipse中是可以编译通过的。所以基本想法就是在ant中执行某个target的时候使用eclipse的编译器,这里叫jdtCompilerAdapter.
解决方案: 1.ant的lib里加上jdtCompilerAdapter.jar和org.eclipse.jdt.core_xxx.jar 2.buid.xml中
<javac destdir="xxxx/WEB-INF/classes" debug="on" target="1.5" source="1.5" fork="true"failonerror="true" compiler="org.eclipse.jdt.core.JDTCompilerAdapter"></javac>