0
我的問題是道路,我必須建立從路徑清單項類路徑就像使用螞蟻清單路徑條目從建築物的依賴罐子
- C:\用戶\ rosansamuel.ivy2 \緩存\ log4j的\ log4j \ jars \ log4j-1.2.14.jar
你可以請任何人提出一些建議嗎?
下面的代碼是,我想用propertyregex,但實際上我無法獲得罐子名稱。
<for list="${ofsml.manifest.classpath.list}" delimiter=";" param="individual.path">
<sequential>
<property name="single.artifact.path" value="@{individual.path}"/>
<echo message="single aritfact path name : ${single.artifact.path}"/>
<path id="my.base.path">
<pathelement path="${single.artifact.path}"/>
</path>
<property name="artifact.id.file" refid="my.base.path"/>
<echo message=" artifact.id.file: ${artifact.id.file}"/>
<propertyregex property="artifact.id" input="${artifact.id.file}" regexp=".*.jar" select="\1"/>
<echo message="jar name : ${artifact.id}"/>
<echo message="individual.path = @{individual.path}"/>
</sequential>
</for>
不明白你在問什麼,但似乎就像你只需要從絕對文件路徑獲取文件名一樣?!爲此目的有一個任務。另外,當使用\ 1您的正則表達式應該有一個組,f.e. 。+ \\(。+ jar)表示\ 1會從C:\ Users \ rosansamuel.ivy2 \ cache \ log4j \ log4j \ jars \ log4j-1.2.14.jar中捕獲log4j-1.2.14.jar –
Rebse
嗨Mate,是的,你是對的。我的要求是從路徑中單獨提取jar名稱。但我有路徑列表。 – androidgalaxyman