* @throws Exception the exception
*/
public void init() throws Exception {
System.setProperty("maven.repo.local", System.getProperty("repository.home"));
Settings settings;
try {
settings = Settings.read(System.getProperty("user.home"), new File(System.getProperty("jlaunchpad.home") + File.separatorChar + "settings.xml"));
}
catch (Exception e) {
settings = new Settings();
if (settings.getLocalRepository() == null) {
settings.setLocalRepository(System.getProperty("repository.home"));
}
String proxySetStr = System.getProperty("proxySet");
if (proxySetStr != null && Boolean.valueOf(proxySetStr).equals(Boolean.TRUE)) {
String proxyHost = System.getProperty("proxyHost");
String proxyPort = System.getProperty("proxyPort");
String proxyUser = "";
String proxyPassword = "";
String proxyAuthStr = System.getProperty("proxyAuth");
if (proxyAuthStr != null && Boolean.valueOf(proxyAuthStr).equals(Boolean.TRUE)) {
proxyUser = System.getProperty("proxyUser");
proxyPassword = System.getProperty("proxyPassword");
Proxy proxy = new Proxy();
proxy.setHost(proxyHost);
proxy.setPort(proxyPort);
proxy.setUserName(proxyUser);
proxy.setPassword(proxyPassword);
proxy.setActive(true);
settings.addProxy(proxy);
}
//downloader.setProxy(proxyHost, proxyPort, proxyUser, proxyPassword);
}
}
// propagate proxy settings from settings.xml to system properties
// (for the case when proxy was not presented as command line parameters)
if (settings.getActiveProxy() != null) {
Proxy proxy = settings.getActiveProxy();
System.setProperty("proxySet", Boolean.TRUE.toString());
System.setProperty("proxyHost", proxy.getHost());
System.setProperty("proxyPort", proxy.getPort());