Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-11289

Add support for attaching multiple files in the same execution using the xmldoc-update-plugin

    XMLWordPrintable

Details

    • Unit
    • Easy
    • N/A
    • N/A

    Description

      Right now you can attach only one file per execution:

      <plugin>
        <groupId>org.xwiki.platform</groupId>
        <artifactId>xwiki-platform-tool-xmldoc-update-plugin</artifactId>
        <executions>
          <execution>
            <id>attach-job-resources</id>
            <phase>process-resources</phase>
            <goals>
              <goal>attach</goal>
            </goals>
            <configuration>
              <file>${job.webjar.directory}/jobRunner.js</file>
              <sourceDocument>${project.build.outputDirectory}/FileManagerCode/JobRunner.xml</sourceDocument>
            </configuration>
          </execution>
          ...
        </executions>
      </plugin>
      

      This forces us to duplicate a lot of POM content when we have multiple files to attach: you need to configure a new execution for each file. It would be better if the xmldoc-update-plugin supported a 'files' parameter that accepts multiple values:

      <plugin>
        <groupId>org.xwiki.platform</groupId>
        <artifactId>xwiki-platform-tool-xmldoc-update-plugin</artifactId>
        <executions>
          <execution>
            <id>attach-job-resources</id>
            <phase>process-resources</phase>
            <goals>
              <goal>attach</goal>
            </goals>
            <configuration>
              <files>
                <file>${job.webjar.directory}/jobRunner.js</file>
                <file>${job.webjar.directory}/jobRunner.min.js</file>
              </files>
              <sourceDocument>${project.build.outputDirectory}/FileManagerCode/JobRunner.xml</sourceDocument>
            </configuration>
          </execution>
          ...
        </executions>
      </plugin>
      

      I need this in order to be able to use JavaScript libraries packaged as webjars on older versions of XWiki that don't have support for webjars (e.g. 5.4.5).

      Attachments

        Issue Links

          Activity

            People

              mflorea Marius Dumitru Florea
              mflorea Marius Dumitru Florea
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: