You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ad...@apache.org on 2019/08/01 19:04:17 UTC

[maven-pmd-plugin] branch it-mpmd-187 created (now a3a8f9b)

This is an automated email from the ASF dual-hosted git repository.

adangel pushed a change to branch it-mpmd-187
in repository https://gitbox.apache.org/repos/asf/maven-pmd-plugin.git.


      at a3a8f9b  [MPMD-292] - PMD Log is not always integrated into maven log

This branch includes the following new commits:

     new 9fe044b  output build-log in case of failure
     new a3a8f9b  [MPMD-292] - PMD Log is not always integrated into maven log

The 2 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.



[maven-pmd-plugin] 01/02: output build-log in case of failure

Posted by ad...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

adangel pushed a commit to branch it-mpmd-187
in repository https://gitbox.apache.org/repos/asf/maven-pmd-plugin.git

commit 9fe044b9b580507f6dec0513375f4f465fd1136e
Author: Andreas Dangel <ad...@apache.org>
AuthorDate: Thu Aug 1 21:03:41 2019 +0200

    output build-log in case of failure
---
 src/it/MPMD-187/verify.groovy | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/it/MPMD-187/verify.groovy b/src/it/MPMD-187/verify.groovy
index 4af16b7..996b217 100644
--- a/src/it/MPMD-187/verify.groovy
+++ b/src/it/MPMD-187/verify.groovy
@@ -21,6 +21,11 @@ File buildLog = new File( basedir, 'build.log' )
 assert buildLog.exists()
 
 File pmdXml = new File( basedir, "target/pmd.xml" )
+
+if ( pmdXml.exists() )
+{
+    throw new AssertionError( buildLog.getText() )
+}
 assert !pmdXml.exists()
 
 File cpdXml = new File( basedir, "target/cpd.xml" )


[maven-pmd-plugin] 02/02: [MPMD-292] - PMD Log is not always integrated into maven log

Posted by ad...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

adangel pushed a commit to branch it-mpmd-187
in repository https://gitbox.apache.org/repos/asf/maven-pmd-plugin.git

commit a3a8f9b81e8a31efd9f7b05348386c544838c864
Author: Andreas Dangel <ad...@apache.org>
AuthorDate: Thu Aug 1 20:31:00 2019 +0200

    [MPMD-292] - PMD Log is not always integrated into maven log
---
 .../java/org/apache/maven/plugins/pmd/AbstractPmdReport.java   | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/maven/plugins/pmd/AbstractPmdReport.java b/src/main/java/org/apache/maven/plugins/pmd/AbstractPmdReport.java
index 53a6da2..4cadbcd 100644
--- a/src/main/java/org/apache/maven/plugins/pmd/AbstractPmdReport.java
+++ b/src/main/java/org/apache/maven/plugins/pmd/AbstractPmdReport.java
@@ -232,6 +232,13 @@ public abstract class AbstractPmdReport
     @Parameter( defaultValue = "true", property = "pmd.showPmdLog" )
     protected boolean showPmdLog = true;
 
+    /**
+     * This holds a strong reference in case we configured the logger to
+     * redirect to slf4j. See {@link #showPmdLog}. Without a strong reference,
+     * the logger might be garbage collected and the redirect to slf4j is gone.
+     */
+    private Logger julLogger;
+
     /** The files that are being analyzed. */
     protected Map<File, PmdFileInfo> filesToProcess;
 
@@ -576,7 +583,8 @@ public abstract class AbstractPmdReport
         logger.addHandler( handler );
         handler.setLevel( Level.ALL );
         logger.setLevel( Level.ALL );
-        getLog().debug( "Configured jul-to-slf4j bridge for " + logger.getName() );
+        julLogger = logger;
+        julLogger.fine(  "Configured jul-to-slf4j bridge for " + logger.getName() );
     }
 
     static String getPmdVersion()