ITeye博客

ant中使用eclipse编译器

zhou_wu · 2012-01-12 15:34 · Maven Ant · 开源软件 · Markdown

问题场景: 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>

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。