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 13, 2024
1 parent 58648cf commit 2576d49
Showing 1 changed file with 10 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 requirementsHistoryDetectRange;

@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(requirementsHistoryDetectRange);
getLog().info("Detecting requirements history for " + requirementsHistoryDetectRange + ": "
+ versions.size());

Collections.reverse(versions);
Expand All @@ -193,10 +198,10 @@ 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 " + requirementsHistoryDetectRange, vrre);
} catch (ProjectBuildingException pbe) {
throw new MavenReportException("Cannot resolve MavenProject for version " + v, pbe);
}
Expand Down

0 comments on commit 2576d49

Please sign in to comment.