jira-importer commented on issue #310:
URL: 
https://github.com/apache/maven-install-plugin/issues/310#issuecomment-2771867015

   **[Tamas 
Cservenak](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=cstamas)**
 commented
   
   Direct mojo invocation like `jar:jar` instructs Maven "do create a JAR for 
the project", and Maven obeys (creates empty JAR with Maven metadata only as 
there are no classes). If using lifecycle (ie. invoking `{}package{`}), it 
would _not been invoked_ as packaging=pom does not use JAR plugin at all. 
Basically by direct mojo invocations you are circumventing the lifecycle (and 
packaging) of Maven. That is another problem (see related MNG issues) that 
Maven allows doing this, and will end up in "inconsistent internal state" 
(Maven Project of packaging POM will have JAR attached as main JAR, replacing 
the POM artifact). But again, user instructed Maven to do so, by invoking 
`jar:jar` on a module, that would otherwise never invoke this goal as part of 
lifecycle.
   


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