简体   繁体   中英

Run Maven enforcer rule without a build

Can I run a maven enforcer rule on a project without adding it to the 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.

Strating from 3.0.0 it should be working like this

mvn enforcer:enforce -Drules=alwaysPass,alwaysFail

The actual ticket for that feature: https://issues.apache.org/jira/browse/MENFORCER-142

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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