Repository navigation
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #388 +/- ##
==========================================
- Coverage 91.8% 91.8% -0.1%
- Complexity 2230 2231 +1
==========================================
Files 211 211
Lines 5942 5946 +4
Branches 807 808 +1
==========================================
+ Hits 5458 5460 +2
- Misses 230 231 +1
- Partials 254 255 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
StandaloneContextMapper.loadCML(String) created a relative URI from a plain file path. Resolving the imports of such a resource against its URI failed with 'resolve against non-hierarchical or relative base', e.g. when generating PlantUML diagrams with the CLI. Plain file paths are now converted into absolute file URIs; strings that already are URIs (file:, platform:, ...) are used as before.
stefan-ka
force-pushed
the
fix/364-relative-path-imports
branch
from
October 20, 2026 21:55
9c8f20b to
4dc235d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the crash reported in #364.
Cause
StandaloneContextMapper.loadCML(String)created the resource URI withURI.createURI(filepath). For a plain (relative) file path likeContextMap.cml, this yields a relative URI.CMLImportResolverthen resolves each import against the resource URI, which fails withIllegalArgumentException: resolve against non-hierarchical or relative base, e.g. incm generate -g plantuml -i ContextMap.cml(the CLI callsloadCML(String)).Fix
Plain file paths (no URI scheme, or a single-letter scheme = Windows drive letter) are converted into absolute file URIs, as
loadCML(File)already does. Strings that are already URIs (file:,platform:, …) are used as before.Test
StandaloneAPITest.canLoadCMLWithImportsViaRelativePathAndCallGeneratorloads a context map that imports its Bounded Contexts from a second file via a relative path and calls the PlantUML generator. Verified that it fails without the fix and passes with it.Not addressed
The issue also mentions that the VS Code extension only generates the context map diagram for such models (no Aggregate diagrams), and a comment mentions
nullnames in diagrams caused by the global scope provider. Those are separate problems in the scoping/import handling and are not touched here.Based on
masterplus the Gradle/Jacoco build fix from #383 (same commit content, cherry-picked), so it can be merged independently.