Compare commits

...

1 Commits

Author SHA1 Message Date
Jeremy Long
69b8f51319 fixed issue #118
Former-commit-id: 6f7b38b0945c6bcf47ffae0b8a6be53b144269cc
2014-04-30 18:10:56 -04:00
2 changed files with 10 additions and 6 deletions

View File

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

View File

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