apache / apache/maven-release

<checkModificationExcludes> interferes with rewrite-poms-for-release

Open
#1,477 0 comments 1 reaction 0 assignees View on GitHub
bug
Dominant language
Java
Stars
128
Forks
145
Avg merge
7h 7m
Merged PRs (30d)
3

Description

### Affected version

3.2.0 and newer

### Bug description

When `pom.xml`s are excluded from modification checks, the version number does not get updated during `relase:prepare` and no scm commit is performed. This issue first appeared in version 3.2.0 with the changes introduced by #196.

### Reproducer

```xml

4.0.0

org.example
release
1.0-SNAPSHOT


scm:git:https://repository.example




org.apache.maven.plugins
maven-release-plugin
3.3.1

false
true

**/pom.xml




```

```
$ mvn release:prepare -DreleaseVersion=1.0
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------< org.example:release >-------------------------
[INFO] Building release 1.0-SNAPSHOT
[INFO] from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- release:3.3.1:prepare (default-cli) @ release ---
[INFO] starting prepare goal, composed of 17 phases: check-poms, scm-check-modifications, check-dependency-snapshots, create-backup-poms, map-release-versions, input-variables, map-development-versions, rewrite-poms-for-release, generate-release-poms, run-preparation-goals, scm-commit-release, scm-tag, rewrite-poms-for-development, remove-release-poms, run-completion-goals, scm-commit-development, end-release
[INFO] 1/17 prepare:check-poms
[INFO] 2/17 prepare:scm-check-modifications
[INFO] Verifying that there are no local modifications...
[INFO] ignoring changes on: **/pom.xml.next, **/release.properties, **/pom.xml.branch, **/pom.xml, **/pom.xml.tag, **/pom.xml.backup, **/pom.xml.releaseBackup
[WARNING] Ignoring unrecognized line: ?? release.properties
[INFO] 3/17 prepare:check-dependency-snapshots
[INFO] Checking dependencies and plugins for snapshots ...
[INFO] 4/17 prepare:create-backup-poms
[INFO] Creating pom.xml backup with .releaseBackup suffix
[INFO] 5/17 prepare:map-release-versions
[INFO] 6/17 prepare:input-variables
[INFO] 7/17 prepare:map-development-versions
[INFO] 8/17 prepare:rewrite-poms-for-release
[INFO] 9/17 prepare:generate-release-poms
[INFO] Not generating release POMs
[INFO] 10/17 prepare:run-preparation-goals
[INFO] Executing goals 'clean verify'...
[INFO] [INFO] Scanning for projects...
[INFO] [INFO]
[INFO] [INFO] ------------------------< org.example:release >-------------------------
[INFO] [INFO] Building release 1.0-SNAPSHOT
[INFO] [INFO] from pom.xml
[INFO] [INFO] --------------------------------[ jar ]---------------------------------
[INFO] [INFO]
[INFO] [INFO] --- clean:3.2.0:clean (default-clean) @ release ---
[INFO] [INFO]
[INFO] [INFO] --- resources:3.3.1:resources (default-resources) @ release ---
[INFO] [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] [INFO] skip non existing resourceDirectory /path/to/project/src/main/resources
[INFO] [INFO]
[INFO] [INFO] --- compiler:3.13.0:compile (default-compile) @ release ---
[INFO] [INFO] No sources to compile
[INFO] [INFO]
[INFO] [INFO] --- resources:3.3.1:testResources (default-testResources) @ release ---
[INFO] [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] [INFO] skip non existing resourceDirectory /path/to/project/src/test/resources
[INFO] [INFO]
[INFO] [INFO] --- compiler:3.13.0:testCompile (default-testCompile) @ release ---
[INFO] [INFO] No sources to compile
[INFO] [INFO]
[INFO] [INFO] --- surefire:3.2.5:test (default-test) @ release ---
[INFO] [INFO] No tests to run.
[INFO] [INFO]
[INFO] [INFO] --- jar:3.4.1:jar (default-jar) @ release ---
[INFO] [WARNING] JAR will be empty - no content was marked for inclusion!
[INFO] [INFO] Building jar: /path/to/project/target/release-1.0-SNAPSHOT.jar
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] BUILD SUCCESS
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Total time: 2.678 s
[INFO] [INFO] Finished at: 2026-06-23T15:19:38+02:00
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] 11/17 prepare:scm-commit-release
[INFO] Checking in modified POMs...
[INFO] 12/17 prepare:scm-tag
[INFO] Tagging release with the label release-2.0...
[INFO] 13/17 prepare:rewrite-poms-for-development
[INFO] 14/17 prepare:remove-release-poms
[INFO] Not removing release POMs
[INFO] 15/17 prepare:run-completion-goals
[INFO] 16/17 prepare:scm-commit-development
[INFO] Checking in modified POMs...
[INFO] 17/17 prepare:end-release
[INFO] Release preparation complete.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10.618 s
[INFO] Finished at: 2026-06-23T15:19:40+02:00
[INFO] ------------------------------------------------------------------------
```
Notice, the line "Building release 1.0-SNAPSHOT"

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the provided Maven release:prepare reproducer and inspect the phases around scm-check-modifications, rewrite-poms-for-release, scm-commit-release, and rewrite-poms-for-development. Compare behavior with and without checkModificationExcludes set to **/pom.xml. Done means the release and development versions are rewritten and the expected SCM commits occur while the excluded POMs remain ignored during modification checks.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system, release
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.