You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ModelVersionProcessor should accept dynamic version from any property source, not just jgit #179
When using nisse for zero-commit releases (as described in this blog post), source archives (GitHub tarballs, git archive output) cannot be built because they lack a .git directory.
We attempted to fix this using git's export-subst mechanism (jline/jline3#2151): .mvn/maven-user.properties contains $Format:...$ placeholders that git archive expands at archive time. In a git checkout, nisse overwrites these with the real values from git.
The export-subst correctly populates the properties:
[INFO] Nisse injecting 19 properties into User Properties
But the build still fails:
[ERROR] 'version' must be a constant version but is '${nisse.jgit.dynamicVersion}'.
Root cause
When the jgit source fails to find a .git directory, it logs:
[DEBUG] Seems this is not a git checkout; ignoring property source jgit
This disables the ModelVersionProcessor that allows ${nisse.jgit.dynamicVersion} in <version> fields. Even though the property value is available (from nisse's file source / maven-user.properties), the version processor doesn't accept it because the jgit source was not the one that provided it.
The ModelVersionProcessor should accept ${nisse.jgit.dynamicVersion} in <version> whenever the property is available from any nisse property source — not only when the jgit source actively resolved it. This would enable the export-subst approach and make source archives buildable without -D flags.
Reproducible test case
# 1. Clone JLine (which has the export-subst fix merged)
curl -sL https://github.com/jline/jline3/archive/refs/heads/master.tar.gz | tar xzf -
cd jline3-master
# 2. Verify the property is expanded
cat .mvn/maven-user.properties
# Shows: nisse.jgit.dynamicVersion=4.3.1-72-g35fc24edb# 3. Try to build — fails
./mvx mvn validate
# ERROR: 'version' must be a constant version# 4. Same property via -D — works
./mvx mvn validate -Dnisse.jgit.dynamicVersion=4.3.1
# BUILD SUCCESS
There's a related Maven 4-specific problem in extension4's NissePropertyContributor that prevents the export-subst approach from working even in a git checkout (not just archives).
Root cause
Maven 4 auto-loads .mvn/maven-user.propertiesbefore extensions run. When using the export-subst mechanism, this file contains unexpanded placeholders like:
In a git checkout, git archive substitution hasn't happened, so the raw $Format:...$ placeholder is loaded as-is into user properties. When Nisse's PropertyContributor runs and computes the real value from jgit, line 64 uses putIfAbsent:
nisseProperties.forEach(result::putIfAbsent);
Since the key already exists (pre-loaded by Maven 4 with the unexpanded placeholder), putIfAbsent keeps the placeholder value $Format:%(describe:tags=true)$. This value contains :, which Maven 4's strict POM validation rejects.
Fix
PR #181 changes putIfAbsent to put so Nisse-computed values always take precedence over pre-loaded values. This is the correct semantic — Nisse is the authoritative source for these properties.
All work for this issue has been completed across several PRs:
Core fix (0.9.7):
99c113e — Added isUnexpandedPlaceholder() detection and override loop in extension4's NissePropertyContributor. Unexpanded placeholders ($Format:...$ from git export-subst, ${...} from Maven interpolation) pre-loaded by Maven 4 are now overridden by Nisse-computed values, while CLI -D overrides are preserved.
Fallback mechanism (0.9.5):
Support .mvn/nisse.properties as low-priority fallback #183 (47218f2) — Added .mvn/nisse.properties as a low-priority fallback property source in SimpleNisseManager, enabling source-archive builds (no .git directory) via git export-subst. Includes comprehensive unit tests.
Activity
gnodet commentedon Aug 8, 2026
Maven 4 variant of this issue
There's a related Maven 4-specific problem in
extension4'sNissePropertyContributorthat prevents the export-subst approach from working even in a git checkout (not just archives).Root cause
Maven 4 auto-loads
.mvn/maven-user.propertiesbefore extensions run. When using the export-subst mechanism, this file contains unexpanded placeholders like:In a git checkout,
git archivesubstitution hasn't happened, so the raw$Format:...$placeholder is loaded as-is into user properties. When Nisse'sPropertyContributorruns and computes the real value from jgit, line 64 usesputIfAbsent:Since the key already exists (pre-loaded by Maven 4 with the unexpanded placeholder),
putIfAbsentkeeps the placeholder value$Format:%(describe:tags=true)$. This value contains:, which Maven 4's strict POM validation rejects.Fix
PR #181 changes
putIfAbsenttoputso Nisse-computed values always take precedence over pre-loaded values. This is the correct semantic — Nisse is the authoritative source for these properties.Discovered via maveniverse/scalpel#62.
cstamas commentedon Aug 20, 2026
@gnodet does this issue still applies?
gnodet commentedon Aug 20, 2026
Yes! This will definitely improve the zero-commit release process.
cstamas commentedon Aug 20, 2026
But isn't this solved by "low priority properties" already present? At least the first issue. The Maven 4 issue stands, as I see
Fix for #179
cstamas commentedon Aug 20, 2026
Added fix, but not closing this issue, right now am in hurry, the fix will need test coverage
Remove dead putIfAbsent line and add user-props-override ITs (#179)
Remove dead putIfAbsent line and add user-props-override ITs (#179) (#…
gnodet commentedon Aug 26, 2026
All work for this issue has been completed across several PRs:
Core fix (0.9.7):
99c113e— AddedisUnexpandedPlaceholder()detection and override loop in extension4'sNissePropertyContributor. Unexpanded placeholders ($Format:...$from git export-subst,${...}from Maven interpolation) pre-loaded by Maven 4 are now overridden by Nisse-computed values, while CLI-Doverrides are preserved.Fallback mechanism (0.9.5):
47218f2) — Added.mvn/nisse.propertiesas a low-priority fallback property source inSimpleNisseManager, enabling source-archive builds (no.gitdirectory) via gitexport-subst. Includes comprehensive unit tests.Test coverage & cleanup:
33a056e) — Removed the deadputIfAbsentline left after the fix, and addeduser-props-overrideintegration tests for both extension4 (Maven 4) and extension3 (Maven 3).5c822dd— Added integration tests for the.mvn/nisse.propertiesfallback (happy path, unexpanded placeholders, empty values, priority ordering).Closing as fully resolved.