2010-11-09 128 views
1

不承認我在一個叫unittest.xml以下列方式文件(26行)定義的路徑:路徑定義螞蟻

<path id="tasks.path"> 
     <pathelement location="${publish.home}/INSIDE/UnitTest/testinganttasks.jar"/> 
    </path> 

下一個我試圖用路徑以下列方式:

<classpath> 
     <path refid="tasks.path" /> 
    </classpath> 

在taskdef標籤中。 當我運行我的ant代碼,但這一切順利,直到我得到以下錯誤:

BUILD FAILED unittest.xml:296: The following error occurred while executing this line: unittest.xml:281: Reference tasks.path not found.

我怎樣才能解決這個問題?

+0

我們需要看到這些行,因爲我們無法訪問您的構建腳本 – Woot4Moo 2010-11-09 17:03:46

回答

0

你應該可以看到這個例子在http://ant.apache.org/manual/using.html#references

<project ... > 
    <path id="project.class.path"> 
    <pathelement location="lib/"/> 
    <pathelement path="${java.class.path}/"/> 
    <pathelement path="${additional.path}"/> 
    </path> 

    <target ... > 
    <rmic ...> 
     <classpath refid="project.class.path"/> 
    </rmic> 
    </target> 

    <target ... > 
    <javac ...> 
     <classpath refid="project.class.path"/> 
    </javac> 
    </target> 
</project> 

我覺得你的問題是,在類路徑中你不應該巢路徑元素,但給的classpath元素本身的路徑的ID。