maven goal doesn't execute properly if plugins are defined under pluginManagement

前端 未结 1 427
北荒
北荒 2021-01-18 10:32

I have maven-jaxb2-plugin. I generate jaxb objects and refer it in other classes of project.I\'ve put jaxb plugin and compiler plugin under pluginManagement tag. Maven is ex

相关标签:
1条回答
  • 2021-01-18 10:46

    Yes, <pluginManagement> is used to create ready-to-use configurations, but does not automatically activate your plugins - you still need to include them. So in effect you are right, <pluginManagement>, just like <dependencyManagement> are very useful in the parent pom to centralize plugin configurations and dependency management.

    Effectively, 'declaring' your plugins in the right module benefits from a much more compact syntax:

    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
        </plugin>
    
        <plugin>
            <groupId>org.jvnet.jaxb2.maven2</groupId>
            <artifactId>maven-jaxb2-plugin</artifactId>
        </plugin>
    </plugins>
    
    0 讨论(0)
提交回复
热议问题