JAXB 2.x和蚂蚁 [英] JAXB 2.x and Ant
问题描述
我使用的 JAXB 2.1.2 与 MOXY 的实施。
要建立我用我的web应用程序的蚂蚁1.7.1 ,我也使用
I am using JAXB 2.1.2 with the MOXy implementation. To build my web app I am using Ant 1.7.1 and I am also using the
package-info.java
类来指定命名空间的东西。
class to specify namespace stuff.
全部运行正常,除了package-info.java没有得到编译。
在生成目录,不存在预期包info.class在专用目录(我的域类)。
All runs fine, except the package-info.java does not get compiled. in the build directory, there is no expected package-info.class at the dedicated directory (with my domain classes).
我怎么能强迫蚂蚁也编译package-info.java类?
How can I force Ant to also compile the package-info.java class?
我读到Ant的限制,在这里,但我不能相信这个问题一直没有解决?
http://ant.apache.org/manual/Tasks/javac.html
I read about Ant's limitation here but I can't believe that this has not been resolved? http://ant.apache.org/manual/Tasks/javac.html
感谢
推荐答案
在我找到了一个解决办法自己与此同时,所以这个工作正常,但只有当你编译两次(在某种程度上其中类文件被存储到必须是目标文件夹比package-info.java文件旧):
相反,在我的build.xml蚂蚁这些命令:
In the meanwhile I found a workaround myself, so this works fine but only if you compile twice (somehow the target folder where the class file gets stored to must be older than the package-info.java file): Instead of these ant commands in my build.xml:
<mkdir dir="${realm.classes.dir}"/>
<javac srcdir="${realm.java.dir}" destdir="${realm.classes.dir}"
classpathref="classpath"
encoding="${javac.encoding}"
debug="true"
/>
我不得不使用额外的命令:
I had to use the additional command:
<mkdir dir="${realm.classes.dir}"/>
<touch>
<fileset dir="${realm.java.dir}" includes="**/package-info.java"/>
</touch>
<javac srcdir="${realm.java.dir}" destdir="${realm.classes.dir}"
classpathref="classpath"
encoding="${javac.encoding}"
debug="true"
/>
如果你有一个更好的解决方案,让我知道!
If you have a better solution, let me know!
这篇关于JAXB 2.x和蚂蚁的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!