You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by mi...@apache.org on 2018/03/18 19:54:42 UTC
[maven-help-plugin] branch MPH-135 created (now 2fadb57)
This is an automated email from the ASF dual-hosted git repository.
michaelo pushed a change to branch MPH-135
in repository https://gitbox.apache.org/repos/asf/maven-help-plugin.git.
at 2fadb57 [MPH-135] help:effective-pom crashes with NPE in multi module builds with -Doutput set
This branch includes the following new commits:
new 2fadb57 [MPH-135] help:effective-pom crashes with NPE in multi module builds with -Doutput set
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
--
To stop receiving notification emails like this one, please contact
michaelo@apache.org.
[maven-help-plugin] 01/01: [MPH-135] help:effective-pom crashes
with NPE in multi module builds with -Doutput set
Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
michaelo pushed a commit to branch MPH-135
in repository https://gitbox.apache.org/repos/asf/maven-help-plugin.git
commit 2fadb5796222140ccc3e11e6ff6e2673d57ae91e
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Sun Mar 18 20:52:55 2018 +0100
[MPH-135] help:effective-pom crashes with NPE in multi module builds with -Doutput set
Explicitly check for null in encoding becaue JDOM's API design does permit nulls
here, but expects value never to be null.
---
src/main/java/org/apache/maven/plugins/help/EffectivePomMojo.java | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/main/java/org/apache/maven/plugins/help/EffectivePomMojo.java b/src/main/java/org/apache/maven/plugins/help/EffectivePomMojo.java
index c459cbc..216ed0a 100644
--- a/src/main/java/org/apache/maven/plugins/help/EffectivePomMojo.java
+++ b/src/main/java/org/apache/maven/plugins/help/EffectivePomMojo.java
@@ -238,7 +238,11 @@ public class EffectivePomMojo
StringWriter w = new StringWriter();
Format format = Format.getPrettyFormat();
- format.setEncoding( encoding );
+ if ( encoding != null )
+ {
+ // This is a design flaw in JDOM, no NPE on null arguments, but null is not prohibited
+ format.setEncoding( encoding );
+ }
format.setLineSeparator( System.lineSeparator() );
XMLOutputter out = new XMLOutputter( format );
out.output( effectiveDocument, w );
--
To stop receiving notification emails like this one, please contact
michaelo@apache.org.