我如何解决“意外元件QUOT; {}目标" {的antlib:org.apache.tools.ant}目标“在我的Ant编译错误? [英] How do I fix 'Unexpected element "{}target" {antlib:org.apache.tools.ant}target' errors in my Ant build?
问题描述
当我运行我的Ant构建失败与以下异常:
When I run my Ant build it fails with the following exception:
Unexpected element "{}target" {antlib:org.apache.tools.ant}target
我使用Eclipse 3.4.2。
I'm using Eclipse 3.4.2.
请让我知道我在这里失踪。
Please let me know what I'm missing here.
推荐答案
我可以把一个目标
的之外的项目重现此问题code>是在ant构建文件所需要的元素。该错误表示有在你的build文件故障 - 在错误的地方东西(A
目标
元素)
I can reproduce this problem by putting a target
outside the project
element that is required in ant build files. The error indicates that there is a fault in your build file - something (a target
element) in the wrong place.
该版本抛出错误:
<?xml version="1.0"?>
<target name="wibble" />
<project name="stack_overflow">
</project>
然而,这并不:
<?xml version="1.0"?>
<project name="stack_overflow">
<target name="wibble" />
</project>
在完整的错误消息,你应该得到一个行号来指导你的一点在文件中需要注意:
In the full error message you should get a line number to guide you to the point in the file needing attention:
# line number here
# v
build.xml:2: Unexpected element "{}target" {antlib:org.apache.tools.ant}target
这篇关于我如何解决“意外元件QUOT; {}目标&QUOT; {的antlib:org.apache.tools.ant}目标“在我的Ant编译错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!