Skip to content

Merging MAVEN_ARGS buggy #1956

@hohwille

Description

@hohwille

Actual behavior

IDEasy is supposed to set two additional things into MAVEN_ARGS variable:

  1. -s $IDE_HOME/conf/mvn/settings.xml
  2. -Dsettings.security=$IDE_HOME/conf/mvn/settings-security.xml

With story #1238 this should remain even when the user explicitly sets MAVEN_ARGS in his ide.properties.
As discussed in review of PR #1825 the merging of the MAVEN_ARGS property value should "override" potential other settings of 1. (-s ...) or 2. (-Dsettings.security=...).
Retest showed that this is not working. I got this from the reproducer:

-Xmx8000m -s invalid/settings.xml -Dsettings.security=something_wrong -s D:\projects\IDEasy\conf\mvn\settings.xml -Dsettings.security=D:\projects\IDEasy\conf\mvn\settings-security.xml

Reproduce

  1. icd -p IDEasy
  2. echo 'export MAVEN_ARGS="-Xmx8000m -s invalid/settings.xml -Dsettings.security=something_wrong"' >> conf/ide.properties
  3. ide
  4. echo $MAVEN_ARGS

Expected behavior

something like this:

-Xmx8000m -s D:\projects\IDEasy\conf\mvn\settings.xml -Dsettings.security=D:\projects\IDEasy\conf\mvn\settings-security.xml

IDEasy status

IDE_ROOT is set to D:/projects
IDE_HOME is set to D:/projects/project
Your version of IDEasy is 2026.05.001-05_19_03-SNAPSHOT.
You are using a SNAPSHOT version of IDEasy. For stability consider switching to a stable release via 'ide upgrade --mode=stable'
Your version of IDEasy is 2026.05.001-05_19_03-SNAPSHOT but version 2026.05.001-20260519.032313-17 is available. Please run the following command to upgrade to the latest version:
ide upgrade
Your operating system is windows(10.0)@x64 [Windows 11@amd64]
You are online.
Found bash executable at: C:/Program Files/Git/usr/bin/bash.***
Found git executable at: C:/Program Files/Git/mingw64/bin/git.***
Your settings are up-to-date.
Successfully completed ide (status)

Related/Dependent issues

#1238

Comments/Hints

Simply strip any arguments starting with -Dsettings.security= as well as -s followed by anything from MAVEN_ARGS before appending the according computed values (if there is no such computed value because we are outside of a project then don't strip it).

Metadata

Metadata

Assignees

Labels

configurationshould be configurable or configuration changeenvironmentEnvironmentCommandlet, env variables, path, etc.mvnrelated to apache maven build toolready-to-implement

Type

No fields configured for Bug.

Projects

Status

🏗 In progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions