in src/main/java/org/apache/maven/plugins/changelog/ChangeLogReport.java [481:523]
protected List<ChangeLogSet> getChangedSets() throws MavenReportException {
List<ChangeLogSet> changelogList = null;
if (!outputXML.isAbsolute()) {
outputXML = new File(project.getBasedir(), outputXML.getPath());
}
if (outputXML.exists()) {
// CHECKSTYLE_OFF: MagicNumber
if (outputXMLExpiration > 0
&& outputXMLExpiration * 60000L > System.currentTimeMillis() - outputXML.lastModified())
// CHECKSTYLE_ON: MagicNumber
{
try {
getLog().info("Using existing changelog.xml...");
changelogList = ChangeLog.loadChangedSets(
new InputStreamReader(Files.newInputStream(outputXML.toPath()), getOutputEncoding()));
} catch (FileNotFoundException e) {
// do nothing, just regenerate
} catch (Exception e) {
throw new MavenReportException("An error occurred while parsing " + outputXML.getAbsolutePath(), e);
}
}
}
if (changelogList == null) {
if (offline) {
throw new MavenReportException("This report requires online mode.");
}
getLog().info("Generating changed sets xml to: " + outputXML.getAbsolutePath());
changelogList = generateChangeSetsFromSCM();
try {
writeChangelogXml(changelogList);
} catch (IOException e) {
throw new MavenReportException("Can't create " + outputXML.getAbsolutePath(), e);
}
}
return changelogList;
}