Re: Use Java record in org.apache.maven.api.model?

2025-03-25 Thread Elliotte Rusty Harold
Really what we need to do is eliminate modello. It's a failed effort from back in the 2000s when people who are no longer around thought they were building a general purpose framework for Java apps instead of a build tool and repository system. It makes our build and development far more complex th

Use Java record in org.apache.maven.api.model?

2025-03-25 Thread Martin Desruisseaux
Hello The `org.apache.maven.api.model` package of Maven 4 contains classes generated automatically from the `maven.mdo` file [1], which describes the POM. The generated classes are similar to Java records (unmodifiable, straightforward getter methods, etc.). However, they have a lot of boiler

Re: Use Java record in org.apache.maven.api.model?

2025-03-25 Thread Martin Desruisseaux
Le 2025-03-25 à 13 h 00, Elliotte Rusty Harold a écrit : Really what we need to do is eliminate modello. So what about this plan? * Check-in the generated classes as they are today. * Remove Modello. * Try on a branch to change the classes to record. Martin

Re: Use Java record in org.apache.maven.api.model?

2025-03-25 Thread Guillaume Nodet
Note that the generation is now done through a few velocity templates. A single template is used to generate all the model classes: https://github.com/apache/maven/blob/master/src/mdo/model.vm That one is used to generate the 7 models we use (model, extensions, metadata, plugin, lifecycle, settin

Re: Use Java record in org.apache.maven.api.model?

2025-03-25 Thread Romain Manni-Bucau
+1 for this plan Romain Manni-Bucau @rmannibucau | .NET Blog | Blog | Old Blog | Github | LinkedIn

Re: Use Java record in org.apache.maven.api.model?

2025-03-25 Thread Guillaume Nodet
-1 I'm fine if someone wants to rewrite modello to something easier to deal with. Manually maintaining hand written v3 model + v4 model + writers + reader + v3 reader + v3 writer + schema for the 5+ schemas we do have, certainly does not fall into this category. Generating code means that we have

Re: Use Java record in org.apache.maven.api.model?

2025-03-25 Thread Guillaume Nodet
To be clear, I'm fine with enhancing the generated model and experiment with records. But it can be done by modifying a single file rather than a few hundreds for all generated model classes we have. Le mar. 25 mars 2025 à 13:38, Guillaume Nodet a écrit : > -1 > > I'm fine if someone wants to re