Uploaded image for project: 'Maven Assembly Plugin'
  1. Maven Assembly Plugin
  2. MASSEMBLY-928

Allow declaring <file> items within <dependencySets>.

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • dependencySet
    • None

    Description

      I'd like to be able to express copying of files within the <dependencySets> of an assembly descriptor.

      Consider the following use-case:

      A maven module A of a multi-module project has dependencies B, C.

      A can use the maven-assembly-plugin to perform custom packaging of the dependencies B and C by means of the dependencySets element. For example, it could be creating a bundle with B and C unpacked in a folder matching the dependency artifactId by using the artifact.artifactId property (which is only available within the dependencySet).

      But as part of the packaging, we want to be able to generate and filtered file, whose content depends on the dependency artifactId, for each of the included dependencies, with the filename matching the artifact name.

      Today I only see two possibilities:

      • The file needs to have been packed in the specific dependency. This is not good because the file might not make sense outside A or B and C could be dependencies that are not own by our multi-module.
      • A separated assembly descriptor needs to be created and multiple executions have to be specified. This requires creating per-dependency <filter> files and does not scale well. This is not a possibility because it is not possible to have the <destName> based on a property.

      Instead I'd like to have the possibility of writing an assembly descriptor such as:

      <dependencySets>
        <dependencySet>
        ..
          <files>
            <file>
              <source>my-template</source>
              <destName>${artifact.artifactId}</destName>
              <filtering>true</filtering>
            </file>
          </files>
        ..
        </dependencySet>
      </dependencySets>
      

      And that filtering would expand also the <dependencySet>> specific properties such as ${artifact.artifactId} in my-template.

      Attachments

        Activity

          People

            Unassigned Unassigned
            dacucar DarĂ­o Cutillas
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: