我正在使用新的 cfbuilder 并使用 ANT 将我的代码推送到我的开发服务器。不断出现的一个问题是,当我对 beans.xml 文件进行更改时,我的 ant 构建会在 beans.xml 文件上引发异常。
这是我得到的例外:
BUILD FAILED
C:\workingcopies\bpmMag\config\beans.xml:3: Unexpected element "{}beans" {antlib:org.apache.tools.ant}beans
这是我的构建文件:
<?xml version="1.0" encoding="UTF-8"?>
<project name="build" default="" basedir=".">
<description>
A description of what this build file does
</description>
<!-- Location of working Copy -->
<property name="workingCopy" value="C:\workingcopies\bpmMag" />
<!-- Location of testing server -->
<property name="testServer" value="Z:\www\dev7.devstation\htdocs" />
<!-- Test Target -->
<target name="test">
<copy todir="${testServer}">
<fileset dir="${workingCopy}">
<exclude name="coldspring/**"/>
<exclude name="**/*.project"/>
<exclude name="settings.xml"/>
<exclude name=".settings/**"/>
<exclude name="build.xml"/>
</fileset>
</copy>
</target>
这是我的 beans.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans>
<!-- Advice Beans -->
<bean id="AdviceDAO" class="com.model.advice.dao.AdviceDAO">
<constructor-arg name="dsn"><value>${dsn}</value></constructor-arg>
</bean>
<bean id="AdviceGateway" class="com.model.advice.gateway.AdviceGW">
<constructor-arg name="dsn"><value>${dsn}</value></constructor-arg>
</bean>
<bean id="AdviceService" class="com.model.advice.service.AdviceSV">
<constructor-arg name="adviceDAO">
<ref bean="adviceDAO"/>
</constructor-arg>
<constructor-arg name="adviceGateway">
<ref bean="adviceGateway"/>
</constructor-arg>
</bean>
</beans>