btpka3 commented on code in PR #1004:
URL: https://github.com/apache/maven-enforcer/pull/1004#discussion_r3823686730
##########
enforcer-rules/src/main/java/org/apache/maven/enforcer/rules/BanDistributionManagement.java:
##########
@@ -72,12 +72,23 @@ public void execute() throws EnforcerRuleException {
getLog().debug("We are in the root of the execution and we
have a parent.");
DistributionManagementCheck check = new
DistributionManagementCheck(project);
- check.execute(isAllowRepository(),
isAllowSnapshotRepository(), isAllowSite());
+ executeCheck(check);
}
} else {
getLog().debug("We are in a deeper level.");
DistributionManagementCheck check = new
DistributionManagementCheck(project);
+ executeCheck(check);
+ }
+ }
+
+ private void executeCheck(DistributionManagementCheck check) throws
EnforcerRuleException {
+ try {
check.execute(isAllowRepository(), isAllowSnapshotRepository(),
isAllowSite());
+ } catch (EnforcerRuleException e) {
+ if (getMessage() != null) {
+ throw new EnforcerRuleException(getMessage() +
System.lineSeparator() + e.getMessage(), e);
Review Comment:
Fixed. Replaced System.lineSeparator() with "\n" in all affected files (see
commit d4f64b5).
##########
enforcer-rules/src/main/java/org/apache/maven/enforcer/rules/BanDuplicatePomDependencyVersions.java:
##########
@@ -119,6 +119,9 @@ private void maven2Validation(Model model) throws
EnforcerRuleException {
if (summary.length() > 0) {
StringBuilder message = new StringBuilder();
+ if (getMessage() != null) {
+ message.append(getMessage()).append(System.lineSeparator());
Review Comment:
Fixed. Replaced System.lineSeparator() with "\n" in all affected files (see
commit d4f64b5).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]