if (!new File(resolveCloverDatabase()).exists()) {
getLog().info(resolveCloverDatabase() + " does not exist. Skipping snapshot creation.");
return;
}
final CloverSnapshotTask task = createSnapshotTask();
task.setInitString(resolveCloverDatabase());
task.setDebug(debug);
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);
}
snapshot = new ConfigUtil(this).resolveSnapshotFile(snapshot);
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;
SnapshotPrinter.textPrint(Snapshot.loadFrom(cpLocation), new MvnLogger(getLog()), Logger.LOG_VERBOSE);
}
}