我无法复制。我有一个“沙盒”配置文件定义在我的
~/.m2/settings.xml
$ mvn -Dtest=AppTest -Psandbox test
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Q3372129
[INFO] task-segment: [test]
[INFO] ------------------------------------------------------------------------
...
当使用未定义的配置文件时,会生成您所说的警告:
$ mvn -Dtest=AppTest -Pfoo test
[INFO] Scanning for projects...
[WARNING]
Profile with id: 'foo' has not been activated.
[INFO] ------------------------------------------------------------------------
[INFO] Building Q3372129
[INFO] task-segment: [test]
[INFO] ------------------------------------------------------------------------
...