gnodet opened a new issue, #596: URL: https://github.com/apache/maven-jar-plugin/issues/596
## Problem `maven-jar-plugin` 3.4.2 validates the **derived** automatic module name (inferred from the artifact's `Automatic-Module-Name` manifest attribute or from the artifactId) even when it is not explicitly configured in the POM. If the derived name contains hyphens (which are not valid in Java module names), the build fails: ``` Error assembling JAR: Invalid automatic module name: 'org.apache.geronimo.arthur.integration-test' ``` This was not enforced in `maven-jar-plugin` 3.3.1. The stricter validation was introduced via `maven-archiver` in 3.4.2. The check `isValidModuleName()` in `maven-archiver`'s `MavenArchiver` now validates the derived module name, but many legitimate Apache projects have artifact IDs containing hyphens (e.g. `integration-test`, `osgi-cdi`) which produce invalid module names when derived mechanically. These projects do not intend to be JPMS modules and have no `module-info.java`. ## Steps to reproduce 1. Build a project whose artifactId (or `Automatic-Module-Name` manifest entry) contains a hyphen, e.g. `my-artifact-integration-test`. 2. Use `maven-jar-plugin` 3.4.2. 3. Build fails with `Error assembling JAR: Invalid automatic module name: '...'`. ## Expected behavior One of: - **Only validate explicitly declared names**: If `Automatic-Module-Name` is not set explicitly in the POM's `<archive><manifestEntries>`, do not fail — the derived name is merely informational for unnamed modules and does not need to be a valid JPMS module name. - **Warn instead of fail**: Emit a warning so the project is aware of the problem without breaking the build. ## Affected versions - 3.4.2 (regression vs 3.3.1) ## Context Found while running Maven 4 compatibility tests across Apache projects. Affected projects include: - `geronimo-arthur` — derived name `org.apache.geronimo.arthur.integration-test` - `incubator-kie-kogito-benchmarks` — empty derived name - `karaf-winegrower` — derived name `org.apache.winegrower.cepages.winegrower-cepage-osgi-cdi` None of these projects declare `module-info.java` or intend to be named JPMS modules. -- 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]
