Skip to content

Skip the main artifact when its file is a directory (module source hierarchy) - #717

Open
ascheman wants to merge 1 commit into
apache:masterfrom
aschemaven:bugfix/msh-deploy-is-a-folder
Open

ascheman wants to merge 1 commit into
apache:masterfrom
aschemaven:bugfix/msh-deploy-is-a-folder

Conversation

@ascheman

@ascheman ascheman commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

When a project uses the Maven 4 module source hierarchy, the JAR plugin produces one JAR per Java module and attaches them as separate artifacts, without assigning a file to the project's main artifact — its path stays the (directory) build output.

With allowIncompleteProjects=true, deploy warned about the missing main file but still passed the directory to the deployer, which failed:

Failed to deploy artifact …:jar:…: is a folder

(reported by @desruisseaux while building apache/sis.)

This drops the main artifact from the deploy request in that case and deploys the POM + the attached per-module JARs only. A new DeployMojoTest case asserts the directory main artifact is excluded from the request (it fails without this change).

The existing "change packaging to 'pom'" warning is kept as-is for minimality; it now reads a bit oddly since the attachments deploy successfully — happy to reword if preferred.

@ascheman ascheman added the bug Something isn't working label Oct 9, 2026
@ascheman ascheman added this to the 4.0.0-beta-4 milestone Oct 9, 2026

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Clean, minimal fix for the module source hierarchy deploy failure. Pre-fix test validation confirmed: the new test fails without the fix (directory main artifact stays in the deploy request) and passes with it. All 50 existing tests remain green.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

…archy)

A project built with the Maven 4 module source hierarchy produces one JAR
per Java module, attached as separate artifacts, and never assigns a file
to the main artifact -- its path stays the (directory) build output. With
allowIncompleteProjects=true the deploy goal warned about the missing
main file but still passed the directory to the deployer, which failed
with "is a folder".

Drop the main artifact from the deploy request in that case and deploy
the POM and the attached per-module JARs only.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants