You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@creadur.apache.org by po...@apache.org on 2020/07/02 06:16:36 UTC

[creadur-rat] 01/02: RAT-270: Enable output to console by default

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

pottlinger pushed a commit to branch feature/RAT-270
in repository https://gitbox.apache.org/repos/asf/creadur-rat.git

commit f4cae65a355a79ab085186e5ea23a39fb4706e42
Author: Hugo Hirsch <gi...@hugo-hirsch.de>
AuthorDate: Thu Jul 2 08:13:33 2020 +0200

    RAT-270: Enable output to console by default
---
 .../src/main/java/org/apache/rat/mp/RatCheckMojo.java              | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/apache-rat-plugin/src/main/java/org/apache/rat/mp/RatCheckMojo.java b/apache-rat-plugin/src/main/java/org/apache/rat/mp/RatCheckMojo.java
index 3537cbd..2898b1a 100644
--- a/apache-rat-plugin/src/main/java/org/apache/rat/mp/RatCheckMojo.java
+++ b/apache-rat-plugin/src/main/java/org/apache/rat/mp/RatCheckMojo.java
@@ -40,6 +40,7 @@ import java.io.InputStream;
 import java.io.OutputStreamWriter;
 import java.io.Writer;
 import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
 
 /**
  * Run Rat to perform a violation check.
@@ -93,11 +94,11 @@ public class RatCheckMojo extends AbstractRatMojo {
 
     /**
      * Whether to output the names of files that have unapproved licenses to the
-     * console.
+     * console. Defaults to {@code true} to ease builds in containers where you are unable to access rat.txt easily.
      *
      * @since 0.12
      */
-    @Parameter(property = "rat.consoleOutput", defaultValue = "false")
+    @Parameter(property = "rat.consoleOutput", defaultValue = "true")
     private boolean consoleOutput;
 
     private ClaimStatistic getRawReport()
@@ -106,7 +107,7 @@ public class RatCheckMojo extends AbstractRatMojo {
         try {
             fw = new OutputStreamWriter(
                    new FileOutputStream(reportFile),
-                   Charset.forName("UTF-8"));
+                    StandardCharsets.UTF_8);
             final ClaimStatistic statistic = createReport(fw, getStyleSheet());
             fw.close();
             fw = null;