cstamas commented on issue #11242:
URL: https://github.com/apache/maven/issues/11242#issuecomment-3401232652

   Also, one very important bit, that people tend to forget:
   
   _I as a publisher_ may have a simple single module project w/ 
`packaging=jar` and and I publish it to Central under GAV.
   
   _You, as a consumer_ are not obliged to consume my JAR, as you can still 
depend on my project with `type=pom`, which is totally "legal" and valid, and 
in this case, your Maven will pull my POM only and never JAR. Use case for this 
may be simply "reusing my dependencies" without reusing my own code (weird, but 
still valid).
   
   Moral of the story: Maven publishing and Maven consuming are intentionally 
disconnected in this way (people keep confusing `packaging`, `type` and 
`extension`, assuming they are same; which is not true). Also, "consumer" Maven 
(run by you while consuming my project) completely _ignores_ packaging of my 
project (that has `packaging=jar`), and listens to _your instructions_, that is 
`type=pom`. 
   
   Typical example is plain JAR, that can be produced by packaging `jar`, but 
also with [things](https://github.com/takari/takari-lifecycle) like 
`takari-jar` for example. Both output will produce `JAR` that can be consumed 
as `type=jar` (the default, usually not written), and there is no need for you 
to assume "how it was built" (was it `jar` or `takari-jar` or 
`my-super-duper-jar-packaging` at build time).


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