我目前有两个程序集描述符,我的项目有两个执行,它们为两个不同的组生成项目的分布:
<!-- Client distribution -->
<execution>
<id>client</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>src/main/assembly/dist-client.xml</descriptor>
</descriptors>
</configuration>
</execution>
<!-- Developer distribution -->
<execution>
<id>developer</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>src/main/assembly/dist-developer.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
这意味着我必须维护两组描述符、shell 脚本等,这是我想避免的,但我似乎无法找到一种方法来获取包含执行 id 或另一个对描述符执行唯一的配置参数的表达式。
我假设如果该表达式对程序集可见,该插件也可以将其替换到我的 shell 脚本中,以将构建合并到一个具有两次执行的 dist 程序集描述符中。
任何人都可以提出更好的方法吗?