Maven pluginManagement configuration inheritance strange behavior

后端 未结 2 1655
夕颜
夕颜 2021-01-02 14:46

I\'m using pluginManagement element in my parent pom.xml to configure plugins for all its children. For example, I have the following configuration

2条回答
  •  一向
    一向 (楼主)
    2021-01-02 15:41

    The whole POM isn't visible; but given the behavior you're describing this is a jar, war, or ear, correct? The resource plugin is defined for those packaging types by default. It includes an execution that copies resources (as described by @maba).

    Since the plugin definition is included in your child POM (even though YOU didn't put it there directly), Maven merges the execution defined in the section with the execution provided by Maven.

    There is documentation describing the default lifecycle bindings by packaging type. Note the dependency plugin isn't mentioned; but resources is; that's why you observe the difference. Running with -X will show the plugin executions.

提交回复
热议问题