Maven 3 antrun issue



最近我们从maven2升级到了maven3,但ant构建不起作用。Ant没有在maven3中编译我的项目,但可以使用maven2编译相同的项目。作为一个简单的例子,我在pom文件中放了一些要回显的消息我使用maven 2.0.6得到消息,但whaen使用maven3.0.3运行相同的我没有得到消息。在ant和maven 3中是否存在兼容性问题?在我的pom文件中有以下内容

<plugin>
  <artifactId>maven-antrun-plugin</artifactId>
    <executions>
    <execution>
            <id>1</id>
        <phase>validate</phase>
        <configuration>
            <tasks>
              <echo message="SOME MESSAGE TO DISPLAY " />
            </tasks>
        </configuration>
        <goals>
            <goal>run</goal>
        </goals>
    </execution>
</executions>
</plugin>
...

我建议使用maven echo插件:

像这样:

 <plugin>
    <groupId>com.soebes.maven.plugins</groupId>
    <artifactId>maven-echo-plugin</artifactId>
    <version>0.1</version>
    <executions>
      <execution>
        <id>echo-first-time</id>
        <phase>validate</phase>
        <goals>
          <goal>echo</goal>
        </goals>
        <configuration>
          <echos>
            <echo>This message is very early in the build process.</echo>
          </echos>
        </configuration>
      </execution>
    <execution>
 </plugin>

最新更新