如果我像这样定义父POM:
<project ...>
<groupId>com.example</groupId>
<artifactId>parent-test</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>1.5.6.RELEASE</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
像这样的项目POM:
<project ...>
<groupId>com.example</groupId>
<artifactId>parent-test-project</artifactId>
<version>1.0-SNAPSHOT</version>
<parent>
<groupId>com.example</groupId>
<artifactId>parent-test</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
</project>
目标spring-boot:help
等可以从parent-test-project
根目录中获得。为什么插件不需要包含在项目的<plugins>
块中以使用插件?即使是spring docs suggest这也是必要的。
与另一个插件相同的结果:https://codehaus-cargo.github.io/cargo/Maven2+Plugin+Installation.html
相关,但似乎有所不同,因为我要求直接运行目标,而不是绑定到生命周期阶段:"Implicit" plugins - why does a Maven build run tests via surefire even if it is not mentioned in the POM?