In my Java projects building with maven, I have a a .mvn directory that contains a maven.config file. Content of that file is as follows:
--settings ./.mvn/local-settings.xml
The local-settings.xml holds authentication credentials for pulling from a private registry.
This setup worked fine up until yesterday. Now, the CI build (using maven:3-amazoncorretto-17) is failing with the following error message:
Unable to parse maven.config file options: Unrecognized option: --settings ./.mvn/local-settings.xml
Has there been a breaking change in the maven image I am using for building?
With the introduction of maven 3.9, there was a BREAKING CHANGE that affects the parsing of the maven.config file:
https://maven.apache.org/docs/3.9.0/release-notes.html#potentially-breaking-core-changes
Each line in
.mvn/maven.configis now interpreted as a single argument. That is, if the file contains multiple arguments, these must now be placed on separate lines, see MNG-7684.
As pointed out by @khmarbaise in the comments, adding a newline in the maven.config works just fine and is even downwards compatible.
--settings
./.mvn/local-settings.xml
IMPORTANT NOTE: There must not be a whitespace after --settings
Also noticed that -s./.mvn/settings.xml works too without any space
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With