Show warnings about bad settings.xml

Description

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:

https://github.com/apache/maven/blob/59bd396e6e85295c69b0cda98796821a97c28562/maven-embedder/src/main/java/org/apache/maven/cli/configuration/SettingsXmlConfigurationProcessor.java#L152-L162

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: https://github.com/clojure/clojure-site/pull/416/commits

Environment

None

Status

Assignee

Unassigned

Reporter

Juho Teperi

Labels

None

Approval

None

Patch

None

Priority

Minor
Configure