gnodet-bot commented on code in PR #466:
URL:
https://github.com/apache/maven-install-plugin/pull/466#discussion_r4235189793
##########
src/main/java/org/apache/maven/plugins/install/InstallMojo.java:
##########
@@ -267,6 +268,11 @@ private ArtifactInstallerRequest processProject(Project
project) {
getLog().warn("");
getLog().warn("Incomplete projects like this will
fail in future Maven versions!");
getLog().warn("");
+ // The main artifact has no file (its path is e.g.
the output directory of a module
+ // source hierarchy, where the JAR plugin attaches
one JAR per Java module instead).
+ // Install the POM and the attachments only; do
not hand the directory to the installer,
+ // which would otherwise fail with "is a folder".
+ toInstall.remove(installable);
Review Comment:
⚠️ **Misleading warning for module-source-hierarchy projects**
After this change, for module-source-hierarchy projects the install
*succeeds* (POM + attachments are installed), yet the surrounding warning still
says:
> `"Incomplete projects like this will fail in future Maven versions!"`
This is now factually wrong for the case this PR targets — the install does
**not** fail. The warning was written for the truly broken case (missing file +
attachments but wrong packaging), not for legitimate module-source-hierarchy
usage.
You noted this in the PR description ("it now reads a bit oddly") — worth
addressing: either split the warning so it only fires for the unresolved case,
or soften the wording when the remove path is taken. Something like:
```java
getLog().info("Skipping directory-backed main artifact — "
+ "installing POM and attachments only (module source hierarchy).");
```
rather than emitting a doom-and-gloom warning that contradicts the
successful outcome.
--
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]