Ant + Coldspring

时间:2009-12-02 18:57:54

标签: ant coldfusion coldspring

我正在使用新的cfbuilder并使用ANT将我的代码推送到我的开发服务器。一个不断出现的问题是当我对beans.xml文件进行更改时,我的ant build会在我的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>

1 个答案:

答案 0 :(得分:1)

这是你的整个构建文件吗?因为它缺少结束项目标签

我复制了你的beans.xml和build.xml,添加了最终项目标签,设置了一组模拟目录,并且它按预期工作(即没有{} bean ....错误)