【发布时间】:2019-03-26 10:27:00
【问题描述】:
我尝试创建一个默认配置文件,该配置文件存储在settings.xml 中,可以由mvn clean install -Pmy-profile 调用。本地放不了pom.xml。
我的个人资料如下所示:
<profile>
<id>check-release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.0.0-M2</version>
<executions>
<execution>
<id>enforce-no-snapshots</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireReleaseVersion>
<message>No Snapshots Allowed!</message>
</requireReleaseVersion>
</rules>
<fail>true</fail>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
但我得到了:
[WARNING] Some problems were encountered while building the effective settings
[WARNING] Unrecognised tag: 'build'
插件似乎没有做我想做的事。我做错了什么?
【问题讨论】:
-
您应该提供整个 pom.xml。个人资料必须在个人资料标签内。
-
对此的简单回答是:无法以任何方式在设置中定义插件...
-
为什么你不能把配置文件放在例如你的父母 pom?