Maven enforcer plugin missing or invalid rules

后端 未结 3 1479
Happy的楠姐
Happy的楠姐 2021-02-07 00:50

I am trying to setup the enforcer plugin for maven to enforce a minimum Java version. However, whenever I try to run mvn enforcer:enforce, I get:

3条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-07 01:07

    In my case the problem was that I was putting the enforcer configuration inside the build part of a Maven profile which was not being built when I ran mvn validate. A simple mvn validate -P correctProfile fixed it for me. In the end I put it into the parent project of a multi-module application, set the transitive search of bytecode enforcer rule to true: true and verified that an incorrect dependency in a child project indeed causes a build failure.

提交回复
热议问题