Search in sources :

Example 1 with Settings

use of org.apache.maven.scm.providers.vss.settings.Settings in project maven-scm by apache.

the class VssCommandLineUtils method readSettings.

public static Settings readSettings() {
    Settings settings = null;
    File settingsFile = getScmConfFile();
    if (settingsFile.exists()) {
        VssXpp3Reader reader = new VssXpp3Reader();
        try {
            settings = reader.read(ReaderFactory.newXmlReader(settingsFile));
        } catch (FileNotFoundException e) {
        // nop
        } catch (IOException e) {
        // nop
        } catch (XmlPullParserException e) {
            String message = settingsFile.getAbsolutePath() + " isn't well formed. SKIPPED." + e.getMessage();
            System.err.println(message);
        }
    }
    // override settings with command line options
    String vssDirectory = System.getProperty("vssDirectory");
    if (StringUtils.isNotEmpty(vssDirectory)) {
        if (settings == null) {
            settings = new Settings();
        }
        settings.setVssDirectory(vssDirectory);
    }
    return settings;
}
Also used : FileNotFoundException(java.io.FileNotFoundException) XmlPullParserException(org.codehaus.plexus.util.xml.pull.XmlPullParserException) IOException(java.io.IOException) VssXpp3Reader(org.apache.maven.scm.providers.vss.settings.io.xpp3.VssXpp3Reader) File(java.io.File) Settings(org.apache.maven.scm.providers.vss.settings.Settings)

Aggregations

File (java.io.File)1 FileNotFoundException (java.io.FileNotFoundException)1 IOException (java.io.IOException)1 Settings (org.apache.maven.scm.providers.vss.settings.Settings)1 VssXpp3Reader (org.apache.maven.scm.providers.vss.settings.io.xpp3.VssXpp3Reader)1 XmlPullParserException (org.codehaus.plexus.util.xml.pull.XmlPullParserException)1