【发布时间】:2014-10-28 13:01:52
【问题描述】:
在 Maven <plugin> 元素中有一个 <executions> 元素,其中包含多个 <execution> 元素。每个<execution> 元素都可以有一个包含字符串的<id> 元素。什么引用了那些<id>...</id> 元素?省略该元素是什么意思? <id> 元素的语义是什么?
例如:
<project>
[...]
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>default-jar-execution</id>
<configuration>
<finalName>mainjar</finalName>
</configuration>
</execution>
<execution>
<id>extra-jar-execution</id>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<finalName>anotherjar</finalName>
</configuration>
</execution>
</exectutions>
</plugin>
[...]
</plugins>
</build>
</project>
什么引用了 <id>default-jar-execution</id> 和 <id>extra-jar-execution</id> 值?更改这些字符串中的任何一个的行为差异是什么?删除这些元素是什么意思?
【问题讨论】: