2012-06-14 148 views
0

POM文件的值嗨,這是我POM文件如何從螞蟻

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 

    <modelVersion>4.0.0</modelVersion> 
    <parent> 
     <groupId>mycompany.com</groupId> 
     <artifactId>mercury</artifactId> 
     <version>1249</version> 
    </parent> 

    <groupId>mycompany.com.tools.mm</groupId> 
    <artifactId>parent</artifactId> 
    <version>1249</version> 
    <packaging>pom</packaging> 
    <name>parent</name> 
    <description>The parent to all MM projects</description> 

    <properties> 
     <mercury.version>@[email protected]</mercury.version> 
     <abc.version>7.0</abc.version> 
    <metamodel.test>true</metamodel.test> 
    </properties> 
</project> 

螞蟻我想abc.version的價值>我寫這段代碼

<artifact:pom id="mypom" file="C:\work\build\pom.template.xml" /> 

<echo>The version is ${mypom.properties.version}</echo> 

但它不工作,任何人都可以幫助,請

+0

也許你可以嘗試在建議的回答[這太問題(http://stackoverflow.com/questions/3839508/ant-inheriting-maven-properties) – Raghuram

回答

0

您應將其更改爲:

<echo>The version is ${mypom.properties.abc.version}</echo>