in src/main/java/org/apache/maven/plugins/artifact/buildinfo/CheckBuildPlanMojo.java [110:184]
public void execute() throws MojoExecutionException {
boolean fail =
AbstractBuildinfoMojo.hasBadOutputTimestamp(outputTimestamp, getLog(), project, session, diagnose);
// TODO check maven-jar-plugin module-info.class?
Properties issues = loadIssues();
MavenExecutionPlan plan = calculateExecutionPlan();
Set<String> plugins = new HashSet<>();
int okCount = 0;
for (MojoExecution exec : plan.getMojoExecutions()) {
Plugin plugin = exec.getPlugin();
String id = plugin.getId();
if (plugins.add(id)) {
// check reproducibility status
String issue = issues.getProperty(plugin.getKey());
if (issue == null) {
okCount++;
getLog().debug("No known issue with " + id);
} else if (issue.startsWith("fail:")) {
String logMessage = "plugin without solution " + id + ", see " + issue.substring(5);
if (failOnNonReproducible) {
getLog().error(logMessage);
} else {
getLog().warn(logMessage);
}
fail = true;
} else {
try {
Version minimum = versionScheme.parseVersion(issue);
Version version = versionScheme.parseVersion(plugin.getVersion());
if (version.compareTo(minimum) < 0) {
String logMessage =
"plugin with non-reproducible output: " + id + ", require minimum " + issue;
if (failOnNonReproducible) {
getLog().error(logMessage);
} else {
getLog().warn(logMessage);
}
fail = true;
} else {
okCount++;
getLog().debug("No known issue with " + id + " (>= " + issue + ")");
}
} catch (InvalidVersionSpecificationException e) {
throw new MojoExecutionException(e);
}
}
}
}
if (okCount > 0) {
getLog().info("No known issue in " + okCount + " plugins");
}
if (fail) {
getLog().info("current module pom.xml is " + project.getBasedir() + "/pom.xml");
MavenProject parent = project;
while (true) {
parent = parent.getParent();
if ((parent == null) || !session.getProjects().contains(parent)) {
break;
}
getLog().info(" parent pom.xml is " + parent.getBasedir() + "/pom.xml");
}
String message = "non-reproducible plugin or configuration found with fix available";
if (failOnNonReproducible) {
throw new MojoExecutionException(message);
} else {
getLog().warn(message);
}
}
}