无法扩展maven插件配置

发布于 2024-09-18 06:05:47 字数 864 浏览 1 评论 0原文

我正在尝试扩展 Maven 插件:hibernate3 (org.codehaus)。我想做的就是扩展他们的基本插件类并更改一些功能。该插件编译并安装得很好(使用 maven-inherit-plugin [注意:maven-inherit-plugin 的开发已移至 GitHub]),但是在运行时我最终遇到了麻烦。由于某种原因,maven 期望在与我的插件相同的包中存在一个名为 Component 的类;我不太清楚这是为什么——它似乎是由神经丛容器引起的。看来我应该从父插件扩展 org.codehaus.mojo.hibernate3.exporter.Component,但是......作者已经决定该类是最终的。

显然,扩展maven插件(至少是hibernate3)更困难,首先出现,我最好复制源代码并修改它。

然而,如果我能以某种方式告诉 plexus 不要使用我的配置对象,而是使用父插件中的配置对象,那么一切都会好起来的。这可以完成吗(使用委托配置对象类)?

I am trying to extend the maven plugin: hibernate3 (org.codehaus). All I want to do is extend their base plugin class and change some functionality. The plugin compiles and installs just fine (after using maven-inherit-plugin [note: development of maven-inherit-plugin has moved to GitHub]), however at runtime I end up with trouble. For some reason, maven expects there to be a class named Component in the same package as my plugin; I'm not exactly sure why this is -- it seems to be caused by the plexus container. It seems like I should extend the org.codehaus.mojo.hibernate3.exporter.Component from the parent plugin, but ... well the author has decided that class is final.

Clearly extending maven plugins (at least hibernate3) more difficult that it first appears, and I am better off copying the source and modifying it.

However, if I could somehow tell plexus not to use my configuration object, and instead use the one from the parent plugin, all would be well. Can this be done (use a delegate configuration object class)?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文