usage of maven enforcer plugin

前端 未结 4 641
猫巷女王i
猫巷女王i 2020-12-29 06:23

I\'d like to use the maven enforcer plugin to check to see if I have duplicate classes on my path. I\'ve tried the example from here.

But when I run it like so:

4条回答
  •  一个人的身影
    2020-12-29 06:55

    The reason why your first version did not work is because there is a difference between a plug-in configuration inside the execution tag and a plug-in configuration outside the execution tag. The execution is only used when your plug-in is triggered by a special phase of the complete Maven build.

    The Maven guide to configuration explains it better:

    Configurations inside the tag differ from those that are outside in that they cannot be used from a direct command line invocation. Instead they are only applied when the lifecycle phase they are bound to are invoked. Alternatively, if you move a configuration section outside of the executions section, it will apply globally to all invocations of the plugin.

提交回复
热议问题