Uploaded image for project: 'XWiki Commons'
  1. XWiki Commons
  2. XCOMMONS-818

XAR plugin includeDependencies feature skip runtime transitive dependencies

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Fix
    • Minor
    • None
    • 6.2.4
    • None

    Description

      It does not make much sense since most XAR projects dependencies are declared as runtime (you don't need it when building the XAR).

      Here is an example to reproduce the issue:

      <?xml version="1.0" encoding="UTF-8"?>
      
      <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
        <modelVersion>4.0.0</modelVersion>
        <parent>
          <groupId>org.xwiki.platform</groupId>
          <artifactId>xwiki-platform-core</artifactId>
          <version>7.2-SNAPSHOT</version>
        </parent>
        <artifactId>test</artifactId>
        <packaging>xar</packaging>
        <properties>
          <!-- Don't run CLIRR here since there's no Java code. -->
          <xwiki.clirr.skip>true</xwiki.clirr.skip>
        </properties>
        <dependencies>
          <dependency>
            <groupId>org.xwiki.platform</groupId>
            <artifactId>xwiki-platform-mail-ui</artifactId>
            <version>7.2-SNAPSHOT</version>
            <type>xar</type>
          </dependency>
        </dependencies>
        <build>
          <plugins>
            <plugin>
              <groupId>org.xwiki.commons</groupId>
              <artifactId>xwiki-commons-tool-xar-plugin</artifactId>
              <version>7.2-SNAPSHOT</version>
              <configuration>
                <includeDependencies>true</includeDependencies>
              </configuration>
            </plugin>
          </plugins>
        </build>
      </project>
      

      When building this project you get a XAR with xwiki-platform-mail-ui pages but not xwiki-platform-mail-ui dependencies pages (which are declared as runtime).

      The workaround is to declare xwiki-platform-mail-ui dependency as <scope>provided</scope> which force all transitive runtime dependencies as compile dependencies and makes them taken into account.

      Putting this issue as minor since anyway it does not make much sense to make transitive a dependency you include in the final XAR so scope provided should always been used.

      Attachments

        Activity

          People

            tmortagne Thomas Mortagne
            tmortagne Thomas Mortagne
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: