Show warnings about bad settings.xml


If user has bad settings.xml at the home folder, e.g. the top level element is not <settings>, the settings are currently silently ignored.

Maven shows a warning in this case:

Fix should be to simply get the list of problems from settings result and output them:

Some notes for implementation:

1. get-settings is currently called multiple times, the validation should only happen once
2. Looks like DefaultMavenSettingsBuilder doesn't allow access to SettingsBuildingResult, only returning Settings. Using classes from org.apache.maven.settings.building would require reimplementing logic in DefaultMavenSettingsBuilder to select the config files?

Related, docs currently don't include <settings> as top level tag:




Alex Miller
February 5, 2021, 3:38 PM

Just relying on Maven here, not going to go to extraordinary measures to extend their validation.

Alex Miller
November 24, 2020, 8:17 PM

Many bad settings files will cause an error to be thrown, this particular one is not an error, just a warning.

Won't Fix




Juho Teperi