Ant报错Open quote is expected for attribute "*A" associated with an element type "*B"

原创 2016年06月14日 12:31:36

解决路径:

依据报错信息提示:找到 元素"*B"查看该元素下的”*A“属性存在的异常,一般都是格式问题。因为是xml文件,可以考虑将文件用NotPad++、dreamweaver等工具打开,文件的格式信息会有所体现,仔细查看,就能发现问题。(会有一种感觉,没有什么大不了。。。。工具是神奇的!!!)

常见问题:

D:\>ant
Buildfile: build.xml

BUILD FAILED
D:\build.xml:4: Open quote is expected for attribute "file" associated with an  element type  "copy".

Total time: 2 seconds
D:\>ant
Buildfile: build.xml

BUILD FAILED
D:\build.xml:4: Open quote is expected for attribute "overwrite" associated with an  element type  "copy".

Total time: 0 seconds

build.xml内容:

// 【改前】简单示例
<?xml version="1.0" encoding="GBK"?>
<project name="测试脚本" default="copyfile" basedir=".">
	<target name="copyfile">
		<copy file="d:/BugReport.txt" todir="c:/temp" overwrite="true"/>
	</target>
</project>

解决方案:

将copy中的双引号(")换成单引号(')

修改后的build.xml内容:

// 【改后】简单示例
<?xml version="1.0" encoding="GBK"?>
<project name="测试脚本" default="copyfile" basedir=".">
	<target name="copyfile">
		<copy file='d:/BugReport.txt' todir='c:/temp' overwrite='true'/>
	</target>
</project>
执行结果(成功!):

D:\>ant
Buildfile: build.xml

copyfile:
     [copy] Copying 1 file to C:\temp

BUILD SUCCESSFUL
Total time: 1 second
D:\>ant
Buildfile: build.xml

copyfile:
     [copy] Copying 1 file to C:\temp

BUILD SUCCESSFUL
Total time: 0 seconds
D:\>

这都是我们喜欢看到的!!!
版权声明:本文为博主原创文章,未经博主允许不得转载。

Open quote is expected for attribute "{1}" associated with an element type "name".

严重: Exception sending context initialized event to listener instance of class org.springframework.we...
  • repoem
  • repoem
  • 2011年12月15日 15:59
  • 13107

spring配置问题:org.xml.sax.SAXParseException: Open quote is expected for attribute "{1}" associated with

spring配置文件问题,报错信息如下:

【tomcat】org.xml.sax.SAXParseException: Open quote is expected for attribute "{1}" associated

启动报错:org.xml.sax.SAXParseException: Open quote is expected for attribute "{1}" associated with an e...

Attribute name "aphmodel" associated with an element type "mxg" must be followed by the ' = ' charac

1、错误描述 org.apache.batik.transcoder.TranscoderException: null Enclosed Exception: Attribute name "aph...

项目启动时报错Element type "property" must be followed by either attribute specifications, ">" or "/>"

项目启动时,控制台报错,信息如下(有删减): Error creating bean with name 'supplierInfoDAO' defined in class path resourc...

struts2用注解开发出错一 There is no Action mapped for namespace [/] and action name [zhujie] associated with

struts2用注解进行开发时一直出现如下错误Struts Problem ReportStruts has detected an unhandled exception:Messages: ...

解决Warning:Ignoring InnerClasses attribute for an anonymous inner class associated EnclosingMethod at

公司最近想把友盟的意见反馈升级为阿里百川,结果发生一个悲剧,Android studio 运行不起来,经常研究终于知道问题所在了,在此给大家分享下结局方案: Warning:Ignoring Inne...

Android之百度云推送(四)open_type is not valid报错error_code30602

Android之百度云推送(四)open_type is not valid报错error_code30602参考http://blog.csdn.net/xyzz609/article/detail...
  • xyzz609
  • xyzz609
  • 2016年08月24日 14:15
  • 2108

VirtualBox 启动报错 could not find an open hard disk with uuid 解决方法

昨天直接将VBox 虚拟机强制退出,再启动就显示虚拟机不可用,如图:  Could not find an open hard disk wi...

CoreData报错:The model used to open the store is incompatible with the one used to create the store

今天在调试coredata,出现了这个异常: 在推酷看到解决方法:这个错误通常是我们修改了DataModel文件,增加了新的Entity,包括Attribute属性、Relationship关系等等...
  • QZidane
  • QZidane
  • 2015年05月09日 11:06
  • 987
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:Ant报错Open quote is expected for attribute "*A" associated with an element type "*B"
举报原因:
原因补充:

(最多只允许输入30个字)