Maven:ant-run plugin echo似乎没有执行

时间:2015-03-20 21:40:56

标签: maven maven-antrun-plugin

我有一个使用ant-run插件的maven项目。我添加了一条echo消息,但它似乎没有执行:

<build>
    <plugins>
         <plugin>
             <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-antrun-plugin</artifactId>
             <executions>
                 <execution>
                     <id>ast-application-deployment-kit</id>
                         <phase>package</phase>
                         <goals>
                              <goal>run</goal>
                         </goals>
                         <configuration>
                             <target>
                                 <echo message="Starting ant-run target configuration."/>

但是当我mvn clean package时,我看到了这个

[INFO] --- maven-antrun-plugin:1.3:run (my-app) @ my-app ---
[INFO] Executing tasks
[INFO] Executed tasks

但我没有看到回声。我做错了什么?

1 个答案:

答案 0 :(得分:4)

考虑将插件版本升级到最新版本(1.8):

此POM代码段打印echo:

<plugin>
    <artifactId>maven-antrun-plugin</artifactId>
    <version>1.8</version>
    <executions>
        <execution>
            <phase>package</phase>
            <configuration>
                <target>
                    <echo>NOW YOU CAN SEE ME!</echo>
                </target>
            </configuration>
            <goals>
                <goal>run</goal>
            </goals>
        </execution>
    </executions>
</plugin>