This is an automated email from the ASF dual-hosted git repository.
rikkola pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-kie-drools.git
The following commit(s) were added to refs/heads/main by this push:
new 7dee28ce41 issues/2139 (#6479)
7dee28ce41 is described below
commit 7dee28ce41fd5acade93491d628f14f23a94ca4b
Author: Toni Rikkola <[email protected]>
AuthorDate: Tue Oct 14 13:21:49 2025 +0300
issues/2139 (#6479)
Fix kie-yard build and dependencies
- Remove unavailable jshell-scriptengine dependency and replace with MVEL
- Fix dependency inheritance by removing duplicate declarations from parent
pom
- Add proper java.module.name properties for Java 9+ module system
- Convert jshell expressions to MVEL-compatible syntax in test files
- Add jackson-dataformat-xml back with proper version management
- Clean up redundant pom.xml configurations and empty build sections
Complete kie-yard dependency fixes
- Add jackson-dataformat-xml to parent dependency management
- Add java.module.name property to kie-yard-api module
- Add newlines to end of pom.xml files
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-authored-by: Claude <[email protected]>
---
kie-yard/kie-yard-api/pom.xml | 5 +-
kie-yard/kie-yard-core/pom.xml | 11 +--
.../core/JShellLiteralExpressionInterpreter.java | 76 ---------------
.../kie/yard/core/LiteralExpressionBuilder.java | 7 +-
.../src/test/resources/extra-costs.yml | 8 +-
.../resources/scorecards/README-health-card.yml | 2 +-
.../scorecards/branch-responsibilities.yml | 2 +-
.../scorecards/drafts/branch-blocked-card.yml | 2 +-
.../scorecards/drafts/closed-prs-card.yml | 2 +-
.../resources/scorecards/drafts/open-prs-card.yml | 2 +-
.../drafts/weekly-branch-health-card.yml | 2 +-
.../scorecards/git-repository-health-card.yml | 2 +-
.../resources/scorecards/resource-limits-card.yml | 3 +-
kie-yard/pom.xml | 102 +++++----------------
14 files changed, 40 insertions(+), 186 deletions(-)
diff --git a/kie-yard/kie-yard-api/pom.xml b/kie-yard/kie-yard-api/pom.xml
index c75a159e60..254d0dd82c 100644
--- a/kie-yard/kie-yard-api/pom.xml
+++ b/kie-yard/kie-yard-api/pom.xml
@@ -35,12 +35,10 @@
<properties>
<java.module.name>org.kie.yard.api</java.module.name>
- <maven.compiler.release>17</maven.compiler.release>
</properties>
<dependencies>
-
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
@@ -55,5 +53,6 @@
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-xml</artifactId>
</dependency>
+
</dependencies>
-</project>
\ No newline at end of file
+</project>
diff --git a/kie-yard/kie-yard-core/pom.xml b/kie-yard/kie-yard-core/pom.xml
index 589d5101fb..a96aeae391 100644
--- a/kie-yard/kie-yard-core/pom.xml
+++ b/kie-yard/kie-yard-core/pom.xml
@@ -34,7 +34,6 @@
<properties>
<java.module.name>org.kie.yard.core</java.module.name>
- <maven.compiler.release>17</maven.compiler.release>
</properties>
<dependencies>
@@ -47,10 +46,6 @@
<artifactId>drools-ruleunits-dsl</artifactId>
</dependency>
- <dependency>
- <groupId>ch.obermuhlner</groupId>
- <artifactId>jshell-scriptengine</artifactId>
- </dependency>
<dependency>
<groupId>org.mvel</groupId>
<artifactId>mvel2</artifactId>
@@ -88,8 +83,4 @@
<scope>test</scope>
</dependency>
</dependencies>
- <build>
- <plugins>
- </plugins>
- </build>
-</project>
\ No newline at end of file
+</project>
diff --git
a/kie-yard/kie-yard-core/src/main/java/org/kie/yard/core/JShellLiteralExpressionInterpreter.java
b/kie-yard/kie-yard-core/src/main/java/org/kie/yard/core/JShellLiteralExpressionInterpreter.java
deleted file mode 100644
index eca81a063d..0000000000
---
a/kie-yard/kie-yard-core/src/main/java/org/kie/yard/core/JShellLiteralExpressionInterpreter.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.kie.yard.core;
-
-import java.util.Map;
-import java.util.Map.Entry;
-
-import javax.script.Bindings;
-import javax.script.Compilable;
-import javax.script.CompiledScript;
-import javax.script.ScriptEngine;
-import javax.script.ScriptEngineManager;
-import javax.script.ScriptException;
-
-public class JShellLiteralExpressionInterpreter implements Firable {
-
- private final String name;
- private final QuotedExprParsed quoted;
- private final ScriptEngine engine;
- private final CompiledScript compiledScript;
-
- public JShellLiteralExpressionInterpreter(final String nameString,
- final QuotedExprParsed
quotedExprParsed) {
- this.name = nameString;
- this.quoted = quotedExprParsed;
- try {
- final ScriptEngineManager manager = new ScriptEngineManager();
- engine = manager.getEngineByName("jshell");
- final Compilable compiler = (Compilable) engine;
- compiledScript = compiler.compile(quoted.getRewrittenExpression());
- } catch (Exception e) {
- throw new IllegalArgumentException("parse error", e);
- }
- }
-
- @Override
- public int fire(final Map<String, Object> context,
- final YaRDDefinitions units) {
- final Bindings bindings = engine.createBindings();
- // deliberately escape all symbols; a normal symbol will
- // never be in the detected-by-unquoting set, so this
- // set can't be used to selectively put in scope
- for (Entry<String, Object> inKV : context.entrySet()) {
- bindings.put(QuotedExprParsed.escapeIdentifier(inKV.getKey()),
inKV.getValue());
- }
- for (Entry<String, StoreHandle<Object>> outKV :
units.outputs().entrySet()) {
- if (!outKV.getValue().isValuePresent()) {
- continue;
- }
- bindings.put(QuotedExprParsed.escapeIdentifier(outKV.getKey()),
outKV.getValue().get());
- }
- try {
- var result = compiledScript.eval(bindings);
- units.outputs().get(name).set(result);
- return 1;
- } catch (ScriptException e) {
- throw new RuntimeException("interpretation failed at runtime", e);
- }
- }
-}
diff --git
a/kie-yard/kie-yard-core/src/main/java/org/kie/yard/core/LiteralExpressionBuilder.java
b/kie-yard/kie-yard-core/src/main/java/org/kie/yard/core/LiteralExpressionBuilder.java
index f81eefbe1f..e398dbdd25 100644
---
a/kie-yard/kie-yard-core/src/main/java/org/kie/yard/core/LiteralExpressionBuilder.java
+++
b/kie-yard/kie-yard-core/src/main/java/org/kie/yard/core/LiteralExpressionBuilder.java
@@ -42,11 +42,6 @@ public class LiteralExpressionBuilder {
public Firable build() {
final String expr = decisionLogic.getExpression();
definitions.outputs().put(name, StoreHandle.empty(Object.class));
- if(Objects.equals(expressionLang, "jshell")){
- return new JShellLiteralExpressionInterpreter(name,
QuotedExprParsed.from(expr));
- }
- else {
- return new
MVELLiteralExpressionInterpreter(name,QuotedExprParsed.from(expr));
- }
+ return new MVELLiteralExpressionInterpreter(name,
QuotedExprParsed.from(expr));
}
}
diff --git a/kie-yard/kie-yard-core/src/test/resources/extra-costs.yml
b/kie-yard/kie-yard-core/src/test/resources/extra-costs.yml
index e75edbebc6..3073265938 100644
--- a/kie-yard/kie-yard-core/src/test/resources/extra-costs.yml
+++ b/kie-yard/kie-yard-core/src/test/resources/extra-costs.yml
@@ -18,7 +18,7 @@
specVersion: alpha
kind: YaRD
name: "Traffic Violation"
-expressionLang: jshell
+expressionLang: mvel
inputs:
- name: Fragile
type: boolean
@@ -59,6 +59,10 @@ elements:
logic:
type: LiteralExpression
expression: |
- ((java.util.List<java.util.Map<String,Integer>>)`Selected
premiums`).stream().map(m -> m.get("Price")).mapToInt(Integer::valueOf).sum();
+ sum = 0;
+ foreach (item : `Selected premiums`) {
+ sum += item.Price;
+ }
+ sum;
# Feels filthy compared to FEEL below
# expression: 'sum( for item in Selected premiums return item.Price )'
diff --git
a/kie-yard/kie-yard-core/src/test/resources/scorecards/README-health-card.yml
b/kie-yard/kie-yard-core/src/test/resources/scorecards/README-health-card.yml
index a95a4cbe6b..c746c7b931 100644
---
a/kie-yard/kie-yard-core/src/test/resources/scorecards/README-health-card.yml
+++
b/kie-yard/kie-yard-core/src/test/resources/scorecards/README-health-card.yml
@@ -18,7 +18,7 @@
specVersion: alpha
kind: YaRD
name: "Git Repository Completeness"
-expressionLang: jshell
+expressionLang: mvel
inputs:
- name: "README"
type: string
diff --git
a/kie-yard/kie-yard-core/src/test/resources/scorecards/branch-responsibilities.yml
b/kie-yard/kie-yard-core/src/test/resources/scorecards/branch-responsibilities.yml
index 73aab9a9a7..ab620104e9 100644
---
a/kie-yard/kie-yard-core/src/test/resources/scorecards/branch-responsibilities.yml
+++
b/kie-yard/kie-yard-core/src/test/resources/scorecards/branch-responsibilities.yml
@@ -18,7 +18,7 @@
specVersion: alpha
kind: YaRD
name: "Branch responsibilities"
-expressionLang: jshell
+expressionLang: mvel
inputs:
- name: "Main POM"
type: 'http://myapi.org/jsonSchema.json#POM'
diff --git
a/kie-yard/kie-yard-core/src/test/resources/scorecards/drafts/branch-blocked-card.yml
b/kie-yard/kie-yard-core/src/test/resources/scorecards/drafts/branch-blocked-card.yml
index 311fea6496..2a51908ae5 100644
---
a/kie-yard/kie-yard-core/src/test/resources/scorecards/drafts/branch-blocked-card.yml
+++
b/kie-yard/kie-yard-core/src/test/resources/scorecards/drafts/branch-blocked-card.yml
@@ -18,7 +18,7 @@
specVersion: alpha
kind: YaRD
name: "Main broken"
-expressionLang: jshell
+expressionLang: mvel
inputs:
- name: "Creator"
type: string
diff --git
a/kie-yard/kie-yard-core/src/test/resources/scorecards/drafts/closed-prs-card.yml
b/kie-yard/kie-yard-core/src/test/resources/scorecards/drafts/closed-prs-card.yml
index 54e60a4b99..8e040c0206 100644
---
a/kie-yard/kie-yard-core/src/test/resources/scorecards/drafts/closed-prs-card.yml
+++
b/kie-yard/kie-yard-core/src/test/resources/scorecards/drafts/closed-prs-card.yml
@@ -18,7 +18,7 @@
specVersion: alpha
kind: YaRD
name: "Closed PRs"
-expressionLang: jshell
+expressionLang: mvel
inputs:
- name: "Creator"
type: string
diff --git
a/kie-yard/kie-yard-core/src/test/resources/scorecards/drafts/open-prs-card.yml
b/kie-yard/kie-yard-core/src/test/resources/scorecards/drafts/open-prs-card.yml
index af95895bf9..e81407a021 100644
---
a/kie-yard/kie-yard-core/src/test/resources/scorecards/drafts/open-prs-card.yml
+++
b/kie-yard/kie-yard-core/src/test/resources/scorecards/drafts/open-prs-card.yml
@@ -18,7 +18,7 @@
specVersion: alpha
kind: YaRD
name: "Open PRs"
-expressionLang: jshell
+expressionLang: mvel
inputs:
- name: "Creator"
type: string
diff --git
a/kie-yard/kie-yard-core/src/test/resources/scorecards/drafts/weekly-branch-health-card.yml
b/kie-yard/kie-yard-core/src/test/resources/scorecards/drafts/weekly-branch-health-card.yml
index 617eec9e80..e5f302fab4 100644
---
a/kie-yard/kie-yard-core/src/test/resources/scorecards/drafts/weekly-branch-health-card.yml
+++
b/kie-yard/kie-yard-core/src/test/resources/scorecards/drafts/weekly-branch-health-card.yml
@@ -18,7 +18,7 @@
specVersion: alpha
kind: YaRD
name: "Main broken"
-expressionLang: jshell
+expressionLang: mvel
inputs:
- name: "Creator"
type: string
diff --git
a/kie-yard/kie-yard-core/src/test/resources/scorecards/git-repository-health-card.yml
b/kie-yard/kie-yard-core/src/test/resources/scorecards/git-repository-health-card.yml
index a733aef960..965cb02924 100644
---
a/kie-yard/kie-yard-core/src/test/resources/scorecards/git-repository-health-card.yml
+++
b/kie-yard/kie-yard-core/src/test/resources/scorecards/git-repository-health-card.yml
@@ -18,7 +18,7 @@
specVersion: alpha
kind: YaRD
name: "Git Repository Completeness"
-expressionLang: jshell
+expressionLang: mvel
inputs:
- name: "Repository Data"
type: 'http://myapi.org/jsonSchema.json#GitRepositoryData'
diff --git
a/kie-yard/kie-yard-core/src/test/resources/scorecards/resource-limits-card.yml
b/kie-yard/kie-yard-core/src/test/resources/scorecards/resource-limits-card.yml
index e5dbe51e8c..c7d749f47f 100644
---
a/kie-yard/kie-yard-core/src/test/resources/scorecards/resource-limits-card.yml
+++
b/kie-yard/kie-yard-core/src/test/resources/scorecards/resource-limits-card.yml
@@ -18,7 +18,7 @@
specVersion: alpha
kind: YaRD
name: "Resource Limits"
-expressionLang: jshell
+expressionLang: mvel
inputs:
- name: "CPU Count"
type: number
@@ -33,7 +33,6 @@ elements:
type: Decision
logic:
type: LiteralExpression
- # With JShell this does not work, but this can be done with a Java
oneliner
expression: |
`Run Started` -`Run Ended`
- name: Fitting profiles
diff --git a/kie-yard/pom.xml b/kie-yard/pom.xml
index 2bc15d5c3d..61ebf7dc5c 100644
--- a/kie-yard/pom.xml
+++ b/kie-yard/pom.xml
@@ -1,4 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
@@ -18,94 +37,17 @@
<name>KIE :: Yard - YAML Rules DSL</name>
<description>Yet another Rules DSL (YaRD) - A YAML-based domain-specific
language for defining business rules</description>
- <url>http://drools.org</url>
- <inceptionYear>2022</inceptionYear>
- <organization>
- <name>JBoss by Red Hat</name>
- <url>http://www.jboss.org/</url>
- </organization>
-
- <licenses>
- <license>
- <name>Apache Software License, Version 2.0</name>
- <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
- <distribution>repo</distribution>
- </license>
- </licenses>
-
- <scm>
- <connection>scm:git:https://github.com/kiegroup/yard.git</connection>
-
<developerConnection>scm:git:[email protected]:kiegroup/yard.git</developerConnection>
- <url>https://github.com/kiegroup/yard</url>
- </scm>
-
- <developers>
- <developer>
- <name>All developers are listed in the KIE GitHub
organization</name>
- <url>https://github.com/orgs/kiegroup/people</url>
- </developer>
- </developers>
-
- <properties>
-
- <maven.compiler.source>17</maven.compiler.source>
- <maven.compiler.target>17</maven.compiler.target>
- <maven.compiler.release>17</maven.compiler.release>
-
-
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
- <version.org.drools>8.44.0.Final</version.org.drools>
- <version.jackson>2.15.2</version.jackson>
- <version.jshell>1.1.0</version.jshell>
-
<version.org.glassfish.jakarta.json>2.0.1</version.org.glassfish.jakarta.json>
- </properties>
-
- <!-- distributionManagement section -->
- <distributionManagement>
- <repository>
- <id>jboss-releases-repository</id>
- <name>JBoss Releases Repository</name>
-
<url>https://repository.jboss.org/nexus/service/local/staging/deploy/maven2/</url>
- </repository>
- <snapshotRepository>
- <id>jboss-snapshots-repository</id>
- <name>JBoss Snapshot Repository</name>
-
<url>https://repository.jboss.org/nexus/content/repositories/snapshots/</url>
- </snapshotRepository>
- </distributionManagement>
-
<dependencyManagement>
<dependencies>
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-databind</artifactId>
- <version>${version.jackson}</version>
- </dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.dataformat</groupId>
- <artifactId>jackson-dataformat-yaml</artifactId>
- <version>${version.jackson}</version>
- </dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.dataformat</groupId>
- <artifactId>jackson-dataformat-xml</artifactId>
- <version>${version.jackson}</version>
- </dependency>
<dependency>
<groupId>org.kie</groupId>
<artifactId>kie-yard-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
- <groupId>org.drools</groupId>
- <artifactId>drools-ruleunits-dsl</artifactId>
- <version>${version.org.drools}</version>
- </dependency>
- <dependency>
- <groupId>ch.obermuhlner</groupId>
- <artifactId>jshell-scriptengine</artifactId>
- <version>${version.jshell}</version>
+ <groupId>com.fasterxml.jackson.dataformat</groupId>
+ <artifactId>jackson-dataformat-xml</artifactId>
+ <version>${version.com.fasterxml.jackson}</version>
</dependency>
</dependencies>
</dependencyManagement>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]