Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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>
like image 354
3urdoch Avatar asked Nov 04 '22 21:11

3urdoch


1 Answers

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.
like image 79
Stefan Ferstl Avatar answered Nov 09 '22 13:11

Stefan Ferstl