以下 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。在这一点上,我只有一个配置文件,尽管我希望将来会添加更多。
解析度:
彼得在这个问题上是对的。问题源于id
在 Maven 配置文件中没有元素。就我而言,由于我的 miglayout 依赖性,一个 pom 文件被拉入。
在查看依赖 pom 时,我发现 miglayout 确实id
在其配置文件中不使用 's:
<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
',每个配置文件都会导致出现警告。