[
https://issues.apache.org/jira/browse/MNG-8072?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17825025#comment-17825025
]
ASF GitHub Bot commented on MNG-8072:
-------------------------------------
laeubi commented on PR #1437:
URL: https://github.com/apache/maven/pull/1437#issuecomment-1987173800
> Consumer pom is built form the model, if you fill the model you get a
valid consumer pom.
Just look here:
https://github.com/apache/maven/blob/33788fd7fc33932639d1a600eada36e3cd015bfd/maven-core/src/main/java/org/apache/maven/internal/transformation/impl/DefaultConsumerPomArtifactTransformer.java#L79
and here:
https://github.com/apache/maven/blob/33788fd7fc33932639d1a600eada36e3cd015bfd/maven-core/src/main/java/org/apache/maven/internal/transformation/impl/DefaultConsumerPomArtifactTransformer.java#L109
and finally here:
https://github.com/apache/maven/blob/33788fd7fc33932639d1a600eada36e3cd015bfd/maven-core/src/main/java/org/apache/maven/internal/transformation/impl/DefaultConsumerPomBuilder.java#L201
for me it looks like it is reading this file, not the (in memory) pom ...
> Then you don't speak about consumer pom which is well defined as a
consummable pom by downstream builds (v4.0.0), anything else is not consumer
pom and does not belong to core IMO - I suspect even if not sure you want some
tycho meta but this is not about consumer pom IMHO, potentially main pom but
consumer has another intent.
I'm defiantly talking about consumer pom, because consumers ( == plain
maven) wants to have a pom that they can consume without Tycho (Tycho itself
don't need a physical pom.xml). So if you build some jar with Tycho you want it
to be consumable after you deployed it to central by others (non Tycho users)
like a traditionally hand written pom.xml
> Add a consumerPomFile to the MavenProject
> -----------------------------------------
>
> Key: MNG-8072
> URL: https://issues.apache.org/jira/browse/MNG-8072
> Project: Maven
> Issue Type: Improvement
> Reporter: Christoph Läubrich
> Priority: Major
>
> Currently there is some vague definition of a "build pom" versus a "consumer
> pom":
> * https://maven.apache.org/studies/consumer-pom/
> * https://cwiki.apache.org/confluence/display/MAVEN/Build+vs+Consumer+POM
> there are also some plugins around to work with this e.g.
> *
> https://tycho.eclipseprojects.io/doc/latest/tycho-packaging-plugin/update-consumer-pom-mojo.html
> * https://www.mojohaus.org/flatten-maven-plugin/plugin-info.html
> but there are some issues:
> # Maven makes some assumptions about its "file", e.g setting the file changes
> the basedir
> # Even though there is a setPomFile method that do not change the basedir
> e.g. a parent ref by default would be broken
> # once we change the file, there is a mismatch between the pom on disk and
> the model
> # it is not possible for a plugin to know the original file and the consumer
> file, e.g. if I want to deploy the original file e.g. with classifier
> "pom-build"
> # because of this usually "consumer pom plugins" generate the the new pom to
> a new file in the project root, where it actually not belongs to and leaves
> the file even after mvn clean if no special actions are taken.
> I therefore like to suggest to enhance the MavenProject with one more method
> set/getConsumerPom that fills this gap, then plugins working on the consumer
> pom can set the file there and e.g.
> https://maven.apache.org/plugins/maven-deploy-plugin/deploy-mojo.html can
> look there first, or even have an option to deploy both poms automatically if
> they differ.
> Of course this will be nothing happen right now but looks like something that
> can become useful over time and maybe fully adapted in Maven4.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)