Details

      Description

      It has been created a new immutable spring boot container allowing spring boot app contain the artifacts to be resolved within jar. This removes the need of the offliner tools as they are resolved at maven packaging time. The system allows multiple versions of the same kjar (including modules). They are separated from the BOOT-INF/lib jars to avoid class loader collissions and each class path container kjar is isolated from each other not relying in spring boot class loader.

      to achieve it is required 3 steps.

      add this in the spring boot properties:

      kieserver.classPathContainer=true
      

      specifying the containers to be deployed

      @Configuration
      public class KieContainerDeployer {
      
          @Bean
          public KieContainerResource evaluation_v1() {
              KieContainerResource container = new KieContainerResource("evaluation_v1", new ReleaseId("com.myspace", "Evaluation", "1.0.0-SNAPSHOT"), STARTED);
              container.setConfigItems(Arrays.asList(new KieServerConfigItem(KieServerConstants.PCFG_RUNTIME_STRATEGY, "PER_PROCESS_INSTANCE", "String")));
              return container;
          }
      
          @Bean
          public KieContainerResource evaluation_v2() {
              KieContainerResource container = new KieContainerResource("evaluation_v2", new ReleaseId("com.myspace", "Evaluation", "2.0.0-SNAPSHOT"), STARTED);
              container.setConfigItems(Arrays.asList(new KieServerConfigItem(KieServerConstants.PCFG_RUNTIME_STRATEGY, "PER_PROCESS_INSTANCE", "String")));
              return container;
          }
      
      }
      

      With this won't be needed to specify any property. just include the deployments within spring boot as the next bullet indicates. This will deploy
      automatically those with a container id <artifactId>-<version>

      Maven plugin in the service (including kjar multiple version). This will resolve the necesary artifacts to run the kjar.

        <build>
          <plugins>
            <plugin>
              <groupId>org.kie</groupId>
              <artifactId>kie-maven-plugin</artifactId>
              <version>${version.org.kie}</version>
              <executions>
                <execution>
                  <id>copy</id>
                  <phase>prepare-package</phase>
                  <goals>
                    <goal>package-dependencies-kjar</goal>
                  </goals>
                </execution>
              </executions>
              <configuration>
                <artifactItems>
                  <artifactItem>
                    <groupId>com.myspace</groupId>
                    <artifactId>Evaluation</artifactId>
                    <version>1.0.0-SNAPSHOT</version>
                  </artifactItem>
                  <artifactItem>
                    <groupId>com.myspace</groupId>
                    <artifactId>Evaluation</artifactId>
                    <version>2.0.0-SNAPSHOT</version>
                  </artifactItem>
                </artifactItems>
              </configuration>
            </plugin>
          <plugins>
        <build>
      

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  elguardian Enrique González Martínez
                  Reporter:
                  elguardian Enrique González Martínez
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: