Skip to content

Respect custom Maven build directories - #1949

Open
Marukome0743 wants to merge 1 commit into
fabric8io:masterfrom
Marukome0743:pr1949
Open

Respect custom Maven build directories#1949
Marukome0743 wants to merge 1 commit into
fabric8io:masterfrom
Marukome0743:pr1949

Conversation

@Marukome0743

@Marukome0743 Marukome0743 commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

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 #1855 against the current master branch. Thanks to @jdelker for the original report and implementation.

Signed-off-by: Marukome0743 jambalaya.pyoncafe@gmail.com

@Marukome0743
Marukome0743 force-pushed the pr1949 branch 3 times, most recently from 9e8153e to 3ab29e3 Compare July 25, 2026 09:00
@Marukome0743
Marukome0743 force-pushed the pr1949 branch 2 times, most recently from c9bf63c to 45e9610 Compare August 23, 2026 15:34
## 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant