gnodet opened a new pull request, #719: URL: https://github.com/apache/maven-deploy-plugin/pull/719
## Summary - When a project uses **module source hierarchy** (`<source><module>…`), the JAR plugin produces one JAR per JPMS module as attached artifacts and never assigns a file to the main artifact — the deploy plugin then fails with "is a folder" - Auto-detects this case by checking `ProjectManager.getSourceRoots()` for any enabled `SourceRoot` with `module().isPresent()`, and removes the main artifact from the deploy request - Deploys only the POM and per-module JARs — no flag required, no user configuration needed ## How it differs from #717 [PR #717](https://github.com/apache/maven-deploy-plugin/pull/717) requires `allowIncompleteProjects=true` — a flag whose name and semantics don't match the module source hierarchy use case. This PR auto-detects instead: | | [#717](https://github.com/apache/maven-deploy-plugin/pull/717) | This PR | | --- | --- | --- | | Requires `allowIncompleteProjects=true` | Yes | No | | Detection | Generic (attached artifacts exist) | Specific (enabled source roots declare modules) | | Existing `allowIncompleteProjects` behavior | Replaced | Preserved unchanged | ## Context This is the deploy-plugin counterpart of [maven-install-plugin#468](https://github.com/apache/maven-install-plugin/pull/468), using the same auto-detection approach. This is a **workaround for Maven 4.0** (API is frozen). The proper fix is tracked in [apache/maven#13396](https://github.com/apache/maven/issues/13396) — a `Packaging.producesMainArtifact()` API for Maven 4.1.0 that would let the JAR plugin explicitly signal "no main artifact", eliminating the need for detection in the deploy plugin. ## Test plan - [x] New test `moduleSourceHierarchySkipsMainArtifactAtDeploy` — sets up enabled source roots with a module, attaches a module JAR, sets main artifact path to a directory, verifies only POM + module JAR are deployed - [x] All 50 existing tests pass unchanged -- 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]
