From 12c9462a682d88d29a09f0d0633361c95286c031 Mon Sep 17 00:00:00 2001 From: khalilmalla95 Date: Tue, 10 Mar 2026 16:19:55 +0100 Subject: [PATCH 01/20] Add dsf-linter integration as lint goal in dsf-maven-plugin Integrates the dsf-linter library (0.1.2) into the Maven build by adding a new lint Mojo that validates BPMN, FHIR and plugin configurations from built JAR files. Enabled for test-plugin-v1 and test-plugin-v2. --- dsf-bpe/dsf-bpe-test-plugin-v1/pom.xml | 39 +++-- dsf-bpe/dsf-bpe-test-plugin-v2/pom.xml | 35 +++-- dsf-maven/dsf-maven-plugin/pom.xml | 7 +- .../dev/dsf/maven/linter/LintPluginMojo.java | 141 ++++++++++++++++++ .../dsf/maven/linter/MavenLinterLogger.java | 74 +++++++++ pom.xml | 10 +- 6 files changed, 274 insertions(+), 32 deletions(-) create mode 100644 dsf-maven/dsf-maven-plugin/src/main/java/dev/dsf/maven/linter/LintPluginMojo.java create mode 100644 dsf-maven/dsf-maven-plugin/src/main/java/dev/dsf/maven/linter/MavenLinterLogger.java diff --git a/dsf-bpe/dsf-bpe-test-plugin-v1/pom.xml b/dsf-bpe/dsf-bpe-test-plugin-v1/pom.xml index 59a322ca5..eba0be72c 100644 --- a/dsf-bpe/dsf-bpe-test-plugin-v1/pom.xml +++ b/dsf-bpe/dsf-bpe-test-plugin-v1/pom.xml @@ -49,21 +49,28 @@ - - - dev.dsf - dsf-maven-plugin - - - - generate-config-doc - - - - - dev.dsf.bpe.test.spring.config - - - + + + dev.dsf + dsf-maven-plugin + + + generate-config-doc + + generate-config-doc + + + + lint-plugin + + lint + + + + + dev.dsf.bpe.test.spring.config + + + \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-test-plugin-v2/pom.xml b/dsf-bpe/dsf-bpe-test-plugin-v2/pom.xml index 328ac2027..2132e7674 100644 --- a/dsf-bpe/dsf-bpe-test-plugin-v2/pom.xml +++ b/dsf-bpe/dsf-bpe-test-plugin-v2/pom.xml @@ -45,20 +45,27 @@ - - dev.dsf - dsf-maven-plugin - - - - generate-config-doc - - - - - dev.dsf.bpe.test.spring.config - - + + dev.dsf + dsf-maven-plugin + + + generate-config-doc + + generate-config-doc + + + + lint-plugin + + lint + + + + + dev.dsf.bpe.test.spring.config + + \ No newline at end of file diff --git a/dsf-maven/dsf-maven-plugin/pom.xml b/dsf-maven/dsf-maven-plugin/pom.xml index 396038382..eab0097cc 100644 --- a/dsf-maven/dsf-maven-plugin/pom.xml +++ b/dsf-maven/dsf-maven-plugin/pom.xml @@ -52,7 +52,12 @@ provided - + + dev.dsf.utils.linter + linter-core + + + dev.dsf dsf-bpe-process-api-v1 diff --git a/dsf-maven/dsf-maven-plugin/src/main/java/dev/dsf/maven/linter/LintPluginMojo.java b/dsf-maven/dsf-maven-plugin/src/main/java/dev/dsf/maven/linter/LintPluginMojo.java new file mode 100644 index 000000000..0cb760cf5 --- /dev/null +++ b/dsf-maven/dsf-maven-plugin/src/main/java/dev/dsf/maven/linter/LintPluginMojo.java @@ -0,0 +1,141 @@ +/* + * Copyright 2018-2025 Heilbronn University of Applied Sciences + * + * Licensed 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 dev.dsf.maven.linter; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Optional; + +import org.apache.maven.plugin.AbstractMojo; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; +import org.apache.maven.plugins.annotations.LifecyclePhase; +import org.apache.maven.plugins.annotations.Mojo; +import org.apache.maven.plugins.annotations.Parameter; +import org.apache.maven.plugins.annotations.ResolutionScope; + +import dev.dsf.linter.DsfLinter; +import dev.dsf.linter.DsfLinter.OverallLinterResult; +import dev.dsf.linter.input.InputResolver; +import dev.dsf.linter.input.InputResolver.ResolutionResult; +import dev.dsf.linter.logger.Logger; + +/** + * Lints DSF process plugin JAR files by validating BPMN processes, FHIR resources and plugin configurations. + *

+ * Runs after the JAR has been built (default phase: verify) and delegates to the + * DSF Linter core library. + */ +@Mojo(name = "lint", defaultPhase = LifecyclePhase.VERIFY, requiresDependencyResolution = ResolutionScope.NONE, threadSafe = true) +public class LintPluginMojo extends AbstractMojo +{ + @Parameter(defaultValue = "${project.build.directory}", readonly = true, required = true) + private File projectBuildDirectory; + + @Parameter(defaultValue = "${project.build.finalName}", readonly = true, required = true) + private String finalName; + + @Parameter(property = "dsf.lint.reportPath") + private File reportPath; + + @Parameter(property = "dsf.lint.html", defaultValue = "true") + private boolean generateHtmlReport; + + @Parameter(property = "dsf.lint.json", defaultValue = "true") + private boolean generateJsonReport; + + @Parameter(property = "dsf.lint.failOnErrors", defaultValue = "true") + private boolean failOnErrors; + + @Parameter(property = "dsf.lint.skip", defaultValue = "false") + private boolean skip; + + @Parameter(property = "dsf.lint.verbose", defaultValue = "false") + private boolean verbose; + + @Override + public void execute() throws MojoExecutionException, MojoFailureException + { + if (skip) + { + getLog().info("DSF Linter: skipped"); + return; + } + + Path jarPath = projectBuildDirectory.toPath().resolve(finalName + ".jar"); + + if (!Files.exists(jarPath)) + { + getLog().warn("DSF Linter: JAR not found at " + jarPath + ", skipping"); + return; + } + + Logger logger = new MavenLinterLogger(getLog(), verbose); + + InputResolver resolver = new InputResolver(logger); + Optional resolutionResult = resolver.resolve(jarPath.toString()); + + if (resolutionResult.isEmpty()) + { + throw new MojoExecutionException("DSF Linter: failed to resolve JAR file: " + jarPath); + } + + ResolutionResult resolution = resolutionResult.get(); + + try + { + Path lintReportPath = reportPath != null ? reportPath.toPath() + : projectBuildDirectory.toPath().resolve("dsf-linter-report"); + + Files.createDirectories(lintReportPath); + + DsfLinter.Config config = new DsfLinter.Config(resolution.resolvedPath().toAbsolutePath(), + lintReportPath.toAbsolutePath(), generateHtmlReport, generateJsonReport, failOnErrors, logger); + + OverallLinterResult result = new DsfLinter(config).lint(); + + if (!result.success()) + { + String msg = "DSF Linter: " + result.getTotalErrors() + " error(s), " + result.getPluginWarnings() + + " warning(s)"; + + if (failOnErrors) + { + throw new MojoFailureException(msg); + } + + getLog().warn(msg); + } + else + { + getLog().info("DSF Linter: passed - no errors found"); + } + } + catch (IOException e) + { + throw new MojoExecutionException("DSF Linter failed", e); + } + finally + { + if (resolution.requiresCleanup()) + { + resolver.cleanup(resolution); + } + } + } +} diff --git a/dsf-maven/dsf-maven-plugin/src/main/java/dev/dsf/maven/linter/MavenLinterLogger.java b/dsf-maven/dsf-maven-plugin/src/main/java/dev/dsf/maven/linter/MavenLinterLogger.java new file mode 100644 index 000000000..7e9b82e35 --- /dev/null +++ b/dsf-maven/dsf-maven-plugin/src/main/java/dev/dsf/maven/linter/MavenLinterLogger.java @@ -0,0 +1,74 @@ +/* + * Copyright 2018-2025 Heilbronn University of Applied Sciences + * + * Licensed 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 dev.dsf.maven.linter; + +import org.apache.maven.plugin.logging.Log; + +import dev.dsf.linter.logger.Logger; + +public class MavenLinterLogger implements Logger +{ + private final Log mavenLog; + private final boolean verboseMode; + + public MavenLinterLogger(Log mavenLog, boolean verboseMode) + { + this.mavenLog = mavenLog; + this.verboseMode = verboseMode; + } + + @Override + public void info(String message) + { + mavenLog.info(message); + } + + @Override + public void warn(String message) + { + mavenLog.warn(message); + } + + @Override + public void error(String message) + { + mavenLog.error(message); + } + + @Override + public void error(String message, Throwable throwable) + { + mavenLog.error(message, throwable); + } + + @Override + public void debug(String message) + { + mavenLog.debug(message); + } + + @Override + public boolean verbose() + { + return verboseMode; + } + + @Override + public boolean isVerbose() + { + return verboseMode; + } +} diff --git a/pom.xml b/pom.xml index cbf3de556..f93c07066 100755 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,8 @@ 3.8.0 5.2.1 5.2.1 - + 0.1.2 + DSF Parent POM Data Sharing Framework (DSF) @@ -507,6 +508,13 @@ 3.2.3 + + + dev.dsf.utils.linter + linter-core + ${dsf-linter.version} + + org.apache.maven From 9dd70ce2d74e8e583de976a7ee7f74e01ca2e44f Mon Sep 17 00:00:00 2001 From: khalilmalla95 Date: Wed, 29 Apr 2026 14:18:02 +0200 Subject: [PATCH 02/20] Update dsf-linter to version 0.1.3 in pom.xml --- pom.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index f93c07066..b9bec0162 100755 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,6 @@ 3.8.0 5.2.1 5.2.1 - 0.1.2 DSF Parent POM @@ -512,7 +511,7 @@ dev.dsf.utils.linter linter-core - ${dsf-linter.version} + 0.1.3 From 4acf1ca977361c1b2dac4f1163d21ca77ae2e08d Mon Sep 17 00:00:00 2001 From: khalilmalla95 Date: Wed, 29 Apr 2026 14:38:50 +0200 Subject: [PATCH 03/20] Change default values for HTML and JSON report generation to false in LintPluginMojo --- .../src/main/java/dev/dsf/maven/linter/LintPluginMojo.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dsf-maven/dsf-maven-plugin/src/main/java/dev/dsf/maven/linter/LintPluginMojo.java b/dsf-maven/dsf-maven-plugin/src/main/java/dev/dsf/maven/linter/LintPluginMojo.java index 0cb760cf5..00e4314e3 100644 --- a/dsf-maven/dsf-maven-plugin/src/main/java/dev/dsf/maven/linter/LintPluginMojo.java +++ b/dsf-maven/dsf-maven-plugin/src/main/java/dev/dsf/maven/linter/LintPluginMojo.java @@ -53,10 +53,10 @@ public class LintPluginMojo extends AbstractMojo @Parameter(property = "dsf.lint.reportPath") private File reportPath; - @Parameter(property = "dsf.lint.html", defaultValue = "true") + @Parameter(property = "dsf.lint.html", defaultValue = "false") private boolean generateHtmlReport; - @Parameter(property = "dsf.lint.json", defaultValue = "true") + @Parameter(property = "dsf.lint.json", defaultValue = "false") private boolean generateJsonReport; @Parameter(property = "dsf.lint.failOnErrors", defaultValue = "true") From e1ec338ae784ec071d30b250122faf2997cf9e55 Mon Sep 17 00:00:00 2001 From: khalilmalla95 Date: Wed, 29 Apr 2026 14:39:01 +0200 Subject: [PATCH 04/20] Add QUICKSTART.md for dsf-maven-plugin usage instructions --- QUICKSTART.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 QUICKSTART.md diff --git a/QUICKSTART.md b/QUICKSTART.md new file mode 100644 index 000000000..137ec41ab --- /dev/null +++ b/QUICKSTART.md @@ -0,0 +1,31 @@ +# Maven Linter Quick Start + +## Enable (pom.xml) +```xml + + dev.dsf + dsf-maven-plugin + + + lint-plugin + + lint + + + + +``` + +## Run +- `mvn verify` +- `mvn deploy` +- `mvn install` +- `mvn dsf-maven-plugin:lint` + +## Parameters +- Skip: `-Ddsf.lint.skip=true` +- Do not fail build: `-Ddsf.lint.failOnErrors=false` +- HTML Report: `-Ddsf.lint.html=true` +- JSON Report: `-Ddsf.lint.json=true` +- Verbose Logs: `-Ddsf.lint.verbose=true` +- Report path: `-Ddsf.lint.reportPath=target/dsf-linter-report` From 7563cbef8b016e69f4ce15491d94f23da027c534 Mon Sep 17 00:00:00 2001 From: khalilmalla95 Date: Wed, 29 Apr 2026 14:40:09 +0200 Subject: [PATCH 05/20] Remove QUICKSTART.md as it is no longer relevant --- QUICKSTART.md | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 QUICKSTART.md diff --git a/QUICKSTART.md b/QUICKSTART.md deleted file mode 100644 index 137ec41ab..000000000 --- a/QUICKSTART.md +++ /dev/null @@ -1,31 +0,0 @@ -# Maven Linter Quick Start - -## Enable (pom.xml) -```xml - - dev.dsf - dsf-maven-plugin - - - lint-plugin - - lint - - - - -``` - -## Run -- `mvn verify` -- `mvn deploy` -- `mvn install` -- `mvn dsf-maven-plugin:lint` - -## Parameters -- Skip: `-Ddsf.lint.skip=true` -- Do not fail build: `-Ddsf.lint.failOnErrors=false` -- HTML Report: `-Ddsf.lint.html=true` -- JSON Report: `-Ddsf.lint.json=true` -- Verbose Logs: `-Ddsf.lint.verbose=true` -- Report path: `-Ddsf.lint.reportPath=target/dsf-linter-report` From a538623eb2828e12760b75a7ca47839795a553bf Mon Sep 17 00:00:00 2001 From: khalilmalla95 Date: Wed, 29 Apr 2026 14:40:23 +0200 Subject: [PATCH 06/20] Add MAVEN_LINTER_USAGE.md with usage instructions for dsf-maven-plugin --- MAVEN_LINTER_USAGE.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 MAVEN_LINTER_USAGE.md diff --git a/MAVEN_LINTER_USAGE.md b/MAVEN_LINTER_USAGE.md new file mode 100644 index 000000000..137ec41ab --- /dev/null +++ b/MAVEN_LINTER_USAGE.md @@ -0,0 +1,31 @@ +# Maven Linter Quick Start + +## Enable (pom.xml) +```xml + + dev.dsf + dsf-maven-plugin + + + lint-plugin + + lint + + + + +``` + +## Run +- `mvn verify` +- `mvn deploy` +- `mvn install` +- `mvn dsf-maven-plugin:lint` + +## Parameters +- Skip: `-Ddsf.lint.skip=true` +- Do not fail build: `-Ddsf.lint.failOnErrors=false` +- HTML Report: `-Ddsf.lint.html=true` +- JSON Report: `-Ddsf.lint.json=true` +- Verbose Logs: `-Ddsf.lint.verbose=true` +- Report path: `-Ddsf.lint.reportPath=target/dsf-linter-report` From 61fb7bb13b81f3c2d2901af3441eb7dcf984013d Mon Sep 17 00:00:00 2001 From: khalilmalla95 Date: Wed, 29 Apr 2026 16:26:09 +0200 Subject: [PATCH 07/20] Update groupId for dsf-linter dependencies in pom.xml --- dsf-maven/dsf-maven-plugin/pom.xml | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dsf-maven/dsf-maven-plugin/pom.xml b/dsf-maven/dsf-maven-plugin/pom.xml index eab0097cc..823d3c678 100644 --- a/dsf-maven/dsf-maven-plugin/pom.xml +++ b/dsf-maven/dsf-maven-plugin/pom.xml @@ -53,7 +53,7 @@ - dev.dsf.utils.linter + dev.dsf.linter linter-core diff --git a/pom.xml b/pom.xml index b9bec0162..94e865cf5 100755 --- a/pom.xml +++ b/pom.xml @@ -509,7 +509,7 @@ - dev.dsf.utils.linter + dev.dsf.linter linter-core 0.1.3 From fe18bc115bcc3b8cd26c205b0213902951e8be23 Mon Sep 17 00:00:00 2001 From: khalilmalla95 Date: Tue, 5 May 2026 15:36:20 +0200 Subject: [PATCH 08/20] Add support for exclusion rules in dsf-maven-plugin lint goal --- .../dev/dsf/maven/linter/LintPluginMojo.java | 55 ++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) diff --git a/dsf-maven/dsf-maven-plugin/src/main/java/dev/dsf/maven/linter/LintPluginMojo.java b/dsf-maven/dsf-maven-plugin/src/main/java/dev/dsf/maven/linter/LintPluginMojo.java index 00e4314e3..9487dc124 100644 --- a/dsf-maven/dsf-maven-plugin/src/main/java/dev/dsf/maven/linter/LintPluginMojo.java +++ b/dsf-maven/dsf-maven-plugin/src/main/java/dev/dsf/maven/linter/LintPluginMojo.java @@ -31,6 +31,8 @@ import dev.dsf.linter.DsfLinter; import dev.dsf.linter.DsfLinter.OverallLinterResult; +import dev.dsf.linter.exclusion.ExclusionConfig; +import dev.dsf.linter.exclusion.ExclusionConfigLoader; import dev.dsf.linter.input.InputResolver; import dev.dsf.linter.input.InputResolver.ResolutionResult; import dev.dsf.linter.logger.Logger; @@ -68,6 +70,16 @@ public class LintPluginMojo extends AbstractMojo @Parameter(property = "dsf.lint.verbose", defaultValue = "false") private boolean verbose; + /** + * Path to a JSON file containing exclusion rules. Excluded items are hidden from HTML and JSON reports. + * When omitted, the plugin also looks for {@code dsf-linter-exclusions.json} in the project build + * directory automatically. + * + *

Example: {@code -Ddsf.lint.exclusionsFile=path/to/dsf-linter-exclusions.json}

+ */ + @Parameter(property = "dsf.lint.exclusionsFile") + private File exclusionsFile; + @Override public void execute() throws MojoExecutionException, MojoFailureException { @@ -104,8 +116,11 @@ public void execute() throws MojoExecutionException, MojoFailureException Files.createDirectories(lintReportPath); + ExclusionConfig exclusionConfig = loadExclusionConfig(resolution.resolvedPath().toAbsolutePath()); + DsfLinter.Config config = new DsfLinter.Config(resolution.resolvedPath().toAbsolutePath(), - lintReportPath.toAbsolutePath(), generateHtmlReport, generateJsonReport, failOnErrors, logger); + lintReportPath.toAbsolutePath(), generateHtmlReport, generateJsonReport, failOnErrors, + exclusionConfig, logger); OverallLinterResult result = new DsfLinter(config).lint(); @@ -138,4 +153,42 @@ public void execute() throws MojoExecutionException, MojoFailureException } } } + + /** + * Loads the exclusion config from an explicit file ({@code dsf.lint.exclusionsFile}) or + * auto-discovers {@code dsf-linter-exclusions.json} in the extracted project directory. + * Returns {@code null} when no exclusion file is found or configured. + */ + private ExclusionConfig loadExclusionConfig(Path projectRoot) throws MojoExecutionException + { + ExclusionConfigLoader loader = new ExclusionConfigLoader(); + try + { + if (exclusionsFile != null) + { + ExclusionConfig config = loader.load(exclusionsFile.toPath()); + getLog().info("DSF Linter: loaded exclusion rules from " + exclusionsFile + + " (" + config.getRules().size() + " rule(s), affectsExitStatus=" + + config.isAffectsExitStatus() + ")"); + return config; + } + + Optional auto = loader.loadFromProjectRoot(projectRoot); + if (auto.isPresent()) + { + ExclusionConfig config = auto.get(); + getLog().info("DSF Linter: auto-discovered exclusion rules from " + + projectRoot.resolve(ExclusionConfigLoader.DEFAULT_FILENAME) + + " (" + config.getRules().size() + " rule(s), affectsExitStatus=" + + config.isAffectsExitStatus() + ")"); + return config; + } + + return null; + } + catch (IOException e) + { + throw new MojoExecutionException("DSF Linter: failed to load exclusion config", e); + } + } } From cf73a5ece95cb436303b71b422ddc257621d58f6 Mon Sep 17 00:00:00 2001 From: khalilmalla95 Date: Tue, 5 May 2026 15:36:56 +0200 Subject: [PATCH 09/20] Expand MAVEN_LINTER_USAGE.md with exclusion rules and configuration details for dsf-maven-plugin --- MAVEN_LINTER_USAGE.md | 65 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/MAVEN_LINTER_USAGE.md b/MAVEN_LINTER_USAGE.md index 137ec41ab..dc0b6b43a 100644 --- a/MAVEN_LINTER_USAGE.md +++ b/MAVEN_LINTER_USAGE.md @@ -29,3 +29,68 @@ - JSON Report: `-Ddsf.lint.json=true` - Verbose Logs: `-Ddsf.lint.verbose=true` - Report path: `-Ddsf.lint.reportPath=target/dsf-linter-report` +- Exclusion rules: `-Ddsf.lint.exclusionsFile=path/to/dsf-linter-exclusions.json` + +## Excluding Issues + +Users often encounter known, intentional, or external findings that clutter reports and make triage harder. +The exclusion system lets you suppress specific lint items from HTML and JSON reports without touching the plugin source. + +### Option A — Auto-discovery (recommended) + +Place a file named `dsf-linter-exclusions.json` in your project root. The plugin picks it up automatically — no extra configuration needed. + +### Option B — Explicit file + +Pass the path via the Maven property: + +```bash +mvn verify -Ddsf.lint.exclusionsFile=path/to/my-exclusions.json +``` + +Or configure it permanently in `pom.xml`: + +```xml + + dev.dsf + dsf-maven-plugin + + ${project.basedir}/dsf-linter-exclusions.json + + + + lint-plugin + lint + + + +``` + +### Exclusion file format + +```json +{ + "affectsExitStatus": false, + "rules": [ + { "type": "BPMN_PROCESS_HISTORY_TIME_TO_LIVE_MISSING" }, + { "severity": "WARN", "file": "update-allow-list.bpmn" }, + { "messageContains": "optional field" } + ] +} +``` + +**Rule fields** (AND-combined within a rule; multiple rules are OR-combined): + +| Field | Match | Example | +|---|---|---| +| `type` | Exact, case-insensitive `LintingType` name | `"BPMN_PROCESS_HISTORY_TIME_TO_LIVE_MISSING"` | +| `severity` | Exact, case-insensitive severity | `"WARN"`, `"ERROR"`, `"INFO"` | +| `file` | Case-insensitive substring of the file name | `"update-allow-list"` | +| `messageContains` | Case-insensitive substring of the description | `"optional field"` | + +**`affectsExitStatus`:** + +| Value | Behaviour | +|---|---| +| `false` *(default)* | Excluded items are fully suppressed — hidden from reports **and** not counted towards build failure | +| `true` | Excluded items are hidden from reports, but their error count **still** causes a build failure | From d3efaa8be08e10c4fa98edc0786b084bb876fce8 Mon Sep 17 00:00:00 2001 From: khalilmalla95 Date: Mon, 16 Nov 2026 15:14:21 +0100 Subject: [PATCH 10/20] Fix LintPluginMojo compile error against linter-core 0.1.3 Replace the removed OverallLinterResult.getTotalErrors() call with getPluginErrors() so dsf-maven-plugin compiles again. Also align failure handling with DsfLinter.success(): fail the build only when success() is false, and warn when errors remain under failOnErrors=false instead of reporting a false pass. --- .../dev/dsf/maven/linter/LintPluginMojo.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/dsf-maven/dsf-maven-plugin/src/main/java/dev/dsf/maven/linter/LintPluginMojo.java b/dsf-maven/dsf-maven-plugin/src/main/java/dev/dsf/maven/linter/LintPluginMojo.java index 9487dc124..7c250ea82 100644 --- a/dsf-maven/dsf-maven-plugin/src/main/java/dev/dsf/maven/linter/LintPluginMojo.java +++ b/dsf-maven/dsf-maven-plugin/src/main/java/dev/dsf/maven/linter/LintPluginMojo.java @@ -124,16 +124,19 @@ public void execute() throws MojoExecutionException, MojoFailureException OverallLinterResult result = new DsfLinter(config).lint(); + String msg = "DSF Linter: " + result.getPluginErrors() + " error(s), " + result.getPluginWarnings() + + " warning(s)"; + + // success() is false only when failOnErrors is set and the linter found errors + // or failed plugins. With failOnErrors=false the result stays successful, so + // remaining errors are reported as a warning instead of a build failure. if (!result.success()) { - String msg = "DSF Linter: " + result.getTotalErrors() + " error(s), " + result.getPluginWarnings() - + " warning(s)"; - - if (failOnErrors) - { - throw new MojoFailureException(msg); - } + throw new MojoFailureException(msg); + } + if (result.getPluginErrors() > 0) + { getLog().warn(msg); } else From 5de0ffb591ca6dda0684e812c09580c322f0ac37 Mon Sep 17 00:00:00 2001 From: khalilmalla95 Date: Mon, 16 Nov 2026 16:17:19 +0100 Subject: [PATCH 11/20] Fix maven-plugin classpath clash and keep test-plugin lint non-fatal Exclude linter-core runtime stubs that pollute the dsf-maven-plugin classpath. linter-core pulls hapi-fhir-base 5.7.9 and camunda-engine into the plugin realm, which breaks generate-fhir-bundle with a missing ca.uhn.fhir.util.Logs class while DSF itself uses HAPI 8.4.2. Also set failOnErrors=false on the lint executions for dsf-bpe-test-plugin-v1 and v2. Those modules are intentional fixtures and produce expected lint findings; failing the reactor build on them blocked CI after the lint goal was wired in. --- dsf-bpe/dsf-bpe-test-plugin-v1/pom.xml | 4 ++++ dsf-bpe/dsf-bpe-test-plugin-v2/pom.xml | 4 ++++ dsf-maven/dsf-maven-plugin/pom.xml | 21 +++++++++++++++++++++ 3 files changed, 29 insertions(+) diff --git a/dsf-bpe/dsf-bpe-test-plugin-v1/pom.xml b/dsf-bpe/dsf-bpe-test-plugin-v1/pom.xml index eb101581d..d15b4d38e 100644 --- a/dsf-bpe/dsf-bpe-test-plugin-v1/pom.xml +++ b/dsf-bpe/dsf-bpe-test-plugin-v1/pom.xml @@ -65,6 +65,10 @@ lint + + + false + diff --git a/dsf-bpe/dsf-bpe-test-plugin-v2/pom.xml b/dsf-bpe/dsf-bpe-test-plugin-v2/pom.xml index ae7fe7e15..526942370 100644 --- a/dsf-bpe/dsf-bpe-test-plugin-v2/pom.xml +++ b/dsf-bpe/dsf-bpe-test-plugin-v2/pom.xml @@ -60,6 +60,10 @@ lint + + + false + diff --git a/dsf-maven/dsf-maven-plugin/pom.xml b/dsf-maven/dsf-maven-plugin/pom.xml index 6cedf015d..29577dd9a 100644 --- a/dsf-maven/dsf-maven-plugin/pom.xml +++ b/dsf-maven/dsf-maven-plugin/pom.xml @@ -55,6 +55,27 @@ dev.dsf.linter linter-core + + + + ca.uhn.hapi.fhir + hapi-fhir-base + + + org.camunda.bpm + camunda-engine + + + dev.dsf + dsf-bpe-process-api-v1 + + + dev.dsf + dsf-bpe-process-api-v2 + + From ac12396d12a9177867d8d781481c01100fa4b064 Mon Sep 17 00:00:00 2001 From: khalilmalla95 Date: Mon, 16 Nov 2026 16:38:51 +0100 Subject: [PATCH 12/20] Format LintPluginMojo to satisfy formatter-maven-plugin Apply the project Eclipse formatter to LintPluginMojo so the CI formatter/impsort/license check passes. No behavioral changes. --- .../dev/dsf/maven/linter/LintPluginMojo.java | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/dsf-maven/dsf-maven-plugin/src/main/java/dev/dsf/maven/linter/LintPluginMojo.java b/dsf-maven/dsf-maven-plugin/src/main/java/dev/dsf/maven/linter/LintPluginMojo.java index 7c250ea82..2ca457666 100644 --- a/dsf-maven/dsf-maven-plugin/src/main/java/dev/dsf/maven/linter/LintPluginMojo.java +++ b/dsf-maven/dsf-maven-plugin/src/main/java/dev/dsf/maven/linter/LintPluginMojo.java @@ -71,11 +71,13 @@ public class LintPluginMojo extends AbstractMojo private boolean verbose; /** - * Path to a JSON file containing exclusion rules. Excluded items are hidden from HTML and JSON reports. - * When omitted, the plugin also looks for {@code dsf-linter-exclusions.json} in the project build - * directory automatically. + * Path to a JSON file containing exclusion rules. Excluded items are hidden from HTML and JSON reports. When + * omitted, the plugin also looks for {@code dsf-linter-exclusions.json} in the project build directory + * automatically. * - *

Example: {@code -Ddsf.lint.exclusionsFile=path/to/dsf-linter-exclusions.json}

+ *

+ * Example: {@code -Ddsf.lint.exclusionsFile=path/to/dsf-linter-exclusions.json} + *

*/ @Parameter(property = "dsf.lint.exclusionsFile") private File exclusionsFile; @@ -158,9 +160,9 @@ public void execute() throws MojoExecutionException, MojoFailureException } /** - * Loads the exclusion config from an explicit file ({@code dsf.lint.exclusionsFile}) or - * auto-discovers {@code dsf-linter-exclusions.json} in the extracted project directory. - * Returns {@code null} when no exclusion file is found or configured. + * Loads the exclusion config from an explicit file ({@code dsf.lint.exclusionsFile}) or auto-discovers + * {@code dsf-linter-exclusions.json} in the extracted project directory. Returns {@code null} when no exclusion + * file is found or configured. */ private ExclusionConfig loadExclusionConfig(Path projectRoot) throws MojoExecutionException { @@ -170,9 +172,9 @@ private ExclusionConfig loadExclusionConfig(Path projectRoot) throws MojoExecuti if (exclusionsFile != null) { ExclusionConfig config = loader.load(exclusionsFile.toPath()); - getLog().info("DSF Linter: loaded exclusion rules from " + exclusionsFile - + " (" + config.getRules().size() + " rule(s), affectsExitStatus=" - + config.isAffectsExitStatus() + ")"); + getLog().info( + "DSF Linter: loaded exclusion rules from " + exclusionsFile + " (" + config.getRules().size() + + " rule(s), affectsExitStatus=" + config.isAffectsExitStatus() + ")"); return config; } @@ -181,9 +183,8 @@ private ExclusionConfig loadExclusionConfig(Path projectRoot) throws MojoExecuti { ExclusionConfig config = auto.get(); getLog().info("DSF Linter: auto-discovered exclusion rules from " - + projectRoot.resolve(ExclusionConfigLoader.DEFAULT_FILENAME) - + " (" + config.getRules().size() + " rule(s), affectsExitStatus=" - + config.isAffectsExitStatus() + ")"); + + projectRoot.resolve(ExclusionConfigLoader.DEFAULT_FILENAME) + " (" + config.getRules().size() + + " rule(s), affectsExitStatus=" + config.isAffectsExitStatus() + ")"); return config; } From bea8e163d574d0e5584032b5539a0b03bd70858c Mon Sep 17 00:00:00 2001 From: khalilmalla95 Date: Mon, 16 Nov 2026 17:34:51 +0100 Subject: [PATCH 13/20] Fix lint false positives by restoring Mojo reflection classpath Add spring-context and camunda-engine to dsf-maven-plugin so JAR lint can resolve @Bean/@Scope and JavaDelegate via reflection. Keep Camunda's transitive HAPI excluded so generate-fhir-bundle continues to use HAPI 8.x. This removes the false PLUGIN_DEFINITION_SPRING_* and BPMN_*_NOT_IMPLEMENTING_JAVA_DELEGATE findings on the test plugins. --- dsf-bpe/dsf-bpe-test-plugin-v1/pom.xml | 4 ---- dsf-maven/dsf-maven-plugin/pom.xml | 27 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/dsf-bpe/dsf-bpe-test-plugin-v1/pom.xml b/dsf-bpe/dsf-bpe-test-plugin-v1/pom.xml index d15b4d38e..eb101581d 100644 --- a/dsf-bpe/dsf-bpe-test-plugin-v1/pom.xml +++ b/dsf-bpe/dsf-bpe-test-plugin-v1/pom.xml @@ -65,10 +65,6 @@ lint - - - false - diff --git a/dsf-maven/dsf-maven-plugin/pom.xml b/dsf-maven/dsf-maven-plugin/pom.xml index 29577dd9a..c850652a6 100644 --- a/dsf-maven/dsf-maven-plugin/pom.xml +++ b/dsf-maven/dsf-maven-plugin/pom.xml @@ -82,10 +82,12 @@ dev.dsf dsf-bpe-process-api-v1 + org.camunda.bpm camunda-engine + org.springframework spring-context @@ -115,6 +117,20 @@
+ + + org.camunda.bpm + camunda-engine + 7.24.0 + + + ca.uhn.hapi.fhir + * + + + + org.operaton.bpm.model operaton-bpmn-model @@ -123,6 +139,17 @@ org.springframework spring-beans + + + org.springframework + spring-context + + + commons-logging + commons-logging + + + org.reflections reflections From 9c35aa71cd7e7117aa392c3da1a7a7e9bab35daf Mon Sep 17 00:00:00 2001 From: khalilmalla95 Date: Mon, 16 Nov 2026 17:36:34 +0100 Subject: [PATCH 14/20] Remove version suffix from test plugin ActivityDefinition profile Use the unversioned activity-definition StructureDefinition profile in dsf-bpe-test-plugin-v1 so the FHIR lint check no longer reports ACTIVITY_DEFINITION_PROFILE_NO_PLACEHOLDER. --- .../src/main/resources/fhir/ActivityDefinition/dsf-test.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dsf-bpe/dsf-bpe-test-plugin-v1/src/main/resources/fhir/ActivityDefinition/dsf-test.xml b/dsf-bpe/dsf-bpe-test-plugin-v1/src/main/resources/fhir/ActivityDefinition/dsf-test.xml index d2f4fdaa7..f4fc3553a 100644 --- a/dsf-bpe/dsf-bpe-test-plugin-v1/src/main/resources/fhir/ActivityDefinition/dsf-test.xml +++ b/dsf-bpe/dsf-bpe-test-plugin-v1/src/main/resources/fhir/ActivityDefinition/dsf-test.xml @@ -17,7 +17,7 @@ --> - + From 0191263887a47d2c8677e06d56e68a606a7e4f1e Mon Sep 17 00:00:00 2001 From: khalilmalla95 Date: Mon, 16 Nov 2026 18:23:21 +0100 Subject: [PATCH 15/20] Align continue-send-test StructureDefinition with instantiatesCanonical Replace legacy Task.instantiatesUri/fixedUri with Task.instantiatesCanonical and fixedCanonical using the |#{version} form expected by DSF Task profiles and the linter cross-check. --- .../StructureDefinition/dsf-task-continue-send-test.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dsf-bpe/dsf-bpe-test-plugin-v2/src/main/resources/fhir/StructureDefinition/dsf-task-continue-send-test.xml b/dsf-bpe/dsf-bpe-test-plugin-v2/src/main/resources/fhir/StructureDefinition/dsf-task-continue-send-test.xml index cb4956ff7..4b56833ac 100644 --- a/dsf-bpe/dsf-bpe-test-plugin-v2/src/main/resources/fhir/StructureDefinition/dsf-task-continue-send-test.xml +++ b/dsf-bpe/dsf-bpe-test-plugin-v2/src/main/resources/fhir/StructureDefinition/dsf-task-continue-send-test.xml @@ -39,9 +39,9 @@ - - - + + + From b3fef2ba1e0eeffa27e1488b32d101078861cc06 Mon Sep 17 00:00:00 2001 From: khalilmalla95 Date: Mon, 16 Nov 2026 18:41:00 +0100 Subject: [PATCH 16/20] Exclude continue-send-test AD lint findings in v2 test plugin The linter correctly flags that continue-send-test is missing from the static ActivityDefinition. That is intentional here: the message is added only at runtime via FhirResourceModifier, a pattern used only in this DSF test plugin. Suppress the findings via exclusions instead of changing dsf-linter. --- .../dsf-bpe-test-plugin-v2/dsf-linter-exclusions.json | 10 ++++++++++ dsf-bpe/dsf-bpe-test-plugin-v2/pom.xml | 5 +---- 2 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 dsf-bpe/dsf-bpe-test-plugin-v2/dsf-linter-exclusions.json diff --git a/dsf-bpe/dsf-bpe-test-plugin-v2/dsf-linter-exclusions.json b/dsf-bpe/dsf-bpe-test-plugin-v2/dsf-linter-exclusions.json new file mode 100644 index 000000000..8867ec84a --- /dev/null +++ b/dsf-bpe/dsf-bpe-test-plugin-v2/dsf-linter-exclusions.json @@ -0,0 +1,10 @@ +{ + "affectsExitStatus": false, + "rules": [ + { + "type": "BPMN_NO_ACTIVITY_DEFINITION_FOUND_FOR_MESSAGE", + "file": "test.bpmn", + "messageContains": "continue-send-test" + } + ] +} diff --git a/dsf-bpe/dsf-bpe-test-plugin-v2/pom.xml b/dsf-bpe/dsf-bpe-test-plugin-v2/pom.xml index 526942370..2c21c3c83 100644 --- a/dsf-bpe/dsf-bpe-test-plugin-v2/pom.xml +++ b/dsf-bpe/dsf-bpe-test-plugin-v2/pom.xml @@ -60,14 +60,11 @@ lint - - - false - dev.dsf.bpe.test.spring.config + ${project.basedir}/dsf-linter-exclusions.json From fa60d55e0e67ed61377107d6503904d720982475 Mon Sep 17 00:00:00 2001 From: khalilmalla95 Date: Tue, 17 Nov 2026 15:06:59 +0100 Subject: [PATCH 17/20] Drop unnecessary HAPI exclusion from camunda-engine dependency camunda-engine 7.24.0 does not pull HAPI; the old hapi-fhir-base 5.7.9 conflict came from linter-core and remains excluded there. Keep camunda as a direct, versioned dependency for JavaDelegate reflection only. --- dsf-maven/dsf-maven-plugin/pom.xml | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/dsf-maven/dsf-maven-plugin/pom.xml b/dsf-maven/dsf-maven-plugin/pom.xml index c850652a6..b26eac454 100644 --- a/dsf-maven/dsf-maven-plugin/pom.xml +++ b/dsf-maven/dsf-maven-plugin/pom.xml @@ -82,7 +82,7 @@ dev.dsf dsf-bpe-process-api-v1 - + org.camunda.bpm camunda-engine @@ -117,18 +117,14 @@ - + org.camunda.bpm camunda-engine 7.24.0 - - - ca.uhn.hapi.fhir - * - - From 754ab75653e22f74cee4d171d98369e679d67b4e Mon Sep 17 00:00:00 2001 From: khalilmalla95 Date: Tue, 17 Nov 2026 16:27:08 +0100 Subject: [PATCH 18/20] Revert "Remove version suffix from test plugin ActivityDefinition profile" This reverts commit 9c35aa71cd7e7117aa392c3da1a7a7e9bab35daf. --- .../src/main/resources/fhir/ActivityDefinition/dsf-test.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dsf-bpe/dsf-bpe-test-plugin-v1/src/main/resources/fhir/ActivityDefinition/dsf-test.xml b/dsf-bpe/dsf-bpe-test-plugin-v1/src/main/resources/fhir/ActivityDefinition/dsf-test.xml index f4fc3553a..d2f4fdaa7 100644 --- a/dsf-bpe/dsf-bpe-test-plugin-v1/src/main/resources/fhir/ActivityDefinition/dsf-test.xml +++ b/dsf-bpe/dsf-bpe-test-plugin-v1/src/main/resources/fhir/ActivityDefinition/dsf-test.xml @@ -17,7 +17,7 @@ --> - + From a1c1e7d085a0676b3322870bc5768bb85fd17b88 Mon Sep 17 00:00:00 2001 From: khalilmalla95 Date: Tue, 17 Nov 2026 16:28:39 +0100 Subject: [PATCH 19/20] Document intentional ActivityDefinition profile version in v1 test plugin --- .../src/main/resources/fhir/ActivityDefinition/dsf-test.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/dsf-bpe/dsf-bpe-test-plugin-v1/src/main/resources/fhir/ActivityDefinition/dsf-test.xml b/dsf-bpe/dsf-bpe-test-plugin-v1/src/main/resources/fhir/ActivityDefinition/dsf-test.xml index d2f4fdaa7..fa2f5875c 100644 --- a/dsf-bpe/dsf-bpe-test-plugin-v1/src/main/resources/fhir/ActivityDefinition/dsf-test.xml +++ b/dsf-bpe/dsf-bpe-test-plugin-v1/src/main/resources/fhir/ActivityDefinition/dsf-test.xml @@ -17,6 +17,7 @@ --> + From 13b1fd32c1e219d3d09cf1cd998cf61cf9d656ac Mon Sep 17 00:00:00 2001 From: khalilmalla95 Date: Tue, 17 Nov 2026 17:59:43 +0100 Subject: [PATCH 20/20] Exclude intentional ActivityDefinition profile version in test plugin v1 The |1.0.0 profile suffix in dsf-test.xml is intentional to verify API v1 BPE stripping behavior. Suppress ACTIVITY_DEFINITION_PROFILE_NO_PLACEHOLDER via dsf-linter-exclusions.json so the new lint goal does not fail CI. --- .../dsf-bpe-test-plugin-v1/dsf-linter-exclusions.json | 10 ++++++++++ dsf-bpe/dsf-bpe-test-plugin-v1/pom.xml | 1 + 2 files changed, 11 insertions(+) create mode 100644 dsf-bpe/dsf-bpe-test-plugin-v1/dsf-linter-exclusions.json diff --git a/dsf-bpe/dsf-bpe-test-plugin-v1/dsf-linter-exclusions.json b/dsf-bpe/dsf-bpe-test-plugin-v1/dsf-linter-exclusions.json new file mode 100644 index 000000000..a7a0db1a7 --- /dev/null +++ b/dsf-bpe/dsf-bpe-test-plugin-v1/dsf-linter-exclusions.json @@ -0,0 +1,10 @@ +{ + "affectsExitStatus": false, + "rules": [ + { + "type": "ACTIVITY_DEFINITION_PROFILE_NO_PLACEHOLDER", + "file": "dsf-test.xml", + "messageContains": "activity-definition|1.0.0" + } + ] +} diff --git a/dsf-bpe/dsf-bpe-test-plugin-v1/pom.xml b/dsf-bpe/dsf-bpe-test-plugin-v1/pom.xml index eb101581d..c3a685d75 100644 --- a/dsf-bpe/dsf-bpe-test-plugin-v1/pom.xml +++ b/dsf-bpe/dsf-bpe-test-plugin-v1/pom.xml @@ -69,6 +69,7 @@ dev.dsf.bpe.test.spring.config + ${project.basedir}/dsf-linter-exclusions.json