简体   繁体   English

在没有构建的情况下运行 Maven 执行器规则

[英]Run Maven enforcer rule without a build

Can I run a maven enforcer rule on a project without adding it to the POM?我可以在项目上运行 Maven 执行器规则而不将其添加到 POM 中吗?

In other words: Can I specify an enforcer rule on the command line and run it independently from a build?换句话说:我可以在命令行上指定一个强制规则并独立于构建运行它吗?

Use case: On the build server, I would like to run a rule before the build so that it fails fast.用例:在构建服务器上,我想在构建之前运行一个规则,以便它快速失败。 As we have 1800+ separate Java projects, updating the POMs or parent POMs is no fun.由于我们有 1800 多个独立的 Java 项目,更新 POM 或父 POM 并不有趣。

Strating from 3.0.0 it should be working like this从 3.0.0 开始,它应该像这样工作

mvn enforcer:enforce -Drules=alwaysPass,alwaysFail

The actual ticket for that feature: https://issues.apache.org/jira/browse/MENFORCER-142该功能的实际票证: https : //issues.apache.org/jira/browse/MENFORCER-142

Documentation: https://github.com/apache/maven-enforcer/pull/36#issuecomment-431807499文档: https : //github.com/apache/maven-enforcer/pull/36#issuecomment-431807499

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM