Skip to content
This repository was archived by the owner on Jul 8, 2026. It is now read-only.
This repository was archived by the owner on Jul 8, 2026. It is now read-only.

Bug - Unrecognized option: --settings ./.mvn/settings.xml #35

Closed

Description

Error when running mvn commands to build or deploy the web app:

Image

known workaround

  1. delete the line from the ./.mvn/maven.config file
  2. append that line to the end of the mvn command as a parameter --settings ./.mvn/settings.xml

Activity

  1. changed the title [-]Unrecognized option: --settings ./.mvn/settings.xml[/-] [+]Bug - Unrecognized option: --settings ./.mvn/settings.xml[/+] on Feb 13, 2023
  2. agoncal commented on Aug 1, 2023

    @agoncal
    Member

    I just bumped into this issue.

    FYIO this happens if you have Maven > 3.9 installed. If you have Maven up to 3.8.8, this does not happen. There was a breaking change in 3.9:

    Each line in .mvn/maven.config is 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.

    So it's just a matter of changing the content of the .mvn/maven.config file from

    --settings ./.mvn/settings.xml
    

    to (adding a newline)

    --settings
    ./.mvn/settings.xml
    

    And this works for both Maven 3.8.x and 3.9.x

  3. agoncal commented on Aug 1, 2023

    @agoncal
    Member

    I just bumped into this issue.

    FYIO this happens if you have Maven > 3.9 installed. If you have Maven up to 3.8.8, this does not happen. There was a breaking change in 3.9:

    Each line in .mvn/maven.config is 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.

    So it's just a matter of changing the content of the .mvn/maven.config file from

    --settings ./.mvn/settings.xml
    

    to (adding a newline)

    --settings
    ./.mvn/settings.xml
    

    And this works for both Maven 3.8.x and 3.9.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions