Skip to content

Commit fec28c2

Browse files
gitgabrioGabriele-Cardosi
and
Gabriele-Cardosi
authored
[NO ISSUE] Reorganize plain java examples (#2034)
* [NO ISSUE] Reorganizing java examples * [NO ISSUE] Reorganizing java examples * [NO ISSUE] Fixing ci * [NO ISSUE] Fix as per PR suggestion --------- Co-authored-by: Gabriele-Cardosi <[email protected]>
1 parent e492400 commit fec28c2

File tree

25 files changed

+53
-28
lines changed

25 files changed

+53
-28
lines changed

Diff for: .ci/jenkins/Jenkinsfile.deploy

+1-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ pipeline {
162162
getMavenCommand()
163163
.withOptions(env.BUILD_MVN_OPTS_CURRENT ? [ env.BUILD_MVN_OPTS_CURRENT ] : [])
164164
.withOptions(env.KOGITO_EXAMPLES_BUILD_MVN_OPTS ? [ env.KOGITO_EXAMPLES_BUILD_MVN_OPTS ] : [])
165-
.withOptions("-pl .,kogito-quarkus-examples,kogito-springboot-examples,serverless-workflow-examples")
165+
.withOptions("-pl .,kogito-java-examples,kogito-quarkus-examples,kogito-springboot-examples,serverless-workflow-examples")
166166
.skipTests(true)
167167
.withSettingsXmlFile(MAVEN_SETTINGS_FILE)
168168
.run("deploy -DdeployAtEnd -Dapache.repository.username=${REPOSITORY_USER} -Dapache.repository.password=${REPOSITORY_TOKEN} -DretryFailedDeploymentCount=5")

Diff for: .ci/jenkins/dsl/jobs.groovy

+9
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,15 @@ Map getMultijobPRConfig(JenkinsFolder jobFolder) {
4646
parallel: true,
4747
buildchain: true,
4848
jobs : [
49+
[
50+
id: 'kogito-java-examples',
51+
primary: true,
52+
env : [
53+
// Sonarcloud analysis is disabled for examples
54+
KOGITO_EXAMPLES_SUBFOLDER_POM: 'kogito-java-examples/',
55+
BUILD_MVN_OPTS_CURRENT: "${defaultBuildMvnOptsCurrent} ${getExamplesBuildMvnOptions(jobFolder).join(' ')}",
56+
]
57+
],
4958
[
5059
id: 'kogito-quarkus-examples',
5160
primary: true,

Diff for: .github/workflows/pr-kogito-examples.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,14 @@ jobs:
2020
timeout-minutes: 180
2121
strategy:
2222
matrix:
23-
job_name: [ kogito-quarkus-examples, kogito-springboot-examples, serverless-workflow-examples ]
23+
job_name: [ kogito-java-examples, kogito-quarkus-examples, kogito-springboot-examples, serverless-workflow-examples ]
2424
os: [ubuntu-latest]
2525
java-version: [17]
2626
maven-version: ['3.9.6']
2727
include:
28+
- job_name: kogito-java-examples
29+
repository: incubator-kie-kogito-examples
30+
env_KOGITO_EXAMPLES_SUBFOLDER_POM: kogito-java-examples/
2831
- job_name: kogito-quarkus-examples
2932
repository: incubator-kie-kogito-examples
3033
env_KOGITO_EXAMPLES_SUBFOLDER_POM: kogito-quarkus-examples/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# decisions-embedded-mode-example
2+
3+
Is an example of running DMN decisions using plain java. This is an example decision for approving and declining the loan application. Please notice, the decision is only example that do not cover all cases from the banking domain.
4+
5+
## Execute
6+
Simply run the main class `org.kie.kogito.decisions.embedded.DecisionsEmbeddedModeExample` either from the IDE or your command line.

Diff for: kogito-quarkus-examples/decisions-embedded-mode-example/pom.xml renamed to kogito-java-examples/dmn-embedded-mode-example/pom.xml

+3-10
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@
2222
<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/xsd/maven-4.0.0.xsd">
2323
<modelVersion>4.0.0</modelVersion>
2424
<groupId>org.kie.kogito.decisions.embedded</groupId>
25-
<artifactId>decisions-embedded-mode-example</artifactId>
26-
<name>Kogito Example :: Decision Embedded Mode</name>
25+
<artifactId>dmn-embedded-mode-example</artifactId>
26+
<name>Kogito Example :: DMN Embedded Mode</name>
2727
<version>999-SNAPSHOT</version>
2828
<packaging>kjar</packaging>
29+
2930
<properties>
3031
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
3132
<maven.compiler.source>17</maven.compiler.source>
@@ -38,19 +39,11 @@
3839
<version.kogito.bom>999-SNAPSHOT</version.kogito.bom>
3940
<version.org.kie>999-SNAPSHOT</version.org.kie>
4041

41-
<version.quarkus.platform>3.8.6</version.quarkus.platform>
4242
<version.org.slf4j>2.0.13</version.org.slf4j>
4343
</properties>
4444

4545
<dependencyManagement>
4646
<dependencies>
47-
<dependency>
48-
<groupId>io.quarkus</groupId>
49-
<artifactId>quarkus-bom</artifactId>
50-
<version>${version.quarkus.platform}</version>
51-
<type>pom</type>
52-
<scope>import</scope>
53-
</dependency>
5447
<dependency>
5548
<groupId>org.drools</groupId>
5649
<artifactId>drools-bom</artifactId>

Diff for: kogito-java-examples/pom.xml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
<parent>
7+
<groupId>org.kie.kogito.examples</groupId>
8+
<artifactId>kogito-examples</artifactId>
9+
<version>999-SNAPSHOT</version>
10+
</parent>
11+
12+
<artifactId>kogito-java-examples</artifactId>
13+
<packaging>pom</packaging>
14+
<name>Kogito Example :: Java</name>
15+
16+
<profiles>
17+
<profile>
18+
<id>default</id>
19+
<activation>
20+
<activeByDefault>true</activeByDefault>
21+
</activation>
22+
<modules>
23+
<module>dmn-embedded-mode-example</module>
24+
<module>rules-embedded-mode-example</module>
25+
</modules>
26+
</profile>
27+
</profiles>
28+
29+
</project>

Diff for: kogito-quarkus-examples/rules-embedded-mode-example/pom.xml renamed to kogito-java-examples/rules-embedded-mode-example/pom.xml

-8
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,11 @@
3838
<version.kogito.bom>999-SNAPSHOT</version.kogito.bom>
3939
<version.org.kie>999-SNAPSHOT</version.org.kie>
4040

41-
<version.quarkus.platform>3.8.6</version.quarkus.platform>
4241
<version.org.slf4j>2.0.13</version.org.slf4j>
4342
</properties>
4443

4544
<dependencyManagement>
4645
<dependencies>
47-
<dependency>
48-
<groupId>io.quarkus</groupId>
49-
<artifactId>quarkus-bom</artifactId>
50-
<version>${version.quarkus.platform}</version>
51-
<type>pom</type>
52-
<scope>import</scope>
53-
</dependency>
5446
<dependency>
5547
<groupId>org.drools</groupId>
5648
<artifactId>drools-bom</artifactId>

Diff for: kogito-quarkus-examples/decisions-embedded-mode-example/README.md

-6
This file was deleted.

Diff for: kogito-quarkus-examples/pom.xml

-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
</activation>
5151
<modules>
5252
<module>decisiontable-quarkus-example</module>
53-
<module>decisions-embedded-mode-example</module>
5453
<module>dmn-15-quarkus-example</module>
5554
<module>dmn-drools-quarkus-metrics</module>
5655
<module>dmn-event-driven-quarkus</module>
@@ -100,7 +99,6 @@
10099
<module>process-usertasks-timer-quarkus-with-console</module>
101100
<module>process-usertasks-with-security-oidc-quarkus</module>
102101
<module>process-usertasks-with-security-quarkus</module>
103-
<module>rules-embedded-mode-example</module>
104102
<module>rules-incubation-api-quarkus</module>
105103
<module>rules-legacy-quarkus-example</module>
106104
<module>rules-legacy-scesim-quarkus-example</module>

Diff for: pom.xml

+1
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@
137137
<activeByDefault>true</activeByDefault>
138138
</activation>
139139
<modules>
140+
<module>kogito-java-examples</module>
140141
<module>kogito-quarkus-examples</module>
141142
<module>kogito-springboot-examples</module>
142143
<module>serverless-workflow-examples</module>

0 commit comments

Comments
 (0)