If you are using Intellij IDEA, and using ".mvn/maven.config" file inside your project to override default settings.xml file used by maven, you must use FULL syntax inside "maven.config" file.
VALID "maven.config" file:
--settings=C:\path\to\conf\my_settings.xml
--global-settings=C:\path\to\conf\my_settings.xml
Running "mvn clean" command from IntelliJ terminal with INVALID "maven.config":
-s C:\path\to\conf\my_settings.xml
-gs C:\path\to\conf\my_settings.xml
[ERROR] Error executing Maven.
[ERROR] Illegal char <:> at index ...
This answer was derived from comments under khmarbaise answer, and was added as seperate answer for visibility.
settings.xml
or via command line-Dmaven.repo.local=$HOME/.my/other/repository
– Retrospection