Concurrent builder skips 'verify' phase when running 'mvn install'
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 88/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- java
- Domain
- build-system
Research direction
Start in DefaultLifecycleRegistry.DefaultLifecycle.phases() and inspect the phase-tree declarations for INSTALL, DEPLOY, VERIFY, and PACKAGE. Run the relevant Maven build or lifecycle tests with the concurrent builder; done means install and deploy wait for VERIFY while preserving the existing package-to-verify ordering.
Written by the indexing model from the issue text.
Description
Problem
In the new phase tree introduced in Maven 4, the install and deploy phases depend on package but not on verify. This means:
- The concurrent builder (
-b concurrent) silently skipsverifywhen runningmvn install, because there is no declared dependency betweeninstallandverifyin the DAG. - The classic sequential builder still executes
verifyincidentally (because phases are flattened in order), but this is an accidental property of the flattening, not a semantic guarantee.
This was flagged as a disruptive regression by @rmannibucau: users running mvn install expect verification (unit tests, integration tests) to have run before the artifact is installed to the local repository.
Root Cause
In DefaultLifecycleRegistry.DefaultLifecycle.phases(), the phase tree is:
EACH
├── VALIDATE / INITIALIZE
├── BUILD
│ ├── SOURCES / RESOURCES
│ ├── COMPILE (after SOURCES)
│ ├── READY (after COMPILE, after RESOURCES)
│ └── PACKAGE (after READY)
├── VERIFY ← depends on VALIDATE only
│ ├── UNIT_TEST / TEST / ...
│ └── INTEGRATION_TEST
├── INSTALL (after PACKAGE) ← ⚠ should depend on VERIFY
└── DEPLOY (after PACKAGE) ← ⚠ should depend on VERIFY
INSTALL and DEPLOY declare after(PACKAGE) but not after(VERIFY).
Fix
Change INSTALL and DEPLOY to depend on VERIFY instead of PACKAGE:
phase(INSTALL, after(VERIFY)),
phase(DEPLOY, after(VERIFY)))));```
This is semantically correct: you should not install an artifact that has not been verified. `VERIFY` itself already depends transitively on `PACKAGE` (via the `BUILD` subtree), so the full build order is preserved.
## Planned work
- **4.0.x**: Fix `install` → `verify` and `deploy` → `verify` dependencies (this issue)
- **4.1.0**: Same fix + introduce a `--skip-phases` CLI option as a proper replacement for ad-hoc `-DskipTests` conventions (separate issue/PR)
_Reported by Guillaume Nodet_
- Dominant language
- Java
- Stars
- 5.4k
- Forks
- 3.1k
- Avg merge
- 20h 29m
- Merged PRs (30d)
- 350
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/maven
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 78/100
-
documentation priority:minor
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 55/100
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
breaking maintenance
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
opensearch-project/k-NN#3597 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100