Uploaded image for project: 'Drools'
  1. Drools
  2. DROOLS-5663

align kie-maven-plugin default value for generateModel configuration flag

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • None
    • None
    • integration
    • None

      Executive Summary

      IFF the user do NOT specify the generateModel configuration flag for the kie-maven-plugin, the KJAR project ends up being built twice.

      Details

      Take note of "Steps to Reproduce".

      We can observe that, at first, GenerateModelMojo is invoked, and then BuildMojo is ALSO invoked. With the end result that the drools-model file is generated anyway in the final JAR (kjar) artifact.

      In details, from the attached log, we notice at first the GenerateModelMojo is invoked:

      accordingly the mojo is generating the exec model classes sources:

      [INFO] --- kie-maven-plugin:7.44.0-SNAPSHOT:generateModel (default-generateModel) @ kie-maven-plugin-example ---
      [INFO] Artifact not fetched from maven: org.drools:drools-model-compiler:7.44.0-SNAPSHOT. To enable the KieScanner you need kie-ci on the classpath
      [INFO] Artifact not fetched from maven: org.drools:drools-canonical-model:7.44.0-SNAPSHOT. To enable the KieScanner you need kie-ci on the classpath
      [INFO] Artifact not fetched from maven: org.drools:drools-compiler:7.44.0-SNAPSHOT. To enable the KieScanner you need kie-ci on the classpath
      [INFO] Artifact not fetched from maven: org.kie:kie-dmn-backend:7.44.0-SNAPSHOT. To enable the KieScanner you need kie-ci on the classpath
      [INFO] Artifact not fetched from maven: org.kie:kie-dmn-feel:7.44.0-SNAPSHOT. To enable the KieScanner you need kie-ci on the classpath
      [INFO] Artifact not fetched from maven: org.kie:kie-dmn-api:7.44.0-SNAPSHOT. To enable the KieScanner you need kie-ci on the classpath
      [INFO] Artifact not fetched from maven: org.drools:drools-core:7.44.0-SNAPSHOT. To enable the KieScanner you need kie-ci on the classpath
      [INFO] Artifact not fetched from maven: org.kie:kie-dmn-model:7.44.0-SNAPSHOT. To enable the KieScanner you need kie-ci on the classpath
      [INFO] Artifact not fetched from maven: org.kie:kie-dmn-core:7.44.0-SNAPSHOT. To enable the KieScanner you need kie-ci on the classpath
      [INFO] Artifact not fetched from maven: org.kie:kie-api:7.44.0-SNAPSHOT. To enable the KieScanner you need kie-ci on the classpath
      [INFO] Found 36 generated files in Canonical Model
      [INFO] Generating /Users/mmortari/git/droolsjbpm-integration/kie-maven-plugin-example/target/generated-sources/drools-model-compiler/main/java/./org/kie/example/P01/LambdaPredicate01D5F3DAA2D9F6094AE615B9F2841BE2.java
      [INFO] Generating /Users/mmortari/git/droolsjbpm-integration/kie-maven-plugin-example/target/generated-sources/drools-model-compiler/main/java/./org/kie/example/PE1/LambdaConsequenceE181A33F2423D9B3ED83D2764CD9D7CC.java
      [INFO] Generating /Users/mmortari/git/droolsjbpm-integration/kie-maven-plugin-example/target/generated-sources/drools-model-compiler/main/java/./org/acme/test_generateModel_kjararchetype/DomainClassesMetadata58cc6133a88c41de80943de1b39e3585.java
      [INFO] Generating /Users/mmortari/git/droolsjbpm-integration/kie-maven-plugin-example/target/generated-sources/drools-model-compiler/main/java/./org/kie/firealarm/DomainClassesMetadatad1f96973064a44cabb6a83fbe9979fa0.java
      [INFO] Generating /Users/mmortari/git/droolsjbpm-integration/kie-maven-plugin-example/target/generated-sources/drools-model-compiler/main/java/./org/kie/example/P4B/LambdaExtractor4BD2450C83C7C6D99B9E58FC68BF23B8.java
      [INFO] Generating /Users/mmortari/git/droolsjbpm-integration/kie-maven-plugin-example/target/generated-sources/drools-model-compiler/main/java/./org/kie/firealarm/P04/LambdaConsequence04E3132F35C1152F539B6ED4644AC6B3.java
      [INFO] Generating /Users/mmortari/git/droolsjbpm-integration/kie-maven-plugin-example/target/generated-sources/drools-model-compiler/main/java/./org/kie/firealarm/Alarm.java
      [INFO] Generating /Users/mmortari/git/droolsjbpm-integration/kie-maven-plugin-example/target/generated-sources/drools-model-compiler/main/java/./org/kie/firealarm/PD0/LambdaPredicateD0D10C330E24C798AB29B50316181DA1.java
      [INFO] Generating /Users/mmortari/git/droolsjbpm-integration/kie-maven-plugin-example/target/generated-sources/drools-model-compiler/main/java/./org/acme/test_generateModel_kjararchetype/Rules58cc6133a88c41de80943de1b39e3585.java
      [INFO] Generating /Users/mmortari/git/droolsjbpm-integration/kie-maven-plugin-example/target/generated-sources/drools-model-compiler/main/java/./org/kie/example/FactA.java
      [INFO] Generating /Users/mmortari/git/droolsjbpm-integration/kie-maven-plugin-example/target/generated-sources/drools-model-compiler/main/java/./org/kie/example/P4D/LambdaExtractor4D55E2E04863B396216330AEDCAD1569.java
      [INFO] Generating /Users/mmortari/git/droolsjbpm-integration/kie-maven-plugin-example/target/generated-sources/drools-model-compiler/main/java/./org/kie/example/PA9/LambdaPredicateA93B7F5E8D7190496BC805E26AB3F457.java
      [INFO] Generating /Users/mmortari/git/droolsjbpm-integration/kie-maven-plugin-example/target/generated-sources/drools-model-compiler/main/java/./org/kie/firealarm/PBE/LambdaExtractorBEF0BEA5560B29CBC89C4FC70B9C6D9D.java
      [INFO] Generating /Users/mmortari/git/droolsjbpm-integration/kie-maven-plugin-example/target/generated-sources/drools-model-compiler/main/java/./org/kie/firealarm/PD1/LambdaExtractorD1AAF936ED8E4AEEE13080EE8245A712.java
      [INFO] Generating /Users/mmortari/git/droolsjbpm-integration/kie-maven-plugin-example/target/generated-sources/drools-model-compiler/main/java/./org/kie/example/P57/LambdaExtractor57699C62EC50788820BA4075F6A28AE6.java
      [INFO] Generating /Users/mmortari/git/droolsjbpm-integration/kie-maven-plugin-example/target/generated-sources/drools-model-compiler/main/java/./org/kie/firealarm/P40/LambdaPredicate403C96BCAA32F72ADA05B19CC1ADBEB2.java
      [INFO] Generating /Users/mmortari/git/droolsjbpm-integration/kie-maven-plugin-example/target/generated-sources/drools-model-compiler/main/java/./org/kie/example/FactB.java
      [INFO] Generating /Users/mmortari/git/droolsjbpm-integration/kie-maven-plugin-example/target/generated-sources/drools-model-compiler/main/java/./org/acme/test_generateModel_kjararchetype/Rules58cc6133a88c41de80943de1b39e3585RuleMethods0.java
      [INFO] Generating /Users/mmortari/git/droolsjbpm-integration/kie-maven-plugin-example/target/generated-sources/drools-model-compiler/main/java/./org/kie/firealarm/PD5/LambdaConsequenceD5F3898CC43A37A798CA2E0DEAB2CEB4.java
      [INFO] Generating /Users/mmortari/git/droolsjbpm-integration/kie-maven-plugin-example/target/generated-sources/drools-model-compiler/main/java/./org/kie/firealarm/P99/LambdaPredicate995D77A8EF2B24CA352A136704291984.java
      [INFO] Generating /Users/mmortari/git/droolsjbpm-integration/kie-maven-plugin-example/target/generated-sources/drools-model-compiler/main/java/./org/acme/test_generateModel_kjararchetype/P5A/LambdaConsequence5A1A7E4CF87C795DC59A8363371B8CE2.java
      [INFO] Generating /Users/mmortari/git/droolsjbpm-integration/kie-maven-plugin-example/target/generated-sources/drools-model-compiler/main/java/./org/kie/firealarm/P6B/LambdaConsequence6B7C3E3CA04C944169886E6E213AC0BD.java
      [INFO] Generating /Users/mmortari/git/droolsjbpm-integration/kie-maven-plugin-example/target/generated-sources/drools-model-compiler/main/java/./org/kie/firealarm/PC7/LambdaConsequenceC7E285F358A4D3AD09E21A8F3D321D55.java
      [INFO] Generating /Users/mmortari/git/droolsjbpm-integration/kie-maven-plugin-example/target/generated-sources/drools-model-compiler/main/java/./org/kie/firealarm/PE8/LambdaExtractorE84DAABE5D3F16E8E69999DC112E2009.java
      [INFO] Generating /Users/mmortari/git/droolsjbpm-integration/kie-maven-plugin-example/target/generated-sources/drools-model-compiler/main/java/./org/kie/example/Rules88d814b4ebe641c58821fd70dab846a5.java
      [INFO] Generating /Users/mmortari/git/droolsjbpm-integration/kie-maven-plugin-example/target/generated-sources/drools-model-compiler/main/java/./org/kie/firealarm/PFF/LambdaExtractorFFC29BD91606D6EE3BFE77BA2739B262.java
      [INFO] Generating /Users/mmortari/git/droolsjbpm-integration/kie-maven-plugin-example/target/generated-sources/drools-model-compiler/main/java/./org/acme/test_generateModel_kjararchetype/P33/LambdaExtractor338B6BF83B0E840B16074D6B7DC05F5E.java
      [INFO] Generating /Users/mmortari/git/droolsjbpm-integration/kie-maven-plugin-example/target/generated-sources/drools-model-compiler/main/java/./org/kie/firealarm/Rulesd1f96973064a44cabb6a83fbe9979fa0RuleMethods0.java
      [INFO] Generating /Users/mmortari/git/droolsjbpm-integration/kie-maven-plugin-example/target/generated-sources/drools-model-compiler/main/java/./org/acme/test_generateModel_kjararchetype/PF1/LambdaPredicateF1676D603D66F7F6A116F4D6C8760F76.java
      [INFO] Generating /Users/mmortari/git/droolsjbpm-integration/kie-maven-plugin-example/target/generated-sources/drools-model-compiler/main/java/./org/acme/test_generateModel_kjararchetype/P23/LambdaExtractor2320785F70F7E8677188D3E84D56AEAC.java
      [INFO] Generating /Users/mmortari/git/droolsjbpm-integration/kie-maven-plugin-example/target/generated-sources/drools-model-compiler/main/java/./org/kie/firealarm/P10/LambdaPredicate100D2C06CA08502866BCD5764D55E146.java
      [INFO] Generating /Users/mmortari/git/droolsjbpm-integration/kie-maven-plugin-example/target/generated-sources/drools-model-compiler/main/java/./org/kie/example/DomainClassesMetadata88d814b4ebe641c58821fd70dab846a5.java
      [INFO] Generating /Users/mmortari/git/droolsjbpm-integration/kie-maven-plugin-example/target/generated-sources/drools-model-compiler/main/java/./org/kie/firealarm/PC7/LambdaConsequenceC73928745AC647142A4A98CC7D45D334.java
      [INFO] Generating /Users/mmortari/git/droolsjbpm-integration/kie-maven-plugin-example/target/generated-sources/drools-model-compiler/main/java/./org/kie/firealarm/PC4/LambdaPredicateC4023187C0F98EA3ABBF5261828864D9.java
      [INFO] Generating /Users/mmortari/git/droolsjbpm-integration/kie-maven-plugin-example/target/generated-sources/drools-model-compiler/main/java/./org/kie/example/Rules88d814b4ebe641c58821fd70dab846a5RuleMethods0.java
      [INFO] Generating /Users/mmortari/git/droolsjbpm-integration/kie-maven-plugin-example/target/generated-sources/drools-model-compiler/main/java/./org/kie/firealarm/Rulesd1f96973064a44cabb6a83fbe9979fa0.java
      [INFO] DSL successfully generated
      [INFO] 
      

      then we get the classic BuildMojo kicking in:

      and from the log:

      [INFO] --- kie-maven-plugin:7.44.0-SNAPSHOT:build (default-build) @ kie-maven-plugin-example ---
      [INFO] Artifact not fetched from maven: org.drools:drools-model-compiler:7.44.0-SNAPSHOT. To enable the KieScanner you need kie-ci on the classpath
      [INFO] Artifact not fetched from maven: org.drools:drools-canonical-model:7.44.0-SNAPSHOT. To enable the KieScanner you need kie-ci on the classpath
      [INFO] Artifact not fetched from maven: org.drools:drools-compiler:7.44.0-SNAPSHOT. To enable the KieScanner you need kie-ci on the classpath
      [INFO] Artifact not fetched from maven: org.kie:kie-dmn-backend:7.44.0-SNAPSHOT. To enable the KieScanner you need kie-ci on the classpath
      [INFO] Artifact not fetched from maven: org.kie:kie-dmn-feel:7.44.0-SNAPSHOT. To enable the KieScanner you need kie-ci on the classpath
      [INFO] Artifact not fetched from maven: org.kie:kie-dmn-api:7.44.0-SNAPSHOT. To enable the KieScanner you need kie-ci on the classpath
      [INFO] Artifact not fetched from maven: org.drools:drools-core:7.44.0-SNAPSHOT. To enable the KieScanner you need kie-ci on the classpath
      [INFO] Artifact not fetched from maven: org.kie:kie-dmn-model:7.44.0-SNAPSHOT. To enable the KieScanner you need kie-ci on the classpath
      [INFO] Artifact not fetched from maven: org.kie:kie-dmn-core:7.44.0-SNAPSHOT. To enable the KieScanner you need kie-ci on the classpath
      [INFO] Artifact not fetched from maven: org.kie:kie-api:7.44.0-SNAPSHOT. To enable the KieScanner you need kie-ci on the classpath
      [INFO] kieMap not present
      [INFO] KieModule successfully built!
      [INFO] 
      

      So the KJAR project is actually built twice

        1. screenshot-1.png
          screenshot-1.png
          713 kB
        2. screenshot-2.png
          screenshot-2.png
          706 kB
        3. log.txt
          85 kB
        4. Screenshot 2020-09-23 at 12.16.06.png
          Screenshot 2020-09-23 at 12.16.06.png
          1.31 MB

              mmortari@redhat.com Matteo Mortari
              mmortari@redhat.com Matteo Mortari
              Daniel Rosa Daniel Rosa
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: