Я пытаюсь создать профиль по умолчанию, который хранится в 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 см. Справка по настройкам - Профили:
The
profile
element in thesettings.xml
is a truncated version of thepom.xml
profile
element. It consists of theactivation
,repositories
,pluginRepositories
andproperties
elements. Theprofile
elements only include these four elements [...]
Значит, вы не можете настроить плагин в settings.xml?
@mealesbia По-видимому, да.
Вы должны предоставить весь файл pom.xml. профиль должен быть внутри тега профилей.