Example usage for org.apache.maven.settings.io SettingsWriter write

List of usage examples for org.apache.maven.settings.io SettingsWriter write

Introduction

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

Prototype

void write(OutputStream output, Map<String, Object> options, Settings settings) throws IOException;

Source Link

Document

Writes the supplied settings to the specified byte stream.

Usage

From source file:io.teecube.t3.GenericReplacerMojo.java

License:Apache License

private File createAndSetTempSettings(InvocationRequest request) throws MojoExecutionException, IOException {
    SettingsWriter settingsWriter = new DefaultSettingsWriter();
    File settingsFile = File.createTempFile("settings", null);
    try {//from ww w . j  a v  a2s.c o  m
        settingsWriter.write(settingsFile, null, this.settings);
    } catch (IOException e) {
        throw new MojoExecutionException("Unable to store Maven settings for release build", e);
    }
    request.setUserSettingsFile(settingsFile);
    return settingsFile;
}