public void execute()

in src/main/java/org/apache/maven/plugins/help/EffectiveSettingsMojo.java [85:120]


    public void execute() throws MojoExecutionException {
        Settings copySettings;
        if (showPasswords) {
            copySettings = settings;
        } else {
            copySettings = copySettings(settings);
            if (copySettings != null) {
                hidePasswords(copySettings);
            }
        }

        StringWriter w = new StringWriter();
        String encoding = output != null && copySettings != null
                ? copySettings.getModelEncoding()
                : System.getProperty("file.encoding");
        XMLWriter writer = new PrettyPrintXMLWriter(
                w, StringUtils.repeat(" ", XmlWriterUtil.DEFAULT_INDENTATION_SIZE), encoding, null);

        writeHeader(writer);

        writeEffectiveSettings(copySettings, writer);

        String effectiveSettings = prettyFormat(w.toString(), encoding, false);

        if (output != null) {
            try {
                writeXmlFile(output, effectiveSettings);
            } catch (IOException e) {
                throw new MojoExecutionException("Cannot write effective-settings to output: " + output, e);
            }

            getLog().info("Effective-settings written to: " + output);
        } else {
            getLog().info(LS + "Effective user-specific configuration settings:" + LS + LS + effectiveSettings + LS);
        }
    }