fixed issue #118

Former-commit-id: 6f7b38b0945c6bcf47ffae0b8a6be53b144269cc
This commit is contained in:
Jeremy Long
2014-04-30 18:10:56 -04:00
parent 72f9564757
commit 69b8f51319
2 changed files with 10 additions and 6 deletions

View File

@@ -25,6 +25,8 @@ Copyright (c) 2013 - Jeremy Long. All Rights Reserved.
</parent>
<artifactId>dependency-check-ant</artifactId>
<version>1.2.0.1</version>
<packaging>jar</packaging>
<name>Dependency-Check Ant Task</name>

View File

@@ -57,8 +57,13 @@ public class App {
* @param args the command line arguments
*/
public static void main(String[] args) {
final App app = new App();
app.run(args);
try {
Settings.initialize();
final App app = new App();
app.run(args);
} finally {
Settings.cleanup();
}
}
/**
@@ -67,8 +72,8 @@ public class App {
* @param args the command line arguments
*/
public void run(String[] args) {
final CliParser cli = new CliParser();
try {
cli.parse(args);
} catch (FileNotFoundException ex) {
@@ -140,7 +145,6 @@ public class App {
LOGGER.log(Level.SEVERE, "Unable to connect to the dependency-check database; analysis has stopped");
LOGGER.log(Level.FINE, "", ex);
} finally {
Settings.cleanup();
if (scanner != null) {
scanner.cleanup();
}
@@ -155,8 +159,6 @@ public class App {
*/
private void populateSettings(CliParser cli) {
Settings.initialize();
final boolean autoUpdate = cli.isAutoUpdate();
final String connectionTimeout = cli.getConnectionTimeout();
final String proxyUrl = cli.getProxyUrl();