Merge remote-tracking branch 'origin/master' into feature/RAT-259
diff --git a/.gitignore b/.gitignore
index 25e619a..25ed42b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -17,4 +17,10 @@
 .idea/*
 */.idea
 /target/
+# Eclipse generates new ignore files after project import
+apache-rat-core/.gitignore
+apache-rat-plugin/.gitignore
+apache-rat-tasks/.gitignore
+apache-rat/.gitignore
+=======
 **/.gitignore
diff --git a/apache-rat-core/src/main/java/org/apache/rat/Report.java b/apache-rat-core/src/main/java/org/apache/rat/Report.java
index 4dff579..0c0c9d0 100644
--- a/apache-rat-core/src/main/java/org/apache/rat/Report.java
+++ b/apache-rat-core/src/main/java/org/apache/rat/Report.java
@@ -18,10 +18,6 @@
  */
 package org.apache.rat;
 
-import org.apache.commons.cli.*;
-import org.apache.commons.io.FileUtils;
-import org.apache.commons.io.filefilter.*;
-import org.apache.commons.lang3.StringUtils;
 import org.apache.rat.api.RatException;
 import org.apache.rat.report.IReportable;
 import org.apache.rat.report.RatReport;
@@ -34,222 +30,14 @@
 
 import javax.xml.transform.TransformerConfigurationException;
 import java.io.*;
-import java.nio.charset.Charset;
-import java.util.Arrays;
-import java.util.List;
-import java.util.regex.PatternSyntaxException;
-
 
 public class Report {
-    private static final String EXCLUDE_CLI = "e";
-    private static final String EXCLUDE_FILE_CLI = "E";
-    private static final String STYLESHEET_CLI = "s";
-    private static final String HELP = "h";
 
-    public static final void main(String[] args) throws Exception {
-        final ReportConfiguration configuration = new ReportConfiguration();
-        configuration.setHeaderMatcher(Defaults.createDefaultMatcher());
-        configuration.setApproveDefaultLicenses(true);
-        Options opts = buildOptions();
-
-        CommandLine cl = null;
-        try {
-            cl = new DefaultParser().parse(opts, args);
-        } catch (ParseException e) {
-            System.err.println("Please use the \"--help\" option to see a list of valid commands and options");
-            System.exit(1);
-            return; // dummy return (won't be reached) to avoid Eclipse complaint about possible NPE for "cl"
-        }
-
-        if (cl.hasOption(HELP)) {
-            printUsage(opts);
-        }
-
-        args = cl.getArgs();
-        if (args == null || args.length != 1) {
-            printUsage(opts);
-        } else {
-            Report report = new Report(args[0]);
-
-            if (cl.hasOption('a') || cl.hasOption('A')) {
-                configuration.setAddingLicenses(true);
-                configuration.setAddingLicensesForced(cl.hasOption('f'));
-                configuration.setCopyrightMessage(cl.getOptionValue("c"));
-            }
-
-            if (cl.hasOption(EXCLUDE_CLI)) {
-                String[] excludes = cl.getOptionValues(EXCLUDE_CLI);
-                if (excludes != null) {
-                    final FilenameFilter filter = parseExclusions(Arrays.asList(excludes));
-                    report.setInputFileFilter(filter);
-                }
-            } else if (cl.hasOption(EXCLUDE_FILE_CLI)) {
-                String excludeFileName = cl.getOptionValue(EXCLUDE_FILE_CLI);
-                if (excludeFileName != null) {
-                    final FilenameFilter filter = parseExclusions(FileUtils.readLines(new File(excludeFileName), Charset.forName("UTF-8")));
-                    report.setInputFileFilter(filter);
-                }
-            }
-            if (cl.hasOption('x')) {
-                report.report(System.out, configuration);
-            } else {
-                if (!cl.hasOption(STYLESHEET_CLI)) {
-                    report.styleReport(System.out, configuration);
-                } else {
-                    String[] style = cl.getOptionValues(STYLESHEET_CLI);
-                    if (style.length != 1) {
-                        System.err.println("please specify a single stylesheet");
-                        System.exit(1);
-                    }
-                    try {
-                        report(System.out,
-                                report.getDirectory(System.out),
-                                new FileInputStream(style[0]),
-                                configuration);
-                    } catch (FileNotFoundException fnfe) {
-                        System.err.println("stylesheet " + style[0]
-                                + " doesn't exist");
-                        System.exit(1);
-                    }
-                }
-            }
-        }
-    }
-
-    static FilenameFilter parseExclusions(List<String> excludes) throws IOException {
-        final OrFileFilter orFilter = new OrFileFilter();
-        int ignoredLines = 0;
-        for (String exclude : excludes) {
-            try {
-                // skip comments
-                if(exclude.startsWith("#") || StringUtils.isEmpty(exclude)) {
-                    ignoredLines++;
-                    continue;
-                }
-
-                String exclusion = exclude.trim();
-                // interpret given patterns as regular expression, direct file names or wildcards to give users more choices to configure exclusions
-                orFilter.addFileFilter(new RegexFileFilter(exclusion));
-                orFilter.addFileFilter(new NameFileFilter(exclusion));
-                orFilter.addFileFilter(new WildcardFileFilter(exclusion));
-            } catch(PatternSyntaxException e) {
-                System.err.println("Will skip given exclusion '" + exclude + "' due to " + e);
-            }
-        }
-        System.err.println("Ignored " + ignoredLines + " lines in your exclusion files as comments or empty lines.");
-        return new NotFileFilter(orFilter);
-    }
-
-    private static Options buildOptions() {
-        Options opts = new Options();
-
-        Option help = new Option(HELP, "help", false,
-                "Print help for the RAT command line interface and exit");
-        opts.addOption(help);
-
-        OptionGroup addLicenseGroup = new OptionGroup();
-        String addLicenseDesc = "Add the default license header to any file with an unknown license that is not in the exclusion list. " +
-                "By default new files will be created with the license header, " +
-                "to force the modification of existing files use the --force option.";
-
-        // RAT-85/RAT-203: Deprecated! added only for convenience and for backwards compatibility
-        Option addLicence = new Option(
-                "a",
-                "addLicence",
-                false,
-                addLicenseDesc);
-        addLicenseGroup.addOption(addLicence);
-        Option addLicense = new Option(
-                "A",
-                "addLicense",
-                false,
-                addLicenseDesc);
-        addLicenseGroup.addOption(addLicense);
-        opts.addOptionGroup(addLicenseGroup);
-
-        Option write = new Option(
-                "f",
-                "force",
-                false,
-                "Forces any changes in files to be written directly to the source files (i.e. new files are not created)");
-        opts.addOption(write);
-
-        Option copyright = new Option(
-                "c",
-                "copyright",
-                true,
-                "The copyright message to use in the license headers, usually in the form of \"Copyright 2008 Foo\"");
-        opts.addOption(copyright);
-
-        final Option exclude = Option.builder(EXCLUDE_CLI)
-                .argName("expression")
-                .longOpt("exclude")
-                .hasArgs()
-                .desc("Excludes files matching wildcard <expression>. " +
-                        "Note that --dir is required when using this parameter. " +
-                        "Allows multiple arguments.")
-                .build();
-        opts.addOption(exclude);
-
-        final Option excludeFile = Option.builder(EXCLUDE_FILE_CLI)
-                .argName("fileName")
-                .longOpt("exclude-file")
-                .hasArgs()
-                .desc("Excludes files matching regular expression in <file> " +
-                        "Note that --dir is required when using this parameter. ")
-                .build();
-        opts.addOption(excludeFile);
-
-        Option dir = new Option(
-                "d",
-                "dir",
-                false,
-                "Used to indicate source when using --exclude");
-        opts.addOption(dir);
-
-        OptionGroup outputType = new OptionGroup();
-
-        Option xml = new Option(
-                "x",
-                "xml",
-                false,
-                "Output the report in raw XML format.  Not compatible with -s");
-        outputType.addOption(xml);
-
-        Option xslt = new Option(STYLESHEET_CLI,
-                "stylesheet",
-                true,
-                "XSLT stylesheet to use when creating the"
-                        + " report.  Not compatible with -x");
-        outputType.addOption(xslt);
-        opts.addOptionGroup(outputType);
-
-        return opts;
-    }
-
-    private static void printUsage(Options opts) {
-        HelpFormatter f = new HelpFormatter();
-        String header = "\nAvailable options";
-
-        String footer = "\nNOTE:\n" +
-                "Rat is really little more than a grep ATM\n" +
-                "Rat is also rather memory hungry ATM\n" +
-                "Rat is very basic ATM\n" +
-                "Rat highlights possible issues\n" +
-                "Rat reports require interpretation\n" +
-                "Rat often requires some tuning before it runs well against a project\n" +
-                "Rat relies on heuristics: it may miss issues\n";
-
-        f.printHelp("java -jar apache-rat/target/apache-rat-CURRENT-VERSION.jar [options] [DIR|TARBALL]",
-                header, opts, footer, false);
-        System.exit(0);
-    }
-
-    private final String baseDirectory;
+    private final File baseDirectory;
 
     private FilenameFilter inputFileFilter = null;
 
-    private Report(String baseDirectory) {
+    public Report(File baseDirectory) {
         this.baseDirectory = baseDirectory;
     }
 
@@ -293,21 +81,20 @@
         return null;
     }
 
-    private IReportable getDirectory(PrintStream out) {
-        File base = new File(baseDirectory);
-        if (!base.exists()) {
+    public IReportable getDirectory(PrintStream out) {
+        if (!baseDirectory.exists()) {
             out.print("ERROR: ");
             out.print(baseDirectory);
             out.print(" does not exist.\n");
             return null;
         }
 
-        if (base.isDirectory()) {
-            return new DirectoryWalker(base, inputFileFilter);
+        if (baseDirectory.isDirectory()) {
+            return new DirectoryWalker(baseDirectory, inputFileFilter);
         }
 
         try {
-            return new ArchiveWalker(base, inputFileFilter);
+            return new ArchiveWalker(baseDirectory, inputFileFilter);
         } catch (IOException ex) {
             out.print("ERROR: ");
             out.print(baseDirectory);
@@ -363,7 +150,7 @@
      * @throws InterruptedException              in case of threading errors.
      * @throws RatException                      in case of internal errors.
      */
-    public static void report(PrintStream out, IReportable base, final InputStream style,
+    public void report(PrintStream out, IReportable base, final InputStream style,
                               ReportConfiguration pConfiguration)
             throws IOException, TransformerConfigurationException, InterruptedException, RatException {
         report(new OutputStreamWriter(out), base, style, pConfiguration);
@@ -382,7 +169,7 @@
      * @throws InterruptedException              in case of threading errors.
      * @throws RatException                      in case of internal errors.
      */
-    public static ClaimStatistic report(Writer out, IReportable base, final InputStream style,
+    public ClaimStatistic report(Writer out, IReportable base, final InputStream style,
                                         ReportConfiguration pConfiguration)
             throws IOException, TransformerConfigurationException, InterruptedException, RatException {
         PipedReader reader = new PipedReader();
@@ -405,7 +192,7 @@
      * @throws IOException  in case of I/O errors.
      * @throws RatException in case of internal errors.
      */
-    public static ClaimStatistic report(final IReportable container, final Writer out,
+    public ClaimStatistic report(final IReportable container, final Writer out,
                                         ReportConfiguration pConfiguration) throws IOException, RatException {
         IXmlWriter writer = new XmlWriter(out);
         final ClaimStatistic statistic = new ClaimStatistic();
diff --git a/apache-rat-core/src/main/java/org/apache/rat/cli/RatCommandLine.java b/apache-rat-core/src/main/java/org/apache/rat/cli/RatCommandLine.java
new file mode 100644
index 0000000..31831c7
--- /dev/null
+++ b/apache-rat-core/src/main/java/org/apache/rat/cli/RatCommandLine.java
@@ -0,0 +1,242 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ */
+package org.apache.rat.cli;
+
+import org.apache.commons.cli.*;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.filefilter.*;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.rat.Defaults;
+import org.apache.rat.Report;
+import org.apache.rat.ReportConfiguration;
+
+import java.io.*;
+import java.nio.charset.Charset;
+import java.util.Arrays;
+import java.util.List;
+import java.util.regex.PatternSyntaxException;
+
+public class RatCommandLine {
+    private static final String EXCLUDE_CLI = "e";
+    private static final String EXCLUDE_FILE_CLI = "E";
+    private static final String STYLESHEET_CLI = "s";
+    private static final String HELP = "h";
+
+    public static final void main(String[] args) throws Exception {
+        final ReportConfiguration configuration = new ReportConfiguration();
+        configuration.setHeaderMatcher(Defaults.createDefaultMatcher());
+        configuration.setApproveDefaultLicenses(true);
+        Options opts = buildOptions();
+
+        CommandLine cl = null;
+        try {
+            cl = new DefaultParser().parse(opts, args);
+        } catch (ParseException e) {
+            System.err.println("Please use the \"--help\" option to see a list of valid commands and options");
+            System.exit(1);
+            return; // dummy return (won't be reached) to avoid Eclipse complaint about possible NPE for "cl"
+        }
+
+        if (cl.hasOption(HELP)) {
+            printUsage(opts);
+            System.exit(0);
+        }
+
+        args = cl.getArgs();
+        if (args == null || args.length != 1) {
+            printUsage(opts);
+            System.exit(0);
+        } else {
+            Report report = new Report(new File(args[0]));
+
+            if (cl.hasOption('a') || cl.hasOption('A')) {
+                configuration.setAddingLicenses(true);
+                configuration.setAddingLicensesForced(cl.hasOption('f'));
+                configuration.setCopyrightMessage(cl.getOptionValue("c"));
+            }
+
+            if (cl.hasOption(EXCLUDE_CLI)) {
+                String[] excludes = cl.getOptionValues(EXCLUDE_CLI);
+                if (excludes != null) {
+                    final FilenameFilter filter = parseExclusions(Arrays.asList(excludes));
+                    report.setInputFileFilter(filter);
+                }
+            } else if (cl.hasOption(EXCLUDE_FILE_CLI)) {
+                String excludeFileName = cl.getOptionValue(EXCLUDE_FILE_CLI);
+                if (excludeFileName != null) {
+                    final FilenameFilter filter = parseExclusions(FileUtils.readLines(new File(excludeFileName), Charset.forName("UTF-8")));
+                    report.setInputFileFilter(filter);
+                }
+            }
+            if (cl.hasOption('x')) {
+                report.report(System.out, configuration);
+            } else {
+                if (!cl.hasOption(STYLESHEET_CLI)) {
+                    report.styleReport(System.out, configuration);
+                } else {
+                    String[] style = cl.getOptionValues(STYLESHEET_CLI);
+                    if (style.length != 1) {
+                        System.err.println("please specify a single stylesheet");
+                        System.exit(1);
+                    }
+                    try {
+                        report.report(System.out,
+                                report.getDirectory(System.out),
+                                new FileInputStream(style[0]),
+                                configuration);
+                    } catch (FileNotFoundException fnfe) {
+                        System.err.println("stylesheet " + style[0]
+                                + " doesn't exist");
+                        System.exit(1);
+                    }
+                }
+            }
+        }
+    }
+
+    static FilenameFilter parseExclusions(List<String> excludes) throws IOException {
+        final OrFileFilter orFilter = new OrFileFilter();
+        int ignoredLines = 0;
+        for (String exclude : excludes) {
+            try {
+                // skip comments
+                if (exclude.startsWith("#") || StringUtils.isEmpty(exclude)) {
+                    ignoredLines++;
+                    continue;
+                }
+
+                String exclusion = exclude.trim();
+                // interpret given patterns as regular expression, direct file names or wildcards to give users more choices to configure exclusions
+                orFilter.addFileFilter(new RegexFileFilter(exclusion));
+                orFilter.addFileFilter(new NameFileFilter(exclusion));
+                orFilter.addFileFilter(new WildcardFileFilter(exclusion));
+            } catch (PatternSyntaxException e) {
+                System.err.println("Will skip given exclusion '" + exclude + "' due to " + e);
+            }
+        }
+        System.err.println("Ignored " + ignoredLines + " lines in your exclusion files as comments or empty lines.");
+        return new NotFileFilter(orFilter);
+    }
+
+
+    static Options buildOptions() {
+        Options opts = new Options();
+
+        Option help = new Option(HELP, "help", false,
+                "Print help for the RAT command line interface and exit");
+        opts.addOption(help);
+
+        OptionGroup addLicenseGroup = new OptionGroup();
+        String addLicenseDesc = "Add the default license header to any file with an unknown license that is not in the exclusion list. " +
+                "By default new files will be created with the license header, " +
+                "to force the modification of existing files use the --force option.";
+
+        // RAT-85/RAT-203: Deprecated! added only for convenience and for backwards compatibility
+        Option addLicence = new Option(
+                "a",
+                "addLicence",
+                false,
+                addLicenseDesc);
+        addLicenseGroup.addOption(addLicence);
+        Option addLicense = new Option(
+                "A",
+                "addLicense",
+                false,
+                addLicenseDesc);
+        addLicenseGroup.addOption(addLicense);
+        opts.addOptionGroup(addLicenseGroup);
+
+        Option write = new Option(
+                "f",
+                "force",
+                false,
+                "Forces any changes in files to be written directly to the source files (i.e. new files are not created)");
+        opts.addOption(write);
+
+        Option copyright = new Option(
+                "c",
+                "copyright",
+                true,
+                "The copyright message to use in the license headers, usually in the form of \"Copyright 2008 Foo\"");
+        opts.addOption(copyright);
+
+        final Option exclude = Option.builder(EXCLUDE_CLI)
+                .argName("expression")
+                .longOpt("exclude")
+                .hasArgs()
+                .desc("Excludes files matching wildcard <expression>. " +
+                        "Note that --dir is required when using this parameter. " +
+                        "Allows multiple arguments.")
+                .build();
+        opts.addOption(exclude);
+
+        final Option excludeFile = Option.builder(EXCLUDE_FILE_CLI)
+                .argName("fileName")
+                .longOpt("exclude-file")
+                .hasArgs()
+                .desc("Excludes files matching regular expression in <file> " +
+                        "Note that --dir is required when using this parameter. ")
+                .build();
+        opts.addOption(excludeFile);
+
+        Option dir = new Option(
+                "d",
+                "dir",
+                false,
+                "Used to indicate source when using --exclude");
+        opts.addOption(dir);
+
+        OptionGroup outputType = new OptionGroup();
+
+        Option xml = new Option(
+                "x",
+                "xml",
+                false,
+                "Output the report in raw XML format.  Not compatible with -s");
+        outputType.addOption(xml);
+
+        Option xslt = new Option(STYLESHEET_CLI,
+                "stylesheet",
+                true,
+                "XSLT stylesheet to use when creating the"
+                        + " report.  Not compatible with -x");
+        outputType.addOption(xslt);
+        opts.addOptionGroup(outputType);
+
+        return opts;
+    }
+
+    static void printUsage(Options opts) {
+        HelpFormatter f = new HelpFormatter();
+        String header = "\nAvailable options";
+
+        String footer = "\nNOTE:\n" +
+                "Rat is really little more than a grep ATM\n" +
+                "Rat is also rather memory hungry ATM\n" +
+                "Rat is very basic ATM\n" +
+                "Rat highlights possible issues\n" +
+                "Rat reports require interpretation\n" +
+                "Rat often requires some tuning before it runs well against a project\n" +
+                "Rat relies on heuristics: it may miss issues\n";
+
+        f.printHelp("java -jar apache-rat/target/apache-rat-CURRENT-VERSION.jar [options] [DIR|TARBALL]",
+                header, opts, footer, false);
+    }
+
+}
diff --git a/apache-rat-core/src/test/java/org/apache/rat/ReportTest.java b/apache-rat-core/src/test/java/org/apache/rat/ReportTest.java
index 444a61c..26b74b5 100644
--- a/apache-rat-core/src/test/java/org/apache/rat/ReportTest.java
+++ b/apache-rat-core/src/test/java/org/apache/rat/ReportTest.java
@@ -122,7 +122,7 @@
         final ReportConfiguration configuration = new ReportConfiguration();
         configuration.setApproveDefaultLicenses(true);
         configuration.setHeaderMatcher(matcherMultiplexer);
-        Report.report(out, new DirectoryWalker(new File(elementsPath)),
+        new Report(null).report(out, new DirectoryWalker(new File(elementsPath)),
                 Defaults.getPlainStyleSheet(), configuration);
 
         String result = out.getBuffer().toString();
@@ -137,9 +137,4 @@
                 result.substring(generatedAtLineEnd + NL.length()));
     }
 
-    @Test
-    public void parseExclusionsForCLIUsage() throws IOException {
-        final FilenameFilter filter = Report.parseExclusions(Arrays.asList("", " # foo/bar", "foo", "##", " ./foo/bar"));
-        assertNotNull(filter);
-    }
 }
diff --git a/apache-rat-core/src/test/java/org/apache/rat/cli/RatCommandLineTest.java b/apache-rat-core/src/test/java/org/apache/rat/cli/RatCommandLineTest.java
new file mode 100644
index 0000000..f702c54
--- /dev/null
+++ b/apache-rat-core/src/test/java/org/apache/rat/cli/RatCommandLineTest.java
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ */
+package org.apache.rat.cli;
+
+import org.apache.commons.cli.Options;
+import org.junit.Test;
+
+import java.io.FilenameFilter;
+import java.io.IOException;
+import java.util.Arrays;
+
+import static org.junit.Assert.assertNotNull;
+
+public class RatCommandLineTest {
+    @Test
+    public void parseExclusions() throws IOException {
+        final FilenameFilter filter = RatCommandLine.parseExclusions(Arrays.asList("", " # foo/bar", "foo", "##", " ./foo/bar"));
+        assertNotNull(filter);
+    }
+    
+    @Test
+    public void helpFormatterWorks() {
+		RatCommandLine.printUsage(new Options());
+    }
+
+    @Test
+    public void optionsCanBeGenerated() {
+		RatCommandLine.printUsage(RatCommandLine.buildOptions());
+    }
+}
diff --git a/apache-rat-plugin/src/main/java/org/apache/rat/mp/AbstractRatMojo.java b/apache-rat-plugin/src/main/java/org/apache/rat/mp/AbstractRatMojo.java
index 9d672da..6d451f8 100644
--- a/apache-rat-plugin/src/main/java/org/apache/rat/mp/AbstractRatMojo.java
+++ b/apache-rat-plugin/src/main/java/org/apache/rat/mp/AbstractRatMojo.java
@@ -518,9 +518,9 @@
         final ReportConfiguration configuration = getConfiguration();
         try {
             if (style != null) {
-                return Report.report(out, getResources(), style, configuration);
+                return new Report(basedir).report(out, getResources(), style, configuration);
             } else {
-                return Report.report(getResources(), out, configuration);
+                return new Report(basedir).report(getResources(), out, configuration);
             }
         } catch (final TransformerConfigurationException | RatException | InterruptedException | IOException e) {
             throw new MojoExecutionException(e.getMessage(), e);
diff --git a/apache-rat-tasks/src/main/java/org/apache/rat/anttasks/Report.java b/apache-rat-tasks/src/main/java/org/apache/rat/anttasks/Report.java
index 78b27f9..4c79598 100644
--- a/apache-rat-tasks/src/main/java/org/apache/rat/anttasks/Report.java
+++ b/apache-rat-tasks/src/main/java/org/apache/rat/anttasks/Report.java
@@ -260,8 +260,10 @@
             throw new BuildException("Invalid value for addLicenseHeaders: " + addLicenseHeaders.getValue());
         }
         ResourceCollectionContainer rcElement = new ResourceCollectionContainer(nestedResources);
+        // reportFile is not used from Ant to actually get the report
+        org.apache.rat.Report report = new org.apache.rat.Report(reportFile);
         if (format.getValue().equals(Format.XML_KEY)) {
-            org.apache.rat.Report.report(rcElement, out, configuration);
+            report.report(rcElement, out, configuration);
         } else {
             InputStream style = null;
             try {
@@ -273,7 +275,7 @@
                     throw new BuildException("unsupported format '"
                                              + format.getValue() + "'");
                 }
-                org.apache.rat.Report.report(out, rcElement, style,
+                report.report(out, rcElement, style,
                                              configuration);
             } finally {
                 FileUtils.close(style);
diff --git a/apache-rat/pom.xml b/apache-rat/pom.xml
index 138a994..8b0f4f4 100644
--- a/apache-rat/pom.xml
+++ b/apache-rat/pom.xml
@@ -92,13 +92,13 @@
           </excludes>
           <archive>
             <manifestEntries>
-              <Main-Class>org.apache.rat.Report</Main-Class>
+              <Main-Class>org.apache.rat.cli.RatCommandLine</Main-Class>
               <Extension-Name>rat</Extension-Name>
               <Specification-Title>Apache Rat</Specification-Title>
               <Specification-Vendor>apache.org</Specification-Vendor>
               <Specification-Version>${project.version}</Specification-Version>
               <Implementation-Vendor-Id>apache.org</Implementation-Vendor-Id>
-              <Implementation-Title>Apache Rat</Implementation-Title>
+              <Implementation-Title>Apache Creadur RAT</Implementation-Title>
               <Implementation-Vendor>Apache Software Foundation</Implementation-Vendor>
               <Implementation-Version>${project.version}</Implementation-Version>
             </manifestEntries>