属性“可执行”需要公开报价。与元素类型“exec”相关联
我正在尝试通过我的 ant 脚本执行 cmd。我收到以下错误:
build.xml:24:属性“可执行”需要打开引号 与元素类型“exec”关联。
这些是 22
行到 27
行。正如您所看到的,该行失败了 - 行 24
是 exec cmd 上方的空格。我看不出我在哪里忘记了引言,它们对我来说看起来就像是常规引言。我检查了档案,没有找到类似的内容。
<chmod file="/blddir/tools/gmake" perm="777"/>
<echo message="Starting"/>
<exec dir="/blddir/tools/" executable="gmake" vmlauncher="false" failonerror="true">
<arg line="-s"/>
</exec>
I am trying to execute a cmd through my ant script. I am getting the following error:
build.xml:24: Open quote is expected for attribute "executable"
associated with an element type "exec".
These are lines 22
through 27
. As you can see the line it is failing on - line 24
is the space above the exec cmd. I can't see where I forgot a quote and they look like the regular quotes to me. I checked the archives and I couldn't find anything similar.
<chmod file="/blddir/tools/gmake" perm="777"/>
<echo message="Starting"/>
<exec dir="/blddir/tools/" executable="gmake" vmlauncher="false" failonerror="true">
<arg line="-s"/>
</exec>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
该错误消息意味着您的构建脚本无效,因为 exec 任务中缺少属性可执行文件的开放引号,请重新检查类似 :
的
内容,或者
您发布的代码片段似乎没问题!?
某些编辑器 - fe Eclipse Ant 编辑器 - 应该指出语法错误
The error message means your build script is not valid, because of missing open quote for attribute executable in the exec task, please recheck for something like :
or
whereas the snippet you posted seems alright !?
Some editor - f.e. Eclipse Ant editor - should point to the syntax error
我遇到了同样的问题,结果发现我将引号从网站复制到编辑器中,文件中的双引号不是正确的,它们是预定的而不是直接的。
在 NetBeans 编辑器中打开 build.xml 文件清楚地显示了问题
I hit the same issue and it turned out that I copied the quotes into an editor from a website and the double quotation marks in the file were not the correct ones, they were the slated ones instead of the straight ones.
Opening the build.xml file in the NetBeans editor showed the problem clearly