mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-03-22 17:19:30 +01:00
updated to support the new Settings implementation
Former-commit-id: 4731df058a88b10661ea70addb082aced7590e80
This commit is contained in:
@@ -356,31 +356,26 @@ public class DependencyCheckMojo extends AbstractMojo implements MavenMultiPageR
|
|||||||
LogUtils.prepareLogger(in, logFile);
|
LogUtils.prepareLogger(in, logFile);
|
||||||
|
|
||||||
populateSettings();
|
populateSettings();
|
||||||
Engine engine = null;
|
Engine engine = new Engine();
|
||||||
try {
|
|
||||||
engine = new Engine();
|
|
||||||
final Set<Artifact> artifacts = project.getArtifacts();
|
|
||||||
for (Artifact a : artifacts) {
|
|
||||||
if (skipTestScope && Artifact.SCOPE_TEST.equals(a.getScope())) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (skipProvidedScope && Artifact.SCOPE_PROVIDED.equals(a.getScope())) {
|
final Set<Artifact> artifacts = project.getArtifacts();
|
||||||
continue;
|
for (Artifact a : artifacts) {
|
||||||
}
|
if (skipTestScope && Artifact.SCOPE_TEST.equals(a.getScope())) {
|
||||||
|
continue;
|
||||||
if (skipRuntimeScope && !Artifact.SCOPE_RUNTIME.equals(a.getScope())) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
engine.scan(a.getFile().getAbsolutePath());
|
|
||||||
}
|
}
|
||||||
engine.analyzeDependencies();
|
|
||||||
} finally {
|
if (skipProvidedScope && Artifact.SCOPE_PROVIDED.equals(a.getScope())) {
|
||||||
if (engine != null) {
|
continue;
|
||||||
engine.cleanup();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (skipRuntimeScope && !Artifact.SCOPE_RUNTIME.equals(a.getScope())) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
engine.scan(a.getFile().getAbsolutePath());
|
||||||
}
|
}
|
||||||
|
engine.analyzeDependencies();
|
||||||
|
|
||||||
return engine;
|
return engine;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -815,6 +810,7 @@ public class DependencyCheckMojo extends AbstractMojo implements MavenMultiPageR
|
|||||||
* properties required to change the proxy url, port, and connection timeout.
|
* properties required to change the proxy url, port, and connection timeout.
|
||||||
*/
|
*/
|
||||||
private void populateSettings() {
|
private void populateSettings() {
|
||||||
|
Settings.initialize();
|
||||||
InputStream mojoProperties = null;
|
InputStream mojoProperties = null;
|
||||||
try {
|
try {
|
||||||
mojoProperties = this.getClass().getClassLoader().getResourceAsStream(PROPERTIES_FILE);
|
mojoProperties = this.getClass().getClassLoader().getResourceAsStream(PROPERTIES_FILE);
|
||||||
@@ -951,6 +947,7 @@ public class DependencyCheckMojo extends AbstractMojo implements MavenMultiPageR
|
|||||||
"Unable to connect to the dependency-check database; analysis has stopped");
|
"Unable to connect to the dependency-check database; analysis has stopped");
|
||||||
Logger.getLogger(DependencyCheckMojo.class.getName()).log(Level.FINE, "", ex);
|
Logger.getLogger(DependencyCheckMojo.class.getName()).log(Level.FINE, "", ex);
|
||||||
} finally {
|
} finally {
|
||||||
|
Settings.cleanup();
|
||||||
if (engine != null) {
|
if (engine != null) {
|
||||||
engine.cleanup();
|
engine.cleanup();
|
||||||
}
|
}
|
||||||
@@ -991,6 +988,7 @@ public class DependencyCheckMojo extends AbstractMojo implements MavenMultiPageR
|
|||||||
"Unable to connect to the dependency-check database; analysis has stopped");
|
"Unable to connect to the dependency-check database; analysis has stopped");
|
||||||
Logger.getLogger(DependencyCheckMojo.class.getName()).log(Level.FINE, "", ex);
|
Logger.getLogger(DependencyCheckMojo.class.getName()).log(Level.FINE, "", ex);
|
||||||
} finally {
|
} finally {
|
||||||
|
Settings.cleanup();
|
||||||
if (engine != null) {
|
if (engine != null) {
|
||||||
engine.cleanup();
|
engine.cleanup();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user