mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-03-21 16:49:43 +01:00
Merge branch 'master' of github.com:jeremylong/DependencyCheck
This commit is contained in:
@@ -177,7 +177,7 @@ public class App {
|
|||||||
} catch (ExceptionCollection ex) {
|
} catch (ExceptionCollection ex) {
|
||||||
if (ex.isFatal()) {
|
if (ex.isFatal()) {
|
||||||
exitCode = -13;
|
exitCode = -13;
|
||||||
LOGGER.error("One or more fatal errors occured");
|
LOGGER.error("One or more fatal errors occurred");
|
||||||
} else {
|
} else {
|
||||||
exitCode = -14;
|
exitCode = -14;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -423,7 +423,7 @@ public class Engine implements FileFilter {
|
|||||||
LOGGER.debug("\n----------------------------------------------------\nEND ANALYSIS\n----------------------------------------------------");
|
LOGGER.debug("\n----------------------------------------------------\nEND ANALYSIS\n----------------------------------------------------");
|
||||||
LOGGER.info("Analysis Complete ({} ms)", System.currentTimeMillis() - analysisStart);
|
LOGGER.info("Analysis Complete ({} ms)", System.currentTimeMillis() - analysisStart);
|
||||||
if (exceptions.size() > 0) {
|
if (exceptions.size() > 0) {
|
||||||
throw new ExceptionCollection("One or more exceptions occured during dependency-check analysis", exceptions);
|
throw new ExceptionCollection("One or more exceptions occurred during dependency-check analysis", exceptions);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ public class EngineVersionCheck implements CachedWebDataSource {
|
|||||||
}
|
}
|
||||||
} catch (DatabaseException ex) {
|
} catch (DatabaseException ex) {
|
||||||
LOGGER.debug("Database Exception opening databases to retrieve properties", ex);
|
LOGGER.debug("Database Exception opening databases to retrieve properties", ex);
|
||||||
throw new UpdateException("Error occured updating database properties.");
|
throw new UpdateException("Error occurred updating database properties.");
|
||||||
} catch (InvalidSettingException ex) {
|
} catch (InvalidSettingException ex) {
|
||||||
LOGGER.debug("Unable to determine if autoupdate is enabled", ex);
|
LOGGER.debug("Unable to determine if autoupdate is enabled", ex);
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ import java.util.List;
|
|||||||
/**
|
/**
|
||||||
* A collection of several exceptions.
|
* A collection of several exceptions.
|
||||||
*
|
*
|
||||||
* @author Jeremy Lomg
|
* @author Jeremy Long
|
||||||
*/
|
*/
|
||||||
public class ExceptionCollection extends Exception {
|
public class ExceptionCollection extends Exception {
|
||||||
|
|
||||||
@@ -54,7 +54,7 @@ public class ExceptionCollection extends Exception {
|
|||||||
* Instantiates a new exception collection.
|
* Instantiates a new exception collection.
|
||||||
*
|
*
|
||||||
* @param exceptions a list of exceptions
|
* @param exceptions a list of exceptions
|
||||||
* @param fatal indicates if the exception that occurred is fatal - meaning
|
* @param fatal indicates if any of the exceptions that occurred is fatal - meaning
|
||||||
* that no analysis was performed.
|
* that no analysis was performed.
|
||||||
*/
|
*/
|
||||||
public ExceptionCollection(List<Throwable> exceptions, boolean fatal) {
|
public ExceptionCollection(List<Throwable> exceptions, boolean fatal) {
|
||||||
@@ -68,7 +68,7 @@ public class ExceptionCollection extends Exception {
|
|||||||
*
|
*
|
||||||
* @param msg the exception message
|
* @param msg the exception message
|
||||||
* @param exceptions a list of exceptions
|
* @param exceptions a list of exceptions
|
||||||
* @param fatal indicates if the exception that occurred is fatal - meaning
|
* @param fatal indicates if any of the exceptions that occurred is fatal - meaning
|
||||||
* that no analysis was performed.
|
* that no analysis was performed.
|
||||||
*/
|
*/
|
||||||
public ExceptionCollection(String msg, List<Throwable> exceptions, boolean fatal) {
|
public ExceptionCollection(String msg, List<Throwable> exceptions, boolean fatal) {
|
||||||
@@ -181,7 +181,7 @@ public class ExceptionCollection extends Exception {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void printStackTrace(PrintWriter s) {
|
public void printStackTrace(PrintWriter s) {
|
||||||
s.println("Multiple Exceptions Occured");
|
s.println("Multiple Exceptions Occurred");
|
||||||
super.printStackTrace(s);
|
super.printStackTrace(s);
|
||||||
for (Throwable t : this.exceptions) {
|
for (Throwable t : this.exceptions) {
|
||||||
s.println("Next Exception:");
|
s.println("Next Exception:");
|
||||||
@@ -215,7 +215,7 @@ public class ExceptionCollection extends Exception {
|
|||||||
final StringBuilder sb = new StringBuilder();
|
final StringBuilder sb = new StringBuilder();
|
||||||
final String msg = super.getMessage();
|
final String msg = super.getMessage();
|
||||||
if (msg == null || msg.isEmpty()) {
|
if (msg == null || msg.isEmpty()) {
|
||||||
sb.append("One or more exceptions occured during analysis:");
|
sb.append("One or more exceptions occurred during analysis:");
|
||||||
} else {
|
} else {
|
||||||
sb.append(msg);
|
sb.append(msg);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -123,9 +123,9 @@ public class AggregateMojo extends BaseDependencyCheckMojo {
|
|||||||
exCol.addException(ex);
|
exCol.addException(ex);
|
||||||
}
|
}
|
||||||
if (this.isFailOnError()) {
|
if (this.isFailOnError()) {
|
||||||
throw new MojoExecutionException("One or more exceptions occured during dependency-check analysis", exCol);
|
throw new MojoExecutionException("One or more exceptions occurred during dependency-check analysis", exCol);
|
||||||
} else {
|
} else {
|
||||||
getLog().debug("One or more exceptions occured during dependency-check analysis", exCol);
|
getLog().debug("One or more exceptions occurred during dependency-check analysis", exCol);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
showSummary(this.getProject(), engine.getDependencies());
|
showSummary(this.getProject(), engine.getDependencies());
|
||||||
@@ -240,7 +240,7 @@ public class AggregateMojo extends BaseDependencyCheckMojo {
|
|||||||
if (getLog().isDebugEnabled()) {
|
if (getLog().isDebugEnabled()) {
|
||||||
getLog().debug("Database connection error", ex);
|
getLog().debug("Database connection error", ex);
|
||||||
}
|
}
|
||||||
final String msg = "An exception occured connecting to the local database. Please see the log file for more details.";
|
final String msg = "An exception occurred connecting to the local database. Please see the log file for more details.";
|
||||||
if (this.isFailOnError()) {
|
if (this.isFailOnError()) {
|
||||||
throw new MojoExecutionException(msg, ex);
|
throw new MojoExecutionException(msg, ex);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ public class CheckMojo extends BaseDependencyCheckMojo {
|
|||||||
if (getLog().isDebugEnabled()) {
|
if (getLog().isDebugEnabled()) {
|
||||||
getLog().debug("Database connection error", ex);
|
getLog().debug("Database connection error", ex);
|
||||||
}
|
}
|
||||||
final String msg = "An exception occured connecting to the local database. Please see the log file for more details.";
|
final String msg = "An exception occurred connecting to the local database. Please see the log file for more details.";
|
||||||
if (this.isFailOnError()) {
|
if (this.isFailOnError()) {
|
||||||
throw new MojoExecutionException(msg, ex);
|
throw new MojoExecutionException(msg, ex);
|
||||||
}
|
}
|
||||||
@@ -96,7 +96,7 @@ public class CheckMojo extends BaseDependencyCheckMojo {
|
|||||||
engine.analyzeDependencies();
|
engine.analyzeDependencies();
|
||||||
} catch (ExceptionCollection ex) {
|
} catch (ExceptionCollection ex) {
|
||||||
if (this.isFailOnError() && ex.isFatal()) {
|
if (this.isFailOnError() && ex.isFatal()) {
|
||||||
throw new MojoExecutionException("One or more exceptions occured during analysis", ex);
|
throw new MojoExecutionException("One or more exceptions occurred during analysis", ex);
|
||||||
}
|
}
|
||||||
exCol = ex;
|
exCol = ex;
|
||||||
}
|
}
|
||||||
@@ -116,7 +116,7 @@ public class CheckMojo extends BaseDependencyCheckMojo {
|
|||||||
showSummary(getProject(), engine.getDependencies());
|
showSummary(getProject(), engine.getDependencies());
|
||||||
checkForFailure(engine.getDependencies());
|
checkForFailure(engine.getDependencies());
|
||||||
if (exCol != null && this.isFailOnError()) {
|
if (exCol != null && this.isFailOnError()) {
|
||||||
throw new MojoExecutionException("One or more exceptions occured during dependency-check analysis", exCol);
|
throw new MojoExecutionException("One or more exceptions occurred during dependency-check analysis", exCol);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,13 +71,13 @@ public class UpdateMojo extends BaseDependencyCheckMojo {
|
|||||||
if (getLog().isDebugEnabled()) {
|
if (getLog().isDebugEnabled()) {
|
||||||
getLog().debug("Database connection error", ex);
|
getLog().debug("Database connection error", ex);
|
||||||
}
|
}
|
||||||
final String msg = "An exception occured connecting to the local database. Please see the log file for more details.";
|
final String msg = "An exception occurred connecting to the local database. Please see the log file for more details.";
|
||||||
if (this.isFailOnError()) {
|
if (this.isFailOnError()) {
|
||||||
throw new MojoExecutionException(msg, ex);
|
throw new MojoExecutionException(msg, ex);
|
||||||
}
|
}
|
||||||
getLog().error(msg);
|
getLog().error(msg);
|
||||||
} catch (UpdateException ex) {
|
} catch (UpdateException ex) {
|
||||||
final String msg = "An exception occured while downloading updates. Please see the log file for more details.";
|
final String msg = "An exception occurred while downloading updates. Please see the log file for more details.";
|
||||||
if (this.isFailOnError()) {
|
if (this.isFailOnError()) {
|
||||||
throw new MojoExecutionException(msg, ex);
|
throw new MojoExecutionException(msg, ex);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -370,8 +370,11 @@ public final class Settings {
|
|||||||
try {
|
try {
|
||||||
in = this.getClass().getClassLoader().getResourceAsStream(propertiesFilePath);
|
in = this.getClass().getClassLoader().getResourceAsStream(propertiesFilePath);
|
||||||
props.load(in);
|
props.load(in);
|
||||||
|
} catch (NullPointerException ex) {
|
||||||
|
LOGGER.error("Did not find settings file '{}'.", propertiesFilePath);
|
||||||
|
LOGGER.debug("", ex);
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
LOGGER.error("Unable to load default settings.");
|
LOGGER.error("Unable to load settings from '{}'.", propertiesFilePath);
|
||||||
LOGGER.debug("", ex);
|
LOGGER.debug("", ex);
|
||||||
} finally {
|
} finally {
|
||||||
if (in != null) {
|
if (in != null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user