Uploaded image for project: 'AppFormer'
  1. AppFormer
  2. AF-1416

Dynamic POM Dependencies Framework

XMLWordPrintable

    • Dynamic Dependencies
    • To Do
    • 2018 Week 30-32, 2018 Week 33-35, 2018 Week 36-38, 2018 Week 39-41, 2018 Week 42-44, 2018 Week 45-47, 2018 Week 48-50, 2019 Week 02-04, 2018 Week 51-01
    • NEW
    • NEW

      As a workbench user/developer, I want to have maven dependencies automatically added to the pom of my project,
      based on the functionality/asset type created.

      For example:
      If I add a data object with JPA annotation I want JPA dependency to be automatically added to pom.xml of my project.

      The current solution to handle project dependencies on maven (pom.xml) is the 'eager' approach. Basically what we do
      is to add all the possible dependencies to the project pom. i.e. this is a pom file of a empty project:

      <?xml version="1.0" encoding="UTF-8"?>
      <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <modelVersion>4.0.0</modelVersion>
        <groupId>com.myspace</groupId>
        <artifactId>sample</artifactId>
        <version>1.0.0</version>
        <packaging>kjar</packaging>
        <name>sample</name>
        <description></description>
        <dependencies>
          <dependency>
            <groupId>com.thoughtworks.xstream</groupId>
            <artifactId>xstream</artifactId>
            <version>1.4.10</version>
            <scope>test</scope>
          </dependency>
          <dependency>
            <groupId>org.kie</groupId>
            <artifactId>kie-internal</artifactId>
            <version>7.9.0-SNAPSHOT</version>
            <scope>provided</scope>
          </dependency>
          <dependency>
            <groupId>org.optaplanner</groupId>
            <artifactId>optaplanner-core</artifactId>
            <version>7.9.0-SNAPSHOT</version>
            <scope>provided</scope>
          </dependency>
          <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
          </dependency>
          <dependency>
            <groupId>org.optaplanner</groupId>
            <artifactId>optaplanner-persistence-jaxb</artifactId>
            <version>7.9.0-SNAPSHOT</version>
            <scope>provided</scope>
          </dependency>
          <dependency>
            <groupId>org.kie</groupId>
            <artifactId>kie-api</artifactId>
            <version>7.9.0-SNAPSHOT</version>
            <scope>provided</scope>
          </dependency>
        </dependencies>
        <build>
          <plugins>
            <plugin>
              <groupId>org.kie</groupId>
              <artifactId>kie-maven-plugin</artifactId>
              <version>7.9.0-SNAPSHOT</version>
              <extensions>true</extensions>
            </plugin>
          </plugins>
        </build>
      </project>
      

      This eager approach comes with some tradeoffs like creating a bigger jar than necessary (in bytes) and also making the project build slow. So the goal of this epic is to make our projects deal with dependencies in a lazy way, adding those only when necessary.

      Acceptance criteria:
      As soon as the project is created he should have a pom with no dependencies and pass a maven build (on workbench and on CLI).
      Adding any asset should add the required dependencies and still have a green build. (check AF-1454 for the dependency list)
      The cleanup mechanism should clean-up all the unnecessary pom dependencies.

            eignatow Eder Ignatowicz
            eignatow Eder Ignatowicz
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: