0
我正在使用Maven 3.3.9。 对于具有不同配置的相同插件,是否可以有相同的目标? 我的意思是这样具有不同配置的相同插件
<build>
...
<pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<executions>
<execution>
<id>test1</id>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
<configuration>
<executable>dir</executable>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<executions>
<execution>
<id>test2</id>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
<configuration>
<executable>cd</executable>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
如果我把<execution>
内<configuration>
标签,它只是被忽略。
加上标签<goalPrefix>
不工作,所以我不知道如何别名目标来区分他们...
编辑
我需要执行两个不同的脚本,我做了,但只是作为一个cli目标......脚本在代码上运行一些测试,但测试是可选的,只有程序员明确要运行它们时才必须执行它们。
我想在Maven来将那些脚本嵌入的原因是因为我想用${project.build.directory}
变量
你会用它做什么?一世 – Jens