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.
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.