Skip to content

EffectiveSettingsMojo mutates original Settings when showPasswords=true #385

Description

@elharo

In src/main/java/org/apache/maven/plugins/help/EffectiveSettingsMojo.java:87-94:

if (showPasswords) {
copySettings = settings; // uses original, not a copy
} else {
copySettings = copySettings(settings);
}
writeEffectiveSettings(copySettings, writer); // calls cleanSettings() which modifies profiles

When -DshowPasswords=true, the original Maven Settings object is used directly. writeEffectiveSettings -> cleanSettings() then replaces each profile Properties with a SortedProperties instance (same pattern as bug #381), mutating the global shared settings object.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions