0

嗨,这是我的 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>@product.version@</mercury.version>
        <abc.version>7.0</abc.version>
    <metamodel.test>true</metamodel.test>
    </properties>
</project>

在 ant 中,我想获得 abc.version 的值> 我正在编写这段代码

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

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

但它不起作用,有人可以帮忙吗

4

1 回答 1

0

您应该将其更改为:

<echo>The version is ${mypom.properties.abc.version}</echo>
于 2012-06-14T11:22:31.030 回答