fixed issue with data directory and made a few other minor changes

Former-commit-id: 74ba4f4ef797bfa13d6c7c3335951f1f9b11f690
This commit is contained in:
Jeremy Long
2013-08-01 10:57:44 -04:00
parent 32aabe78b1
commit 59fae2b80a
12 changed files with 269 additions and 20 deletions

View File

@@ -67,6 +67,10 @@ import org.owasp.dependencycheck.utils.Settings;
requiresOnline = true)
public class DependencyCheckMojo extends AbstractMojo implements MavenMultiPageReport {
/**
* The properties file location.
*/
private static final String PROPERTIES_FILE = "mojo.properties";
/**
* Name of the logging properties file.
*/
@@ -619,6 +623,23 @@ public class DependencyCheckMojo extends AbstractMojo implements MavenMultiPageR
* proxy url, port, and connection timeout.
*/
private void populateSettings() {
InputStream mojoProperties = null;
try {
mojoProperties = this.getClass().getClassLoader().getResourceAsStream(PROPERTIES_FILE);
Settings.mergeProperties(mojoProperties);
} catch (IOException ex) {
Logger.getLogger(DependencyCheckMojo.class.getName()).log(Level.WARNING, "Unable to load the dependency-check ant task.properties file.");
Logger.getLogger(DependencyCheckMojo.class.getName()).log(Level.FINE, null, ex);
} finally {
if (mojoProperties != null) {
try {
mojoProperties.close();
} catch (IOException ex) {
Logger.getLogger(DependencyCheckMojo.class.getName()).log(Level.FINEST, null, ex);
}
}
}
Settings.setBoolean(Settings.KEYS.AUTO_UPDATE, autoUpdate);
if (proxyUrl != null && !proxyUrl.isEmpty()) {