You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sl...@apache.org on 2019/04/12 17:30:11 UTC
[maven] 01/01: [MNG-6636] Fix location NPE on reporting with no
reports
This is an automated email from the ASF dual-hosted git repository.
slachiewicz pushed a commit to branch MNG-6636
in repository https://gitbox.apache.org/repos/asf/maven.git
commit 81bb3ad8b4044a238f477f4f3432ff3bd93cf1e1
Author: Sylwester Lachiewicz <sl...@apache.org>
AuthorDate: Thu Apr 11 22:05:23 2019 +0200
[MNG-6636] Fix location NPE on reporting with no reports
---
.../apache/maven/model/plugin/DefaultReportingConverter.java | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/plugin/DefaultReportingConverter.java b/maven-model-builder/src/main/java/org/apache/maven/model/plugin/DefaultReportingConverter.java
index 683f494..2571104 100644
--- a/maven-model-builder/src/main/java/org/apache/maven/model/plugin/DefaultReportingConverter.java
+++ b/maven-model-builder/src/main/java/org/apache/maven/model/plugin/DefaultReportingConverter.java
@@ -235,12 +235,16 @@ public class DefaultReportingConverter
if ( !reportSet.getReports().isEmpty() )
{
- InputLocation location = reportSet.getLocation( "reports" );
- Xpp3Dom reports = new Xpp3Dom( "reports", location );
+ InputLocation reportsLocation = reportSet.getLocation( "reports" );
+ if ( reportsLocation == null )
+ {
+ reportsLocation = location;
+ }
+ Xpp3Dom reports = new Xpp3Dom( "reports", reportsLocation );
int n = 0;
for ( String report : reportSet.getReports() )
{
- addDom( reports, "report", report, location.getLocation( n++ ) );
+ addDom( reports, "report", report, reportsLocation.getLocation( n++ ) );
}
dom.addChild( reports );
}