mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-03-21 00:29:21 +01:00
patch for issue #1090
This commit is contained in:
@@ -27,6 +27,8 @@ import org.owasp.dependencycheck.Engine;
|
|||||||
import org.owasp.dependencycheck.data.nvdcve.DatabaseException;
|
import org.owasp.dependencycheck.data.nvdcve.DatabaseException;
|
||||||
import org.owasp.dependencycheck.data.update.exception.UpdateException;
|
import org.owasp.dependencycheck.data.update.exception.UpdateException;
|
||||||
import org.owasp.dependencycheck.exception.ExceptionCollection;
|
import org.owasp.dependencycheck.exception.ExceptionCollection;
|
||||||
|
import org.owasp.dependencycheck.utils.InvalidSettingException;
|
||||||
|
import org.owasp.dependencycheck.utils.Settings;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Maven Plugin that checks the project dependencies to see if they have any
|
* Maven Plugin that checks the project dependencies to see if they have any
|
||||||
@@ -66,6 +68,13 @@ public class UpdateMojo extends BaseDependencyCheckMojo {
|
|||||||
@Override
|
@Override
|
||||||
protected void runCheck() throws MojoExecutionException, MojoFailureException {
|
protected void runCheck() throws MojoExecutionException, MojoFailureException {
|
||||||
try (Engine engine = initializeEngine()) {
|
try (Engine engine = initializeEngine()) {
|
||||||
|
try {
|
||||||
|
if (!engine.getSettings().getBoolean(Settings.KEYS.AUTO_UPDATE)) {
|
||||||
|
engine.getSettings().setBoolean(Settings.KEYS.AUTO_UPDATE, true);
|
||||||
|
}
|
||||||
|
} catch (InvalidSettingException ex) {
|
||||||
|
engine.getSettings().setBoolean(Settings.KEYS.AUTO_UPDATE, true);
|
||||||
|
}
|
||||||
engine.doUpdates();
|
engine.doUpdates();
|
||||||
} catch (DatabaseException ex) {
|
} catch (DatabaseException ex) {
|
||||||
if (getLog().isDebugEnabled()) {
|
if (getLog().isDebugEnabled()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user