Respect custom Maven build directories - #1949
Open
Marukome0743 wants to merge 1 commit into
Open
Conversation
Marukome0743
force-pushed
the
pr1949
branch
3 times, most recently
from
July 25, 2026 09:00
9e8153e to
3ab29e3
Compare
Marukome0743
force-pushed
the
pr1949
branch
2 times, most recently
from
August 23, 2026 15:34
c9bf63c to
45e9610
Compare
## Summary
- Derive the default Docker output directory from `${project.build.directory}` instead of the fixed `target/docker`.
- Preserve explicit `docker.target.dir` and `<outputDirectory>` overrides.
- Add path-level and Maven integration coverage, plus documentation and changelog updates.
## Problem
Projects that customize Maven’s build directory still default Docker Maven Plugin working files to `target/docker`. The static default ignores `${project.build.directory}` and separates plugin output from the project’s configured build tree.
## Compatibility
The public configuration format is unchanged. Projects using Maven’s standard `target` directory continue to resolve to `target/docker`, while explicit output directory settings retain precedence.
## Verification
- `mise exec java@temurin-11 -- ./mvnw -B -C -V -ntp -Dtest=BuildDirsTest test` — 3 tests, 0 failures
- `mise exec java@temurin-11 -- ./mvnw -B -C -V -ntp clean install -Pjacoco` — 972 tests, 0 failures, 0 errors, 6 skipped
- `mise exec java@temurin-11 -- ./mvnw -B -C -V -ntp -f it/custom-build-directory/pom.xml clean verify` — Docker-free source archive generated below the custom Maven build directory
This reimplements fabric8io#1855 against the current master branch. Thanks to @jdelker for the original report and implementation.
Signed-off-by: Marukome0743 <jambalaya.pyoncafe@gmail.com>
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.
Summary
${project.build.directory}instead of the fixedtarget/docker.docker.target.dirand<outputDirectory>overrides.Problem
Projects that customize Maven’s build directory still default Docker Maven Plugin working files to
target/docker. The static default ignores${project.build.directory}and separates plugin output from the project’s configured build tree.Compatibility
The public configuration format is unchanged. Projects using Maven’s standard
targetdirectory continue to resolve totarget/docker, while explicit output directory settings retain precedence.Verification
mise exec java@temurin-11 -- ./mvnw -B -C -V -ntp -Dtest=BuildDirsTest test— 3 tests, 0 failuresmise exec java@temurin-11 -- ./mvnw -B -C -V -ntp clean install -Pjacoco— 972 tests, 0 failures, 0 errors, 6 skippedmise exec java@temurin-11 -- ./mvnw -B -C -V -ntp -f it/custom-build-directory/pom.xml clean verify— Docker-free source archive generated below the custom Maven build directoryThis reimplements #1855 against the current master branch. Thanks to @jdelker for the original report and implementation.
Signed-off-by: Marukome0743 jambalaya.pyoncafe@gmail.com