if (!new File(resolveCloverDatabase()).exists()) {
getLog().info(resolveCloverDatabase() + " does not exist. Skipping snapshot creation.");
return;
}
final CloverSnapshotTask task = createSnapshotTask();
task.setInitString(resolveCloverDatabase());
if (span != null) {
task.setSpan(span);
} else if (CloverSetupMojo.START_DATE != null) {
final long timeSinceStart = new Date().getTime() - CloverSetupMojo.START_DATE.getTime();
final String interval = ((timeSinceStart + 1000)/ 1000) + "s";
getLog().info("No span specified, using span of: " + interval);
task.setSpan(interval);
}
if (snapshot != null && snapshot.getParentFile() != null) {
snapshot.getParentFile().mkdirs();
getLog().info("Saving snapshot to: " + snapshot);
task.setFile(snapshot);
}
execTask(task);
if (getLog().isDebugEnabled() || debug) {
final String cpLocation = snapshot != null ? snapshot.getPath() : task.getInitString() + CloverNames.SNAPSHOT_SUFFIX;
SnapshotDumper.printPretty(CloverTestSnapshot.loadFrom(cpLocation), new MvnLogger(getLog()), Logger.LOG_VERBOSE);
//for 2.5.0 SnapshotPrinter.prettyPrint(Snapshot.loadFrom(cpLocation), new MvnLogger(getLog()), Logger.LOG_VERBOSE);
}
}