gnodet opened a new pull request, #612:
URL: https://github.com/apache/maven-jar-plugin/pull/612
## Problem
Fixes #308 / MJAR-138.
The `test-jar` goal's `skip` parameter was bound to `${maven.test.skip}`.
This meant passing `-Dmaven.test.skip=true` — which also skips test compilation
— silently prevented the test-jar from being built. In multi-module projects
where a downstream module has a `test-jar` dependency, this broke the build.
This is a long-standing (2010) tension between two intentional decisions:
- **MJAR-90**: skip the test-jar when `maven.test.skip=true` to avoid
producing an *empty* test-jar (tests weren't compiled)
- **MJAR-138**: but skipping the test-jar breaks cross-module test-jar
dependencies
## Solution
Rebind `skip` from `${maven.test.skip}` to `${maven.test.jar.skip}` (default
`false`).
The MJAR-90 concern (empty test-jar) is already handled by `skipIfEmpty` in
modern versions. There is no longer a reason to couple test-jar packaging to
`maven.test.skip`.
**Users who want to skip test-jar packaging** should now use
`-Dmaven.test.jar.skip=true` (or `<skip>true</skip>` in POM config — unchanged).
**Users who want to skip test execution** without breaking downstream
modules should use:
- `-DskipTests` (Maven 3+)
- `--skip-tests` (Maven 4.1+, see #13233)
## Changes
- `TestJarMojo`: rebind `skip` property from `maven.test.skip` →
`maven.test.jar.skip`
- New IT `mjar-138`: multi-module build with `-DskipTests` — verifies model
test-jar is built and client can compile against it via the reactor
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]