是否可以通过命令行中的 id 调用 maven-exec-plugin(或任何其他插件)执行?
假设我的 pom.xml 文件如下所示:
<project>
[...]
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<id>foo</id>
<goals>
<goal>exec</goal>
</goals>
<phase></phase>
<configuration>
<executable>echo</executable>
<arguments>
<argument>foo</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>bar</id>
<goals>
<goal>exec</goal>
</goals>
<phase></phase>
<configuration>
<executable>echo</executable>
<arguments>
<argument>bar</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
[...]
</project>
现在可以打电话了吗
mvn 执行:执行
有一些额外的魔法来运行执行“foo”?
对于好奇,这里有一个使用配置文件的替代解决方案:http: //www.mail-archive.com/user@mojo.codehaus.org/msg00151.html