Example usage for org.apache.maven.settings.io SettingsReader read

List of usage examples for org.apache.maven.settings.io SettingsReader read

Introduction

In this page you can find the example usage for org.apache.maven.settings.io SettingsReader read.

Prototype

Settings read(InputStream input, Map<String, ?> options) throws IOException, SettingsParseException;

Source Link

Document

Reads the settings from the specified byte stream.

Usage

From source file:org.jboss.as.plugin.AbstractJbossMavenPluginMojoTestCase.java

License:Open Source License

/**
 * Gets a settings.xml file from the input File and prepares it to be
 * attached to a pom.xml/*from ww w.j  ava 2 s. c  o m*/
 *
 * @param userSettingsFile file object pointing to the candidate settings file
 *
 * @return the settings object
 *
 * @throws IOException - if the settings file can't be read
 */
private Settings getSettingsFile(File userSettingsFile) throws IOException {
    Map<String, ?> options = Collections.singletonMap(SettingsReader.IS_STRICT, Boolean.TRUE);
    SettingsReader reader = new DefaultSettingsReader();

    Settings settings = null;
    try {
        settings = reader.read(userSettingsFile, options);
    } catch (SettingsParseException e) {

    }

    return settings;
}