【发布时间】:2011-01-04 09:53:20
【问题描述】:
以下maven警告的可能原因是什么:
Overriding profile: 'null' (source: pom) with new instance from source: pom
我尝试将我的整个默认配置文件注释掉,因为警告中提到了“配置文件”,但这并没有帮助。我还尝试注释掉我的报告选项,但警告仍然出现。
我已经使用-X 标志运行了 maven,并且在引入我的 hamcrest 依赖项后立即显示警告,但将其注释掉并不能消除警告。
编辑:每个请求的附加信息:
mvn help:active-profiles 的输出:
Active Profiles for Project 'com.sophware.XXX:main:jar:0.0.1-SNAPSHOT':
The following profiles are active:
- default (source: pom)
mvn help:all-profiles 的输出:
[INFO] Listing Profiles for Project: com.sophware.XXX:main:jar:0.0.1-SNAPSHOT
Profile Id: default (Active: true , Source: pom)
default 确实是我在 pom.xml 中使用的配置文件的 ID。目前,我只有一个个人资料,但我希望将来会添加更多。
分辨率:
彼得在这个问题上是对的。问题源于 maven 配置文件中没有 id 元素。就我而言,由于我的 miglayout 依赖性,一个 pom 文件被拉入。
查看依赖 pom 后,我发现 miglayout 确实在其配置文件中不使用 id:
<profile>
<activation>
<os>
<family>windows</family>
<arch>x86</arch>
</os>
</activation>
<dependencies>
<dependency>
<groupId>org.eclipse.swt.win32.win32</groupId>
<artifactId>x86</artifactId>
<version>3.3.0-v3346</version>
<optional>true</optional>
</dependency>
</dependencies>
</profile>
还有许多其他配置文件也缺少 id,每个配置文件都会导致出现警告。
【问题讨论】:
标签: maven-2 warnings profile pom.xml