settings.xml中的插件定义不接受生成标记



我想在Settings.xml中定义全局插件文件看起来像:

<settings>
<profiles>
<profile>
<id>spotbugs</id>
<build>
<plugins>
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<version>4.0.4</version>
<configuration>
<effort>Max</effort>
<threshold>Low</threshold>
<failOnError>true</failOnError>
<plugins>
<plugin>
<groupId>com.h3xstream.findsecbugs</groupId>
<artifactId>findsecbugs-plugin</artifactId>
<version>1.10.1</version>
</plugin>
</plugins>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<activeProfiles>
<activeProfile>spotbugs</activeProfile>
</activeProfiles>
</settings>

不幸的是,我得到了:

[警告][警告]在生成有效设置[警告]未识别标记:"build"(位置:已看到START_TAG。。。\n@5:14(@/Users/gs/.m2/settings.xml,第5行,第14列[警告]

是否可以将上述插件信息放入pluginRepositries?我想为这个插件进行全局针叶树化,而不是编辑每个pom.xml来使用mvm spotbugs:spotbugs

您可以通过将插件配置放在一个超级/公司pom i部分来实现这一点:

<build>
<pluginManagement>
<plugins>
....
</plugins>
</pluginManagement>
<build>

为了使用它,您的所有项目都必须为此pom设置父级。

最新更新