[英]How to configure Maven so that a plugin in an upstream artifact is executed in the downstream project
Project A requires the Enforcer Plugin to run to verify that a particular environment is in place during the building of the artifact. 项目A要求Enforcer插件运行以验证在构建工件期间是否存在特定的环境。 Project A is deployed in the normal manner to Maven Central.
项目A以常规方式部署到Maven Central。
Project B, which is entirely separate, depends on Project A and has no knowledge of the Enforcer Plugin used in Project A. 完全独立的项目B依赖于项目A,并且不了解项目A中使用的Enforcer插件。
Is there a way to ensure that the Enforcer Plugin present in Project A's POM is executed during the build of Project B, without Project B having to do any special configuration outside of the usual dependency declaration? 有没有一种方法可以确保在项目B的构建过程中执行项目A的POM中存在的Enforcer插件,而项目B不必在通常的依赖项声明之外进行任何特殊配置?
The configuration in Project A can be as esoteric as necessary to make it work. 项目A中的配置可以根据需要进行深奥。 Project B cannot be given special instructions.
项目B无法获得特别指示。
With your constraints: No, it's not possible. 有您的限制:不,这是不可能的。
The only way to make this work is by making A the parent project of B or by moving this check into a new parent POM which both A and B inherit from. 进行此工作的唯一方法是将A设为B的父项目,或将此支票移到A和B都继承的新父POM中。
But as long as you refuse to change B's setup, it can't be done. 但是,只要您拒绝更改B的设置,就无法完成。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.