-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MNG-7588] generate reader and some beans automatically for plugin #862
base: master
Are you sure you want to change the base?
[MNG-7588] generate reader and some beans automatically for plugin #862
Conversation
@gnodet Do we need to keep the old beans in |
</models> | ||
<templates> | ||
<template>src/main/mdo/model.vm</template> | ||
<template>src/main/mdo/reader.vm</template> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we generate a writer here or rather separately in m-plugin-tools?
We need to be very cautious for some time and avoid breaking compatibility as much as possible. The new api is still in alpha and we need to upgrade most plugins before even deprecating all the old parts. |
maven-plugin-api/pom.xml
Outdated
<!-- remove those classes which need to ba maintained manually --> | ||
<includes> | ||
<include>MojoDescriptor.java</include> | ||
<include>PluginDescriptor.java</include> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A better idea imho would be to tweak the src/mdo/model.vm
to add a list of classes to not generate instead of generating them and removing them. A variable similar to packageModelV4
should work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The generated classes are incompatible with the existing ones, so I fear this is a big change. The maven-plugin-plugin
will probably be broken by such a change.
That's why for the v4 api, I've rather created entirely new packages so that we can phase the old ones out while keeping compatibility.
Maybe I'm wrong, but I think the fact that the MojoDescriptor
and PluginDescriptor
inherits the plexus ComponentSetDescriptor
is only used internally in maven. If that's actually the case, I would favor trying to build a brand new and clean object model (without plexus) and only create the plexus required classes from those generated classes when needed.
Ok, so when generating descriptor beans in a dedicated package, where should this live? IMHO it doesn't make sense to expose under https://github.com/apache/maven/tree/master/api/maven-api-core. This should rather be a private package (only for consumption of Maven Core and maybe Maven Plugin Tools). I don't think it would be useful to add this to the documented v4 API of Maven. So I am rather thinking about putting the new/clean/immutable plugin descriptor classes into |
Sounds good to me. |
7229cd1
to
4c71859
Compare
I would like to migrate all usage of Maven Core from the old |
descriptor
WIP (i.e. Core module is currently broken)