在 Maven Javadoc/站点编译期间忽略同级模块
我有一个 Maven 管理的项目,其中包含一些模块,其中之一是实际感兴趣的库。其他模块只是基于该库构建的附加组件或示例。我希望为这个库生成 Maven 站点并自动部署它(作为独立站点而不是作为多模块站点的一部分),但我在使用 Javadoc 插件时遇到了问题。
执行 javadoc:javadoc
目标时,javadoc 插件尝试访问其他模块的 jar
导致失败。
我创建了一个简单的示例来演示这种现象。确保在其他任何目标之前运行 clean
目标,以便显示缺陷。虽然首先执行打包可以解决此错误,但这是无法完成的,因为用例发生在从干净状态开始的 Maven 管理的发布过程中。
有没有办法在 javadoc 插件中禁用此功能,以便我只获得库模块的文档?
I have a Maven-managed project which contains a few modules, one of which is the actual library of interest. The other modules are just add-ons or examples that build off of the library. I'm looking to generate the Maven site for this library and have it automatically deployed (as a standalone site and not as part of a multi-module site) but I am having trouble with the Javadoc plugin.
When executing the javadoc:javadoc
goal, the javadoc plugin is attempting to access the jar
for the other modules causing a failure.
I have created a simple example which demonstrates this phenomenon. Make sure you run the clean
goal before any others so that the flaw be shown. Though executing the packaging first would solve this error, this cannot be done because the use case occurs during the Maven-managed release process which starts from a clean state.
Is there a way for me to disable this functionality in the javadoc plugin so I only get the documetation for the library module?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据您的喜好,我可以想到两种选择。两者都包括使用配置文件。如果您希望默认构建为您感兴趣的库创建 javadoc。让其他模块使用默认配置文件内的属性以跳过 javadocs。
如果您同意传入配置文件,则只需让 javadoc 仅在配置文件中运行。
I can think of two options depending on your preference. Both include using profiles. If you want the default build to create the javadocs for your library of interest. Make the other modules use a property inside of the default profile in order to skip the javadocs.
If you are okay with passing in a profile, just have the javadocs only run in the profile.