gnodet opened a new pull request, #468:
URL: https://github.com/apache/maven-install-plugin/pull/468

   ## 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 install plugin then crashes with "Is 
a directory"
   - Auto-detects this case by checking `ProjectManager.getSourceRoots()` for 
any `SourceRoot` with `module().isPresent()`, and removes the main artifact 
from the install request
   - Installs only the POM and per-module JARs — no flag required, no user 
configuration needed
   
   ## How it differs from #466
   
   [PR #466](https://github.com/apache/maven-install-plugin/pull/466) requires 
`allowIncompleteProjects=true` — a flag whose name and semantics don't match 
the module source hierarchy use case. This PR auto-detects instead:
   
   | | #466 | This PR |
   |---|---|---|
   | Requires `allowIncompleteProjects=true` | Yes | No |
   | Detection | Generic (attached artifacts exist) | Specific (source roots 
declare modules) |
   | Existing `allowIncompleteProjects` behavior | Replaced | Preserved 
unchanged |
   
   ## Context
   
   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 install plugin.
   
   ## Test plan
   
   - [x] New test `moduleSourceHierarchySkipsMainArtifact` — sets up source 
roots with a module, attaches a module JAR, sets main artifact path to a 
directory, verifies only POM + module JAR are installed
   - [x] All 35 existing tests pass unchanged
   - [ ] Integration test with an actual module source hierarchy project (e.g. 
Apache SIS)
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
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]

Reply via email to