Re: Maven moving to the next level: the build/consumer pom

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Maven moving to the next level: the build/consumer pom

rfscholte

On 25-6-2020 02:03:42, Anton Vodonosov <[hidden email]> wrote:
Can this work also allow arbitrary property expression in a module ?
Robert Scholte:
Currently only the ci-friendly version placeholders are supported.


Currently, this practice is discouraged because the deployed pom with property
expression is meaningless.
The flatten-maven-plugin can produce correct poms for deployment,
with all properties resolved; despite maven prints the hardcoded warning
"'version' contains an expression but should be a constant".
Robert Scholte: 
The statement is still that versions should be constants and not expressions. It is likely that this is one of the next things that will be implemented.
This announcement is especially for tools needing to read the new local pom.xml
There's a small set of features added, so they can investigate if it works.
It would be a huge waste of time if we discover that the current implementation makes it impossible for IDEs to embed Maven.



Links on the topic:
http://mail-archives.apache.org/mod_mbox/maven-users/201201.mbox/%3CCA+nPnMyb_W4Ldrg5zTn5NX3F2kcrPXDefS4gjzz3OE0cUy1rXw@...%3E
https://issues.apache.org/jira/browse/MNG-4715
https://stackoverflow.com/questions/19123013/maven-version-with-a-property/19123130

Why I'm interested in property expressions for versions is because I want to generate
versions automatically as a hash code of all sources and dependencies.

And also skip building of modules whose has-version has not changed.

That way the large multi-module project can vary significantly improve build speed
and reduce the artifact storage consumption. Similar to what build caches
give for gradle and bazel, only a bit simplified, less granular - caching done
on the level of final artifacts, but not for intermediate outputs
(compiled file, generated resources).

If would be very convenient if maven-flatten-plugin become unnecessary
and maven supported property expressions in version spec out of box.
Robert Scholte:
The flatten-maven-plugin was written because there was a direct need for manipulating poms that could not be solved easily inside Maven itself.
This is one step into the right direction.



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Maven moving to the next level: the build/consumer pom

Hervé BOUTEMY
idea: why not create a branch in one or multiple Maven multi-module builds
that will show the new features (no parent version, no version for reactor,
and I don't know what else)

I suppose creating such branches in maven-archetype, maven-plugin-tools, Maven
core itself, would not be hard and would bring examples to test both on CLI (I
expect the build to fail if the experimental feature is not enabled), then in
IDE

Regards,

Hervé

Le samedi 4 juillet 2020, 10:12:24 CEST Robert Scholte a écrit :

> On 4-7-2020 08:08:00, Mark Derricutt <[hidden email]> wrote:
> I thought I’d responded - this has been a long time coming, and has been
> discussed numerous times over the past few years, and I’m quite excited to
> give it a bash, and see how well it works, and see if/what any implications
> this has for our tiles-maven-plugin.
>
> I still need to find time to dig into this.
>
> Robert - is there anything specific one does to “enable” this currently -
> or is the current merge simply the machinery to take the build pom (even if
> its a 4.0.0 model) and produce the consumer pom.
> Robert Scholte:
> There is a feature toggle, see
> https://github.com/apache/maven/blob/master/maven-model-builder/src/main/jav
> a/org/apache/maven/feature/Features.java#L34
>
> Here you see the name, which is still part of discussion because it is not
> that experimental anymore, and its default value.
>
>
> Currently I don’t see any diffs between my pom.xml, and the pom.xml that
> gets included inside the .jar file, I tried doing a “mvn deploy” to check
> the version that got deployed, but yields an missing class exception using
> 2.8.2:
>
> Robert Scholte:
> That is one one the next important steps that needs to be implemented: the
> archiver should include the consumer pom.xml, not the local pom.
>
> [ERROR] Failed to execute goal
> org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy (default-deploy)
> on project smx3.reporting: Execution default-deploy of goal
> org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy failed: A
> required class was missing while executing
> org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy:
> org/eclipse/aether/transform/FileTransformer
> [ERROR] -----------------------------------------------------
> [ERROR] realm = plugin>org.apache.maven.plugins:maven-deploy-plugin:2.8.2
>
> Robert Scholte:
> Does this mean that the install:install did work?
> That would be interesting.
> I am not aware of that issue. Is there already a JIRA ticket for it, because
> this must be solved before the next release.
>
>
> (I’m unable to currently use 3.0.0-M1 for the same reason either).
>
> Hrm.
> Mark
>
>
> From: Jaroslav Tulach
>
> Reply: Maven Developers List
> Date: 4 July 2020 at 5:35:37 PM
> To: dev
> Cc: [hidden email] ,
> [hidden email] ,
> [hidden email] ,
> [hidden email]
> Subject: Re: Maven moving to the next level: the build/consumer pom
>
> Hello Robert,
> I am not sure how to deal with your announcement and given no reaction on
> the dev@netbeans mailing list, I am probably not alone. Can you formulate





---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Maven moving to the next level: the build/consumer pom

Hervé BOUTEMY
I just created "buildconsumer" branch for Maven Archetype:
https://github.com/apache/maven-archetype/tree/buildconsumer

CLI building with Maven 3.6.3 expectedly breaks:
$ mvn verify -Drevlist=test
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] 'parent.version' is missing. @ line 26, column 11
[FATAL] 'parent.version' is missing. @ line 26, column 11
[FATAL] 'parent.version' is missing. @ line 26, column 11
[FATAL] 'parent.version' is missing. @ line 25, column 11
 @
[ERROR] The build could not read 4 projects -> [Help 1]
[ERROR]  
[ERROR]   The project org.apache.maven.archetype:archetype-models:[unknown-version] (/home/herve/projets/maven/sources/plugins/tools/archetype/archetype-models/pom.xml) has 1 error
[ERROR]     'parent.version' is missing. @ line 26, column 11
[ERROR]  
[ERROR]   The project org.apache.maven.archetype:archetype-common:[unknown-version] (/home/herve/projets/maven/sources/plugins/tools/archetype/archetype-common/pom.xml) has 1 error
[ERROR]     'parent.version' is missing. @ line 26, column 11
[ERROR]  
[ERROR]   The project org.apache.maven.plugins:maven-archetype-plugin:[unknown-version] (/home/herve/projets/maven/sources/plugins/tools/archetype/maven-archetype-plugin/pom.xml) has 1 error
[ERROR]     'parent.version' is missing. @ line 26, column 11
[ERROR]  
[ERROR]   The project org.apache.maven.archetype:archetype-packaging:[unknown-version] (/home/herve/projets/maven/sources/plugins/tools/archetype/archetype-packaging/pom.xml) has 1 error
[ERROR]     'parent.version' is missing. @ line 25, column 11


With 3.7.0-SNAPSHOT, most issues are gone, but 1 remains:
$ mvn verify -Drevlist=test
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] 'dependencies.dependency.version' for org.apache.maven.archetype:archetype-packaging:jar is missing. @ org.apache.maven.plugins:maven-archetype-plugin:[unknown-version], /home/herve/projets/maven/sources/plugins/tools/archetype/maven-archetype-plugin/pom.xml, line 81, column 17
 @
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]  
[ERROR]   The project org.apache.maven.plugins:maven-archetype-plugin:3.2.0-SNAPSHOT (/home/herve/projets/maven/sources/plugins/tools/archetype/maven-archetype-plugin/pom.xml) has 1 error
[ERROR]     'dependencies.dependency.version' for org.apache.maven.archetype:archetype-packaging:jar is missing. @ org.apache.maven.plugins:maven-archetype-plugin:[unknown-version], /home/herve/projets/maven/sources/plugins/tools/archetype/maven-archetype-plugin/pom.xml, line 81, column 17

I suppose it is because of the test-scoped dependency that is not covered...


I'll try creating such branch on other Maven multi-module builds to check if they build with CLI
Then it will be about checking in IDE how well it work or not...

Regards,

Hervé


Le dimanche 5 juillet 2020, 11:07:56 CEST Hervé BOUTEMY a écrit :

> idea: why not create a branch in one or multiple Maven multi-module builds
> that will show the new features (no parent version, no version for reactor,
> and I don't know what else)
>
> I suppose creating such branches in maven-archetype, maven-plugin-tools,
> Maven core itself, would not be hard and would bring examples to test both
> on CLI (I expect the build to fail if the experimental feature is not
> enabled), then in IDE
>
> Regards,
>
> Hervé
>
> Le samedi 4 juillet 2020, 10:12:24 CEST Robert Scholte a écrit :
> > On 4-7-2020 08:08:00, Mark Derricutt <[hidden email]> wrote:
> > I thought I’d responded - this has been a long time coming, and has been
> > discussed numerous times over the past few years, and I’m quite excited to
> > give it a bash, and see how well it works, and see if/what any
> > implications
> > this has for our tiles-maven-plugin.
> >
> > I still need to find time to dig into this.
> >
> > Robert - is there anything specific one does to “enable” this currently -
> > or is the current merge simply the machinery to take the build pom (even
> > if
> > its a 4.0.0 model) and produce the consumer pom.
> > Robert Scholte:
> > There is a feature toggle, see
> > https://github.com/apache/maven/blob/master/maven-model-builder/src/main/j
> > av a/org/apache/maven/feature/Features.java#L34
> >
> > Here you see the name, which is still part of discussion because it is not
> > that experimental anymore, and its default value.
> >
> >
> > Currently I don’t see any diffs between my pom.xml, and the pom.xml that
> > gets included inside the .jar file, I tried doing a “mvn deploy” to check
> > the version that got deployed, but yields an missing class exception using
> > 2.8.2:
> >
> > Robert Scholte:
> > That is one one the next important steps that needs to be implemented: the
> > archiver should include the consumer pom.xml, not the local pom.
> >
> > [ERROR] Failed to execute goal
> > org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy (default-deploy)
> > on project smx3.reporting: Execution default-deploy of goal
> > org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy failed: A
> > required class was missing while executing
> > org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy:
> > org/eclipse/aether/transform/FileTransformer
> > [ERROR] -----------------------------------------------------
> > [ERROR] realm = plugin>org.apache.maven.plugins:maven-deploy-plugin:2.8.2
> >
> > Robert Scholte:
> > Does this mean that the install:install did work?
> > That would be interesting.
> > I am not aware of that issue. Is there already a JIRA ticket for it,
> > because this must be solved before the next release.
> >
> >
> > (I’m unable to currently use 3.0.0-M1 for the same reason either).
> >
> > Hrm.
> > Mark
> >
> >
> > From: Jaroslav Tulach
> >
> > Reply: Maven Developers List
> > Date: 4 July 2020 at 5:35:37 PM
> > To: dev
> > Cc: [hidden email] ,
> > [hidden email] ,
> > [hidden email] ,
> > [hidden email]
> > Subject: Re: Maven moving to the next level: the build/consumer pom
> >
> > Hello Robert,
> > I am not sure how to deal with your announcement and given no reaction on
> > the dev@netbeans mailing list, I am probably not alone. Can you formulate
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]





---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Maven moving to the next level: the build/consumer pom

rfscholte
In reply to this post by Hervé BOUTEMY
That is actually the first reference of my original e-mail: simple-parent with the simple-weather + simple-webapp.
I've added as an integration-test to ensure all these features work as expected.
The expected-folder contains what I expect to be installed to the local repository.

Robert


[1] https://github.com/apache/maven-integration-testing/tree/master/core-it-suite/src/test/resources/mng-6656-buildconsumer [https://github.com/apache/maven-integration-testing/tree/master/core-it-suite/src/test/resources/mng-6656-buildconsumer]

On 5-7-2020 11:08:03, Hervé BOUTEMY <[hidden email]> wrote:
idea: why not create a branch in one or multiple Maven multi-module builds
that will show the new features (no parent version, no version for reactor,
and I don't know what else)

I suppose creating such branches in maven-archetype, maven-plugin-tools, Maven
core itself, would not be hard and would bring examples to test both on CLI (I
expect the build to fail if the experimental feature is not enabled), then in
IDE

Regards,

Hervé

Le samedi 4 juillet 2020, 10:12:24 CEST Robert Scholte a écrit :

> On 4-7-2020 08:08:00, Mark Derricutt wrote:
> I thought I’d responded - this has been a long time coming, and has been
> discussed numerous times over the past few years, and I’m quite excited to
> give it a bash, and see how well it works, and see if/what any implications
> this has for our tiles-maven-plugin.
>
> I still need to find time to dig into this.
>
> Robert - is there anything specific one does to “enable” this currently -
> or is the current merge simply the machinery to take the build pom (even if
> its a 4.0.0 model) and produce the consumer pom.
> Robert Scholte:
> There is a feature toggle, see
> https://github.com/apache/maven/blob/master/maven-model-builder/src/main/jav
> a/org/apache/maven/feature/Features.java#L34
>
> Here you see the name, which is still part of discussion because it is not
> that experimental anymore, and its default value.
>
>
> Currently I don’t see any diffs between my pom.xml, and the pom.xml that
> gets included inside the .jar file, I tried doing a “mvn deploy” to check
> the version that got deployed, but yields an missing class exception using
> 2.8.2:
>
> Robert Scholte:
> That is one one the next important steps that needs to be implemented: the
> archiver should include the consumer pom.xml, not the local pom.
>
> [ERROR] Failed to execute goal
> org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy (default-deploy)
> on project smx3.reporting: Execution default-deploy of goal
> org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy failed: A
> required class was missing while executing
> org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy:
> org/eclipse/aether/transform/FileTransformer
> [ERROR] -----------------------------------------------------
> [ERROR] realm = plugin>org.apache.maven.plugins:maven-deploy-plugin:2.8.2
>
> Robert Scholte:
> Does this mean that the install:install did work?
> That would be interesting.
> I am not aware of that issue. Is there already a JIRA ticket for it, because
> this must be solved before the next release.
>
>
> (I’m unable to currently use 3.0.0-M1 for the same reason either).
>
> Hrm.
> Mark
>
>
> From: Jaroslav Tulach
>
> Reply: Maven Developers List
> Date: 4 July 2020 at 5:35:37 PM
> To: dev
> Cc: [hidden email] ,
> [hidden email] ,
> [hidden email] ,
> [hidden email]
> Subject: Re: Maven moving to the next level: the build/consumer pom
>
> Hello Robert,
> I am not sure how to deal with your announcement and given no reaction on
> the dev@netbeans mailing list, I am probably not alone. Can you formulate





---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]