Allow non-standard build directory. - #1855
Conversation
|
@jdelker : Thanks, could you please add an entry to doc/changelog.md regarding this change? |
|
|
@jdelker : E2E tests seem to be failing. Could you please take a look? |
Well, I'm lacking insight about what really happens in those integration tests to find the source of that failure. |
|
Fixed docker.target.directory for non-standard build directories.
## 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>
## 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>
## 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>
## 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>
## 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>
## 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>
## 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>



Currently, the general
outputDirectoryhas a fixed default oftarget/docker, which breaks projects with a diverting${project.build.directory}.This change simply adjusts the default, so this aligns correctly.