elharo commented on issue #453: URL: https://github.com/apache/maven-shade-plugin/issues/453#issuecomment-5118155155
per gemini: This is an issue that should be fixed in the `maven-shade-plugin`, not closed. The Maven team has correctly classified it as a `bug` with `priority:major`. The core issue stems from an unintended side effect of MSHADE-321 (Always respect 'createDependencyReducedPom' flag), introduced in version 3.3.0 of the plugin. Here is why this is a legitimate bug in the shade plugin: 1. **Context Mutation:** When the shade plugin runs, it generates a `dependency-reduced-pom.xml` file. The bug occurs because the plugin tells the core Maven execution context that the current project's POM is now located at `target/dependency-reduced-pom.xml` instead of the original `pom.xml` in the base directory. 2. **Cascading Failures (Breaking the Build Environment):** Because Maven's `basedir` property is inferred from the location of the active `pom.xml` file, moving the active POM into the `target/` directory causes the project's `basedir` to shift from the root directory to the `target/` directory for any plugin that executes *after* the shade plugin. 3. **Widespread Plugin Impact:** This shifted `basedir` breaks plugins that rely on relative paths from the project root. In the reported issues, it caused the `apache-rat-plugin` (license checker) to fail because it suddenly started scanning from `target/` and its relative exclusions broke. It also broke the `maven-checkstyle-plugin` because it could no longer find its suppression file using a path relative to the root directory. While users can work around this by changing the phase of their other plugins (e.g., running `rat` in `validate` or `test` before `shade` runs in `package`), this is a breaking change in behavior. A plugin should not silently mutate the build's base directory context for downstream plugins. -- 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]
