Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MNG-7902] Sort plugins in the validation report #1510

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,7 @@

import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.*;
slawekjaranowski marked this conversation as resolved.
Show resolved Hide resolved
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;

Expand Down Expand Up @@ -203,7 +193,7 @@ public void reportPluginMojoValidationIssue(
mayReportInline(mavenSession.getRepositorySession(), locality, issue);
}

private void reportSessionCollectedValidationIssues(MavenSession mavenSession) {
public void reportSessionCollectedValidationIssues(MavenSession mavenSession) {
slawekjaranowski marked this conversation as resolved.
Show resolved Hide resolved
if (!logger.isWarnEnabled()) {
return; // nothing can be reported
}
Expand All @@ -222,7 +212,12 @@ private void reportSessionCollectedValidationIssues(MavenSession mavenSession) {
logger.warn("");
logger.warn("Plugin {} validation issues were detected in following plugin(s)", issueLocalitiesToReport);
logger.warn("");
for (Map.Entry<String, PluginValidationIssues> entry : issuesMap.entrySet()) {

// Sorting the plugins (Fix the open issue)
yuehcw marked this conversation as resolved.
Show resolved Hide resolved
List<Map.Entry<String, PluginValidationIssues>> sortedEntries = new ArrayList<>(issuesMap.entrySet());
sortedEntries.sort(Map.Entry.comparingByKey(String.CASE_INSENSITIVE_ORDER));

for (Map.Entry<String, PluginValidationIssues> entry : sortedEntries) {
PluginValidationIssues issues = entry.getValue();
if (!hasAnythingToReport(issues, issueLocalitiesToReport)) {
continue;
Expand Down