I currently have two assembly descriptors with two executions for my project which generates distributions of the project for two different groups:
<!-- 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>
That means I have to maintain two sets of descriptors, shell scripts etc, which I want to avoid, but I can't seem to find a way of getting a expression containing execution id or another configuration parameter unique to the execution to the descriptor.
I'd assume that if the expression is visible to the assembly, the plugin will also be able to substitute it into my shell scripts to consolidate the build into one dist assembly descriptor with two executions.
Can anyone suggest a better approach?
It's not the total answer, but you could at least make this situation better by using a descriptor component. A descriptor component is a portion of an assembly descriptor file that is intended to be reused amongst several descriptors.
Perhaps between the filtering and the descriptor component you can limit the amount of items that need to go into each of the assembly descriptor files.
精彩评论