3urdoch
3urdoch

Reputation: 7332

Is there an assembly id property in a Maven assembly?

I would like to use the assembly id as a property in a component xml file rather than duplicating a section of across multiple assemblies. Looking through the maven-assembly-plugin documentation I cannot see any reference to an assembly id. Any ideas if it is available?

Here is an example of what I would like to add to a component xml file.

<files>
    <file>
        <source>src/main/config/${assembly.id}.properties</source>
        <destName>/conf/config.properties</destName>
    </file>
</files>

Upvotes: 6

Views: 1993

Answers (1)

Stefan Ferstl
Stefan Ferstl

Reputation: 5265

You could probably use maven filtering for that:

  1. Define the ${assembly.id} property in the POM
  2. Configure the folder which contains the assembly descriptor(s) as resource folder and enable filtering on this folder
  3. Use ${assembly.id} as <id> in your assembly descriptor and your component descriptor
  4. configure the maven-assembly-plugin to use the (filtered) assembly descriptor from the target directory.

Upvotes: 2

Related Questions