gpt4 book ai didi

java - 如何在settings.xml中的配置文件中使用maven插件

转载 作者:太空宇宙 更新时间:2023-11-04 10:05:54 24 4
gpt4 key购买 nike

我尝试创建一个默认配置文件,该配置文件存储在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'

而且这个插件似乎没有做我想做的事。我做错了什么?

最佳答案

以下 khmarbaise 的评论请参阅 Settings Reference – Profiles :

The profile element in the settings.xml is a truncated version of the pom.xml profile element. It consists of the activation, repositories, pluginRepositories and properties elements. The profile elements only include these four elements [...]

关于java - 如何在settings.xml中的配置文件中使用maven插件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52927767/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com