在多模块构建中,maven-release-plugin 忽略了活动配置文件
我有一个多模块 Maven 构建,需要使用 -P 标志仅根据需要激活配置文件。但由于某种原因,在使用 maven-release-plugin 进行发布时它被忽略。
以下命令行正确激活配置文件并禁用 activeByDefault 配置文件:
mvn clean deploy -Poracle
但是使用以下命令进行发布时:
mvn help:active-profiles release:clean release:prepare release:perform -Poracle
...active-profiles 输出将配置文件报告为活动状态,但实际上仅启用了 activeByDefault 配置文件。
这是预期的行为还是我错过了一些行家魔法?
I have a multi-module maven build that requires a profile to be activated only on demand using the -P flag. But for some reason it is being ignored when doing a release using the maven-release-plugin.
The following command line activates the profile correctly and disables the activeByDefault profile:
mvn clean deploy -Poracle
But when doing a release with the following command:
mvn help:active-profiles release:clean release:prepare release:perform -Poracle
...the profile is reported as being active by the active-profiles output but in fact only the activeByDefault profile is enabled.
Is this the expected behaviour or am I missing some maven magic?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题解决了。必须将配置文件指定为插件的配置参数。
Problem solved. Profiles must be specified as a configuration parameter to the plugin.