Skip to content

Commit

Permalink
[MPLUGIN-511] improvements based on feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
hboutemy committed Mar 14, 2024
1 parent 58648cf commit 4607b85
Showing 1 changed file with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,13 @@ public class PluginReport extends AbstractMavenReport {
@Parameter
private List<RequirementsHistory> requirementsHistories = new ArrayList<>();

/**
* Plugin's version range for automatic detection of requirements history.
*
* @since 3.12.0
*/
@Parameter(defaultValue = "[0,)")
private String detectRequirementsHistory;
private String requirementsHistoryDetectionRange;

@Component
private RuntimeInformation rtInfo;
Expand Down Expand Up @@ -183,8 +188,8 @@ protected void executeReport(Locale locale) throws MavenReportException {
// detect requirements history
String v = null;
try {
List<Version> versions = discoverVersions(detectRequirementsHistory);
getLog().info("Detecting requirements history for " + detectRequirementsHistory + ": "
List<Version> versions = discoverVersions(requirementsHistoryDetectionRange);
getLog().info("Detecting requirements history for " + requirementsHistoryDetectionRange + ": "
+ versions.size());

Collections.reverse(versions);
Expand All @@ -193,10 +198,11 @@ protected void executeReport(Locale locale) throws MavenReportException {
MavenProject versionProject = buildMavenProject(v);
RequirementsHistory requirements = RequirementsHistory.discoverRequirements(versionProject);
requirementsHistories.add(requirements);
getLog().info("- " + requirements);
getLog().info(" - " + requirements);
}
} catch (VersionRangeResolutionException vrre) {
throw new MavenReportException("Cannot resolve past versions " + detectRequirementsHistory, vrre);
throw new MavenReportException(
"Cannot resolve past versions " + requirementsHistoryDetectionRange, vrre);
} catch (ProjectBuildingException pbe) {
throw new MavenReportException("Cannot resolve MavenProject for version " + v, pbe);
}
Expand Down

0 comments on commit 4607b85

Please sign in to comment.