gpt4 book ai didi

maven-2 - 我的profiles.xml有什么问题?

转载 作者:行者123 更新时间:2023-12-04 16:36:59 25 4
gpt4 key购买 nike

这是profiles.xmlmvn的一部分:

<profilesXml>
<profiles>
<profile>
<id>production</id>
<build>
<plugins> .. </plugins>
</build>
</profile>
</profiles>
</profilesXml>

这是 mvn所说的:
Caused by: org.codehaus.plexus.util.xml.pull.XmlPullParserException: 
Unrecognised tag: 'build' (position: START_TAG seen ...</id>\n
<build>... @32:20)

怎么了

最佳答案

错误消息为您提供了正确的反馈,您不能在外部配置文件中指定<build/>部分,而只能指定<properties><pluginRepositories><repositories>。从Introduction to Build Profiles:

Profiles in external files

Profiles specified in external files (i.e in settings.xml or profiles.xml) are not portable in the strictest sense. Anything that seems to stand a high chance of changing the result of the build is restricted to the inline profiles in the POM. Things like repository lists could simply be a proprietary repository of approved artifacts, and won't change the outcome of the build. Therefore, you will only be able to modify the <repositories> and <pluginRepositories> sections, plus an extra <properties> section.

The <properties> section allows you to specify free-form key-value pairs which will be included in the interpolation process for the POM. This allows you to specify a plugin configuration in the form of ${profile.provided.path}.



如果您的摘录来自一本书,则该书应该是固定的。

关于maven-2 - 我的profiles.xml有什么问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3351238/

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