You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@daffodil.apache.org by GitBox <gi...@apache.org> on 2018/07/09 17:33:57 UTC

[GitHub] stevedlawrence closed pull request #73: Enable the sbt-rat plugin to perform Apache Rat checks

stevedlawrence closed pull request #73: Enable the sbt-rat plugin to perform Apache Rat checks
URL: https://github.com/apache/incubator-daffodil/pull/73
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/.gitignore b/.gitignore
index 534b8b589..56e70dd8f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -19,6 +19,7 @@ daffodil-test/errors
 errors
 project/errors
 .~*#
+testData_OnClassPath
 daffodil-core/src/main/daffodil-core.iml
 daffodil-core/src/test/Test1.iml
 daffodil-lib/src/main/daffodil-lib.iml
diff --git a/.rat-excludes b/.rat-excludes
deleted file mode 100644
index f597baffa..000000000
--- a/.rat-excludes
+++ /dev/null
@@ -1,213 +0,0 @@
-.rat-excludes
-.gitignore
-.keep
-
-# generated files
-target
-lib_managed
-src_managed
-
-# eclispe related files
-.classpath
-.project
-.jupiter
-.ensime
-
-# UTF-16BE, Apache Rat thinks it is a binary and cannot tell it includes the Apache v2 license
-multi_base_09.dfdl.xsd
-
-# scaladoc related, has no way to include a license
-root-doc.txt
-
-# Test input/output files that cannot include extraneous license text.
-# Note that Apache Rat only matches file names, not full paths. So below this
-# are the base names of all of these paths to exlucde them
-#
-# daffodil-cli/src/test/resources/org/apache/daffodil/CLI/debugger/1326
-# daffodil-cli/src/test/resources/org/apache/daffodil/CLI/debugger/1328
-# daffodil-cli/src/test/resources/org/apache/daffodil/CLI/debugger/1329
-# daffodil-cli/src/test/resources/org/apache/daffodil/CLI/debugger/1330
-# daffodil-cli/src/test/resources/org/apache/daffodil/CLI/debugger/1331
-# daffodil-cli/src/test/resources/org/apache/daffodil/CLI/debugger/1333
-# daffodil-cli/src/test/resources/org/apache/daffodil/CLI/debugger/1334
-# daffodil-cli/src/test/resources/org/apache/daffodil/CLI/debugger/1337
-# daffodil-cli/src/test/resources/org/apache/daffodil/CLI/debugger/1338
-# daffodil-cli/src/test/resources/org/apache/daffodil/CLI/debugger/1339
-# daffodil-cli/src/test/resources/org/apache/daffodil/CLI/debugger/1340
-# daffodil-cli/src/test/resources/org/apache/daffodil/CLI/debugger/1382
-# daffodil-cli/src/test/resources/org/apache/daffodil/CLI/debugger/1591
-# daffodil-cli/src/test/resources/org/apache/daffodil/CLI/debugger/1602
-# daffodil-cli/src/test/resources/org/apache/daffodil/CLI/debugger/1863
-# daffodil-cli/src/test/resources/org/apache/daffodil/CLI/debugger/982
-# daffodil-cli/src/test/resources/org/apache/daffodil/CLI/input/input1.txt
-# daffodil-cli/src/test/resources/org/apache/daffodil/CLI/input/input10.txt
-# daffodil-cli/src/test/resources/org/apache/daffodil/CLI/input/input11.txt
-# daffodil-cli/src/test/resources/org/apache/daffodil/CLI/input/input12.txt
-# daffodil-cli/src/test/resources/org/apache/daffodil/CLI/input/input13.txt
-# daffodil-cli/src/test/resources/org/apache/daffodil/CLI/input/input14.txt
-# daffodil-cli/src/test/resources/org/apache/daffodil/CLI/input/input15.txt
-# daffodil-cli/src/test/resources/org/apache/daffodil/CLI/input/input16.txt
-# daffodil-cli/src/test/resources/org/apache/daffodil/CLI/input/input18.txt
-# daffodil-cli/src/test/resources/org/apache/daffodil/CLI/input/input2.txt
-# daffodil-cli/src/test/resources/org/apache/daffodil/CLI/input/input3.txt
-# daffodil-cli/src/test/resources/org/apache/daffodil/CLI/input/input4.txt
-# daffodil-cli/src/test/resources/org/apache/daffodil/CLI/input/input5.txt
-# daffodil-cli/src/test/resources/org/apache/daffodil/CLI/input/input6.txt
-# daffodil-cli/src/test/resources/org/apache/daffodil/CLI/input/input7.txt
-# daffodil-cli/src/test/resources/org/apache/daffodil/CLI/input/input8.txt
-# daffodil-cli/src/test/resources/org/apache/daffodil/CLI/input/input9.txt
-# daffodil-cli/src/test/resources/org/apache/daffodil/CLI/input/inputBig1M.txt
-# daffodil-cli/src/test/resources/org/apache/daffodil/CLI/input/test_DFDL-714.txt
-# daffodil-cli/src/test/resources/org/apache/daffodil/CLI/output/output1.txt
-# daffodil-cli/src/test/resources/org/apache/daffodil/CLI/output/output10.txt
-# daffodil-cli/src/test/resources/org/apache/daffodil/CLI/output/output11.txt
-# daffodil-cli/src/test/resources/org/apache/daffodil/CLI/output/output12.txt
-# daffodil-cli/src/test/resources/org/apache/daffodil/CLI/output/output13.txt
-# daffodil-cli/src/test/resources/org/apache/daffodil/CLI/output/output14.txt
-# daffodil-cli/src/test/resources/org/apache/daffodil/CLI/output/output15.txt
-# daffodil-cli/src/test/resources/org/apache/daffodil/CLI/output/output16.txt
-# daffodil-cli/src/test/resources/org/apache/daffodil/CLI/output/output1_nopretty.txt
-# daffodil-cli/src/test/resources/org/apache/daffodil/CLI/output/output2.txt
-# daffodil-cli/src/test/resources/org/apache/daffodil/CLI/output/output3.txt
-# daffodil-cli/src/test/resources/org/apache/daffodil/CLI/output/output4.txt
-# daffodil-cli/src/test/resources/org/apache/daffodil/CLI/output/output5.txt
-# daffodil-cli/src/test/resources/org/apache/daffodil/CLI/output/output6.txt
-# daffodil-cli/src/test/resources/org/apache/daffodil/CLI/output/output8.txt
-# daffodil-cli/src/test/resources/org/apache/daffodil/CLI/output/output9.txt
-# daffodil-cli/src/test/resources/org/apache/daffodil/CLI/output/output_DFDL-714.txt
-# daffodil-cli/src/test/resources/org/apache/daffodil/CLI/output/unqualified_path_step_01.txt
-# daffodil-cli/src/test/resources/org/apache/daffodil/CLI/output/unqualified_path_step_02.txt
-# daffodil-cli/src/test/resources/org/apache/daffodil/CLI/output/unqualified_path_step_03.txt
-# daffodil-cli/src/test/resources/org/apache/daffodil/CLI/output/unqualified_path_step_04.txt
-# daffodil-core/src/test/resources/test/AB007.in
-# daffodil-core/src/test/resources/test/AB008.in
-# daffodil-core/src/test/resources/test/AB009-small.in
-# daffodil-core/src/test/resources/test/AB009.in
-# daffodil-core/src/test/resources/test/AB010.in
-# daffodil-core/src/test/resources/test/AB011.in
-# daffodil-japi/src/test/resources/test/japi/01very_simple.txt
-# daffodil-japi/src/test/resources/test/japi/myInfosetBroken.xml
-# daffodil-sapi/src/test/resources/test/sapi/01very_simple.txt
-# daffodil-sapi/src/test/resources/test/sapi/myInfosetBroken.xml
-# daffodil-tdml/src/test/resources/test/tdml/test.txt
-# daffodil-tdml/src/test/resources/test/tdml/test.xml
-# daffodil-test/src/test/resources/org/apache/daffodil/section00/general/ext_file.txt
-# daffodil-test/src/test/resources/org/apache/daffodil/section00/general/ext_file2.txt
-# daffodil-test/src/test/resources/org/apache/daffodil/section06/entities/02nine_headers.txt
-# daffodil-test/src/test/resources/org/apache/daffodil/section10/representation_properties/littleEndianBit
-# daffodil-test/src/test/resources/org/apache/daffodil/usertests/test_prefix_separator_as_variable
-# daffodil-test-ibm1/src/test/resources/test-suite/tresys-contributed/AB006.in
-# daffodil-test-ibm1/src/test/resources/test-suite/tresys-contributed/AB007.in
-# daffodil-test-ibm1/src/test/resources/test-suite/tresys-contributed/AB008.in
-# daffodil-test-ibm1/src/test/resources/test-suite/tresys-contributed/AB009.in
-# test-stdLayout/src/test/resources/org1/test-outer-data1.txt
-# test-stdLayout/src/test/resources/org2/test-data1.txt
-# daffodil-cli/src/test/resources/org/apache/daffodil/CLI/input/hextest.txt
-# daffodil-io/src/test/resources/iso8859.doc.dat
-# daffodil-japi/src/test/resources/test/japi/myData.dat
-# daffodil-japi/src/test/resources/test/japi/myData16.dat
-# daffodil-japi/src/test/resources/test/japi/myData2.dat
-# daffodil-japi/src/test/resources/test/japi/myData3.dat
-# daffodil-japi/src/test/resources/test/japi/myData4.dat
-# daffodil-japi/src/test/resources/test/japi/myData5.dat
-# daffodil-japi/src/test/resources/test/japi/myDataBroken.dat
-# daffodil-sapi/src/test/resources/test/sapi/myData.dat
-# daffodil-sapi/src/test/resources/test/sapi/myData16.dat
-# daffodil-sapi/src/test/resources/test/sapi/myData2.dat
-# daffodil-sapi/src/test/resources/test/sapi/myData3.dat
-# daffodil-sapi/src/test/resources/test/sapi/myData4.dat
-# daffodil-sapi/src/test/resources/test/sapi/myData5.dat
-# daffodil-sapi/src/test/resources/test/sapi/myDataBroken.dat
-# daffodil-tdml/src/test/resources/test/tdml/test.bin
-# daffodil-test/src/test/resources/org/apache/daffodil/section06/namespaces/path-qnames/a_doc.xml
-# daffodil-test/src/test/resources/org/apache/daffodil/section10/representation_properties/encodingError
-# daffodil-test/src/test/resources/test space/A BTinyData.tdml.dat
-# daffodil-test-ibm1/src/test/resources/test-suite/tresys-contributed/ABLargeData.tdml.dat
-01very_simple.txt
-02nine_headers.txt
-1326
-1328
-1329
-1330
-1331
-1333
-1334
-1337
-1338
-1339
-1340
-1382
-1591
-1602
-1863
-982
-AB006.in
-AB007.in
-AB008.in
-AB009.in
-AB009-small.in
-AB010.in
-AB011.in
-ABLargeData.tdml.dat
-A BTinyData.tdml.dat
-a_doc.xml
-encodingError
-ext_file2.txt
-ext_file.txt
-hextest.txt
-input10.txt
-input11.txt
-input12.txt
-input13.txt
-input14.txt
-input15.txt
-input16.txt
-input18.txt
-input1.txt
-input2.txt
-input3.txt
-input4.txt
-input5.txt
-input6.txt
-input7.txt
-input8.txt
-input9.txt
-inputBig1M.txt
-iso8859.doc.dat
-littleEndianBit
-myData16.dat
-myData2.dat
-myData3.dat
-myData4.dat
-myData5.dat
-myDataBroken.dat
-myData.dat
-myInfosetBroken.xml
-output10.txt
-output11.txt
-output12.txt
-output13.txt
-output14.txt
-output15.txt
-output16.txt
-output1_nopretty.txt
-output1.txt
-output2.txt
-output3.txt
-output4.txt
-output5.txt
-output6.txt
-output8.txt
-output9.txt
-output_DFDL-714.txt
-test.bin
-test-data1.txt
-test_DFDL-714.txt
-test-outer-data1.txt
-test_prefix_separator_as_variable
-test.txt
-test.xml
-unqualified_path_step_01.txt
-unqualified_path_step_02.txt
-unqualified_path_step_03.txt
-unqualified_path_step_04.txt
diff --git a/.travis.yml b/.travis.yml
index 08b3ece4a..5f6a1f686 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -39,3 +39,4 @@ script:
     daffodil-cli/rpm:packageBin
     daffodil-japi/genjavadoc:doc
     daffodil-sapi/doc
+    ratCheck
diff --git a/README.md b/README.md
index 5469fc0bf..3e5b33fc3 100644
--- a/README.md
+++ b/README.md
@@ -53,6 +53,14 @@ $ sbt daffodil-cli/stage
 
 The above will create Linux and Windows shell scripts in `daffodil-cli/target/universal/stage/bin/`. See the [Command Line Interface](https://daffodil.apache.org/cli/) documentation for details on its usage.
 
+To run the Apache RAT checks:
+
+```bash
+$ sbt ratCheck
+```
+
+This will generate a RAT report in ``target/rat.txt`` and will error if any unapproved licenses are found.
+
 ### Debugging CLI Tests in Eclipse
 
 The CLI tests in daffodil-cli execute a daffodil script to perform tests.
diff --git a/build.sbt b/build.sbt
index b2d88bb77..06cacdac2 100644
--- a/build.sbt
+++ b/build.sbt
@@ -25,7 +25,7 @@ lazy val IntegrationTestDebug = config("debugIt") extend(Test)
 
 lazy val daffodil         = Project("daffodil", file(".")).configs(IntegrationTest, TestDebug, IntegrationTestDebug)
                               .aggregate(macroLib, propgen, lib, io, runtime1, runtime1Unparser, core, japi, sapi, tdml, cli, test, testIBM1, tutorials, testStdLayout)
-                              .settings(commonSettings, nopublish)
+                              .settings(commonSettings, nopublish, ratSettings)
 
 lazy val macroLib         = Project("daffodil-macro-lib", file("daffodil-macro-lib")).configs(IntegrationTest, TestDebug, IntegrationTestDebug)
                               .settings(commonSettings, nopublish)
@@ -221,3 +221,18 @@ lazy val libManagedSettings = Seq(
   sourceGenerators in Compile += (genProps in Compile).taskValue,
   resourceGenerators in Compile += (genSchemas in Compile).taskValue
 )
+
+lazy val ratSettings = Seq(
+  ratLicenses := Seq(
+    ("BSD2 ", Rat.BSD2_LICENSE_NAME, Rat.LICENSE_TEXT_PASSERA),
+    ("BSD3 ", Rat.BSD3_LICENSE_NAME, Rat.LICENSE_TEXT_SCALA)
+  ),
+
+  ratLicenseFamilies := Seq(
+    Rat.BSD3_LICENSE_NAME,
+    Rat.BSD2_LICENSE_NAME
+  ),
+
+  ratExcludes := Rat.excludes
+)
+
diff --git a/daffodil-cli/LICENSE-bin b/daffodil-cli/bin.LICENSE
similarity index 100%
rename from daffodil-cli/LICENSE-bin
rename to daffodil-cli/bin.LICENSE
diff --git a/daffodil-cli/NOTICE-bin b/daffodil-cli/bin.NOTICE
similarity index 100%
rename from daffodil-cli/NOTICE-bin
rename to daffodil-cli/bin.NOTICE
diff --git a/daffodil-cli/build.sbt b/daffodil-cli/build.sbt
index 57b961eef..b03b60e7d 100644
--- a/daffodil-cli/build.sbt
+++ b/daffodil-cli/build.sbt
@@ -32,8 +32,8 @@ packageName in Linux := executableScriptName.value
 packageName in Rpm := "apache-" + executableScriptName.value
 
 mappings in Universal ++= Seq(
-  baseDirectory.value / "LICENSE-bin" -> "LICENSE",
-  baseDirectory.value / "NOTICE-bin" -> "NOTICE",
+  baseDirectory.value / "bin.LICENSE" -> "LICENSE",
+  baseDirectory.value / "bin.NOTICE" -> "NOTICE",
   baseDirectory.value / ".." / "DISCLAIMER" -> "DISCLAIMER",
   baseDirectory.value / "README.md" -> "README.md",
 )
diff --git a/daffodil-lib/src/main/resources/org/apache/daffodil/xsd/XMLSchema.dtd b/daffodil-lib/src/main/resources/org/apache/daffodil/xsd/XMLSchema.dtd
index 7b22dd276..7c01f845e 100644
--- a/daffodil-lib/src/main/resources/org/apache/daffodil/xsd/XMLSchema.dtd
+++ b/daffodil-lib/src/main/resources/org/apache/daffodil/xsd/XMLSchema.dtd
@@ -6,7 +6,7 @@
   useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
-  [1] http://www.w3.org/Consortium/Legal/copyright-software
+  [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
 -->
 
 <!-- DTD for XML Schemas: Part 1: Structures
diff --git a/daffodil-lib/src/main/resources/org/apache/daffodil/xsd/XMLSchema.xsd b/daffodil-lib/src/main/resources/org/apache/daffodil/xsd/XMLSchema.xsd
index 284a03631..ab00a7f07 100644
--- a/daffodil-lib/src/main/resources/org/apache/daffodil/xsd/XMLSchema.xsd
+++ b/daffodil-lib/src/main/resources/org/apache/daffodil/xsd/XMLSchema.xsd
@@ -7,7 +7,7 @@
   useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
-  [1] http://www.w3.org/Consortium/Legal/copyright-software
+  [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
 -->
 
 <!-- XML Schema schema for XML Schemas: Part 1: Structures -->
diff --git a/daffodil-lib/src/main/resources/org/apache/daffodil/xsd/XMLSchema_for_DFDL.xsd b/daffodil-lib/src/main/resources/org/apache/daffodil/xsd/XMLSchema_for_DFDL.xsd
index aa75bc159..39988dedf 100644
--- a/daffodil-lib/src/main/resources/org/apache/daffodil/xsd/XMLSchema_for_DFDL.xsd
+++ b/daffodil-lib/src/main/resources/org/apache/daffodil/xsd/XMLSchema_for_DFDL.xsd
@@ -7,7 +7,7 @@
   useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
-  [1] http://www.w3.org/Consortium/Legal/copyright-software
+  [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
 -->
 
 <!-- 
diff --git a/daffodil-lib/src/main/resources/org/apache/daffodil/xsd/datatypes.dtd b/daffodil-lib/src/main/resources/org/apache/daffodil/xsd/datatypes.dtd
index 7e7d3df5d..536edd21c 100644
--- a/daffodil-lib/src/main/resources/org/apache/daffodil/xsd/datatypes.dtd
+++ b/daffodil-lib/src/main/resources/org/apache/daffodil/xsd/datatypes.dtd
@@ -6,7 +6,7 @@
   useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
-  [1] http://www.w3.org/Consortium/Legal/copyright-software
+  [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
 -->
 
 <!--
diff --git a/daffodil-lib/src/main/resources/org/apache/daffodil/xsd/xml.xsd b/daffodil-lib/src/main/resources/org/apache/daffodil/xsd/xml.xsd
index 696fdc4c8..fd6d5aaf4 100644
--- a/daffodil-lib/src/main/resources/org/apache/daffodil/xsd/xml.xsd
+++ b/daffodil-lib/src/main/resources/org/apache/daffodil/xsd/xml.xsd
@@ -7,7 +7,7 @@
   useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
-  [1] http://www.w3.org/Consortium/Legal/copyright-software
+  [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
 -->
 
 <xs:schema targetNamespace="http://www.w3.org/XML/1998/namespace"
diff --git a/daffodil-test/.gitignore b/daffodil-test/.gitignore
deleted file mode 100644
index 1123bdb06..000000000
--- a/daffodil-test/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-testData_OnClassPath/*
diff --git a/daffodil-test/src/test/scala/org/apache/daffodil/xml/test/unit/TestDaffodilXMLLoader.scala b/daffodil-test/src/test/scala/org/apache/daffodil/xml/test/unit/TestDaffodilXMLLoader.scala
index 0406eec2b..b7c4750ce 100644
--- a/daffodil-test/src/test/scala/org/apache/daffodil/xml/test/unit/TestDaffodilXMLLoader.scala
+++ b/daffodil-test/src/test/scala/org/apache/daffodil/xml/test/unit/TestDaffodilXMLLoader.scala
@@ -256,7 +256,7 @@ abstract class CatalogTestBase {
   System.err.println("cd = " + cdpath)
   val testCPDirPath =
     if (cdpath.endsWith("daffodil-test/.")) "testData_OnClassPath"
-    else if (cdpath.endsWith("daffodil/.")) "daffodil-test/testData_OnClassPath"
+    else if ((new File(cdpath, "daffodil-test" )).isDirectory) "daffodil-test/testData_OnClassPath"
     else {
       System.err.println("Can't run catalog tests because we are not in a directory where they are runnable.")
       ""
@@ -313,7 +313,6 @@ catalogs=testData_OnClassPath/testCatalog.xml
       try {
         System.err.println("Creating test directory " + testCPDir.getAbsolutePath())
         testCPDir.mkdir()
-        testCPDir.deleteOnExit()
       } catch {
         case e: SecurityException => {
           System.err.println("Required test directory does not exist, and cannot be created.")
@@ -322,11 +321,6 @@ catalogs=testData_OnClassPath/testCatalog.xml
       }
     }
 
-    tmpSchemaFileName.deleteOnExit()
-    tmpDataFileName.deleteOnExit()
-    tmpCatalogFileName.deleteOnExit()
-    tmpCatalogManagerPropFile.deleteOnExit()
-
     using(new java.io.FileWriter(tmpSchemaFileName)) {
       fw =>
         fw.write(testSchema.toString())
@@ -344,37 +338,45 @@ catalogs=testData_OnClassPath/testCatalog.xml
         fw.write(testData.toString())
     }
 
-    // At this point, these files should be on the classpath.
-    // Let's make sure by trying to retrieve one as a resource.
-    Misc.getResourceOption("/CatalogManager.properties") match {
-      case (Some(res), path) => // ok. It exists.
-      case (None, path) => {
-        System.err.println("Unable to get required resource: " + path + " from the classpath.")
-        return false
+    try {
+      // At this point, these files should be on the classpath.
+      // Let's make sure by trying to retrieve one as a resource.
+      Misc.getResourceOption("/CatalogManager.properties") match {
+        case (Some(res), path) => // ok. It exists.
+        case (None, path) => {
+          System.err.println("Unable to get required resource: " + path + " from the classpath.")
+          return false
+        }
       }
-    }
-
-    val loader = new DaffodilXMLLoader(new org.xml.sax.ErrorHandler {
 
-      def warning(exception: SAXParseException) = {
-        exceptionList = exception :: exceptionList
-        System.err.println("Warning " + exception.getMessage())
-      }
+      val loader = new DaffodilXMLLoader(new org.xml.sax.ErrorHandler {
 
-      def error(exception: SAXParseException) = {
-        exceptionList = exception :: exceptionList
-        System.err.println("Error: " + exception.getMessage())
-      }
-      def fatalError(exception: SAXParseException) = {
-        exceptionList = exception :: exceptionList
-        System.err.println("Fatal: " + exception.getMessage())
-      }
-    })
+        def warning(exception: SAXParseException) = {
+          exceptionList = exception :: exceptionList
+          System.err.println("Warning " + exception.getMessage())
+        }
 
-    val src = new URISchemaSource(tmpDataFileName.toURI)
-    // val elem = 
-      loader.load(src) // that should validate it.
-    // println(elem)
-    true // returned to indicate that things worked
+        def error(exception: SAXParseException) = {
+          exceptionList = exception :: exceptionList
+          System.err.println("Error: " + exception.getMessage())
+        }
+        def fatalError(exception: SAXParseException) = {
+          exceptionList = exception :: exceptionList
+          System.err.println("Fatal: " + exception.getMessage())
+        }
+      })
+
+      val src = new URISchemaSource(tmpDataFileName.toURI)
+      // val elem = 
+        loader.load(src) // that should validate it.
+      // println(elem)
+      true // returned to indicate that things worked
+    } finally {
+      tmpSchemaFileName.delete()
+      tmpDataFileName.delete()
+      tmpCatalogFileName.delete()
+      tmpCatalogManagerPropFile.delete()
+      testCPDir.delete()
+    }
   }
 }
diff --git a/daffodil-test/testData_OnClassPath/.keep b/daffodil-test/testData_OnClassPath/.keep
deleted file mode 100644
index e69de29bb..000000000
diff --git a/eclipse-projects/core-test/.gitignore b/eclipse-projects/core-test/.gitignore
deleted file mode 100644
index 7a30b312e..000000000
--- a/eclipse-projects/core-test/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/.cache-tests
diff --git a/project/Rat.scala b/project/Rat.scala
new file mode 100644
index 000000000..888517ecc
--- /dev/null
+++ b/project/Rat.scala
@@ -0,0 +1,200 @@
+/*
+ * 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.
+ */
+
+import sbt._
+
+object Rat {
+
+  lazy val excludes = Seq(
+    file(".git"),
+    file(".gitignore"),
+    file(".keep"),
+
+    // eclispe related files
+    file(".classpath"),
+    file(".project"),
+    file(".jupiter"),
+    file(".ensime"),
+
+    // scaladoc related, has no way to include a license
+    file("daffodil-sapi/root-doc.txt"),
+
+    // UTF-16BE, Apache Rat thinks it is a binary and cannot tell it includes the Apache v2 license
+    file("daffodil-test/src/test/resources/org/apache/daffodil/section06/namespaces/multi_base_09.dfdl.xsd"),
+
+    // test files that cannot include the Apache license without breaking tests
+    file("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/debugger/1326"),
+    file("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/debugger/1328"),
+    file("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/debugger/1329"),
+    file("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/debugger/1330"),
+    file("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/debugger/1331"),
+    file("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/debugger/1333"),
+    file("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/debugger/1334"),
+    file("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/debugger/1337"),
+    file("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/debugger/1338"),
+    file("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/debugger/1339"),
+    file("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/debugger/1340"),
+    file("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/debugger/1382"),
+    file("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/debugger/1591"),
+    file("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/debugger/1602"),
+    file("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/debugger/1863"),
+    file("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/debugger/982"),
+    file("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/input/hextest.txt"),
+    file("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/input/input10.txt"),
+    file("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/input/input11.txt"),
+    file("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/input/input12.txt"),
+    file("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/input/input13.txt"),
+    file("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/input/input14.txt"),
+    file("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/input/input15.txt"),
+    file("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/input/input16.txt"),
+    file("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/input/input18.txt"),
+    file("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/input/input1.txt"),
+    file("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/input/input2.txt"),
+    file("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/input/input3.txt"),
+    file("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/input/input4.txt"),
+    file("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/input/input5.txt"),
+    file("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/input/input6.txt"),
+    file("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/input/input7.txt"),
+    file("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/input/input8.txt"),
+    file("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/input/input9.txt"),
+    file("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/input/inputBig1M.txt"),
+    file("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/input/test_DFDL-714.txt"),
+    file("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/output/output10.txt"),
+    file("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/output/output11.txt"),
+    file("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/output/output12.txt"),
+    file("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/output/output13.txt"),
+    file("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/output/output14.txt"),
+    file("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/output/output15.txt"),
+    file("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/output/output16.txt"),
+    file("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/output/output1_nopretty.txt"),
+    file("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/output/output1.txt"),
+    file("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/output/output2.txt"),
+    file("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/output/output3.txt"),
+    file("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/output/output4.txt"),
+    file("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/output/output5.txt"),
+    file("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/output/output6.txt"),
+    file("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/output/output8.txt"),
+    file("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/output/output9.txt"),
+    file("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/output/output_DFDL-714.txt"),
+    file("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/output/unqualified_path_step_01.txt"),
+    file("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/output/unqualified_path_step_02.txt"),
+    file("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/output/unqualified_path_step_03.txt"),
+    file("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/output/unqualified_path_step_04.txt"),
+    file("daffodil-core/src/test/resources/test/AB007.in"),
+    file("daffodil-core/src/test/resources/test/AB008.in"),
+    file("daffodil-core/src/test/resources/test/AB009.in"),
+    file("daffodil-core/src/test/resources/test/AB009-small.in"),
+    file("daffodil-core/src/test/resources/test/AB010.in"),
+    file("daffodil-core/src/test/resources/test/AB011.in"),
+    file("daffodil-io/src/test/resources/iso8859.doc.dat"),
+    file("daffodil-japi/src/test/resources/test/japi/01very_simple.txt"),
+    file("daffodil-japi/src/test/resources/test/japi/myData16.dat"),
+    file("daffodil-japi/src/test/resources/test/japi/myData2.dat"),
+    file("daffodil-japi/src/test/resources/test/japi/myData3.dat"),
+    file("daffodil-japi/src/test/resources/test/japi/myData4.dat"),
+    file("daffodil-japi/src/test/resources/test/japi/myData5.dat"),
+    file("daffodil-japi/src/test/resources/test/japi/myDataBroken.dat"),
+    file("daffodil-japi/src/test/resources/test/japi/myData.dat"),
+    file("daffodil-japi/src/test/resources/test/japi/myInfosetBroken.xml"),
+    file("daffodil-sapi/src/test/resources/test/sapi/01very_simple.txt"),
+    file("daffodil-sapi/src/test/resources/test/sapi/myData16.dat"),
+    file("daffodil-sapi/src/test/resources/test/sapi/myData2.dat"),
+    file("daffodil-sapi/src/test/resources/test/sapi/myData3.dat"),
+    file("daffodil-sapi/src/test/resources/test/sapi/myData4.dat"),
+    file("daffodil-sapi/src/test/resources/test/sapi/myData5.dat"),
+    file("daffodil-sapi/src/test/resources/test/sapi/myDataBroken.dat"),
+    file("daffodil-sapi/src/test/resources/test/sapi/myData.dat"),
+    file("daffodil-sapi/src/test/resources/test/sapi/myInfosetBroken.xml"),
+    file("daffodil-tdml/src/test/resources/test/tdml/test.bin"),
+    file("daffodil-tdml/src/test/resources/test/tdml/test.txt"),
+    file("daffodil-tdml/src/test/resources/test/tdml/test.xml"),
+    file("daffodil-test-ibm1/src/test/resources/test-suite/tresys-contributed/AB006.in"),
+    file("daffodil-test-ibm1/src/test/resources/test-suite/tresys-contributed/AB007.in"),
+    file("daffodil-test-ibm1/src/test/resources/test-suite/tresys-contributed/AB008.in"),
+    file("daffodil-test-ibm1/src/test/resources/test-suite/tresys-contributed/AB009.in"),
+    file("daffodil-test-ibm1/src/test/resources/test-suite/tresys-contributed/ABLargeData.tdml.dat"),
+    file("daffodil-test/src/test/resources/org/apache/daffodil/section00/general/ext_file2.txt"),
+    file("daffodil-test/src/test/resources/org/apache/daffodil/section00/general/ext_file.txt"),
+    file("daffodil-test/src/test/resources/org/apache/daffodil/section06/entities/02nine_headers.txt"),
+    file("daffodil-test/src/test/resources/org/apache/daffodil/section06/namespaces/path-qnames/a_doc.xml"),
+    file("daffodil-test/src/test/resources/org/apache/daffodil/section10/representation_properties/encodingError"),
+    file("daffodil-test/src/test/resources/org/apache/daffodil/section10/representation_properties/littleEndianBit"),
+    file("daffodil-test/src/test/resources/org/apache/daffodil/usertests/test_prefix_separator_as_variable"),
+    file("daffodil-test/src/test/resources/test space/A BTinyData.tdml.dat"),
+    file("test-stdLayout/src/test/resources/org1/test-outer-data1.txt"),
+    file("test-stdLayout/src/test/resources/org2/test-data1.txt"),
+  )
+
+  lazy val BSD2_LICENSE_NAME = "BSD 2-Clause License"
+  lazy val BSD3_LICENSE_NAME = "BSD 3-Clause License"
+
+  lazy val LICENSE_TEXT_PASSERA =
+"""
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+Redistributions of source code must retain the above copyright notice,
+this list of conditions and the following disclaimer.
+
+Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+"""
+
+  lazy val LICENSE_TEXT_SCALA =
+"""
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice,
+  this list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright notice,
+  this list of conditions and the following disclaimer in the documentation
+  and/or other materials provided with the distribution.
+
+* Neither the name of the EPFL nor the names of its contributors may be
+  used to endorse or promote products derived from this software without
+  specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS”
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+"""
+
+}
diff --git a/project/plugins.sbt b/project/plugins.sbt
index 97134e979..e13bab840 100644
--- a/project/plugins.sbt
+++ b/project/plugins.sbt
@@ -17,6 +17,8 @@
 
 addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.2.2")
 
+addSbtPlugin("org.musigma" % "sbt-rat" % "0.6.0")
+
 // Both sbt and the sbt-native-pacakger plugin have transitive dependencies to
 // different versions of plexus-utils and guava, but with different major
 // version numbers. SBT interprets this major version number difference as


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services