maven可以运行命令行指令吗?
答
非原生。
但是,通过使用AntRun plugin,可以指定在构建期间执行OS命令的Ant任务(使用Exec)。
<project>
...
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase> <!-- a lifecycle phase --> </phase>
<configuration>
<tasks>
<!--
Place any Ant task here. You can add anything
you can add between <target> and </target> in a
build.xml.
-->
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
...
</project>
它的答案被选中,因为它解决了我的问题。但有问题的话,我会采取任何指令,而不仅仅是java任务。 – Max 2009-07-02 07:28:27