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

claude pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/creadur-rat.git


The following commit(s) were added to refs/heads/master by this push:
     new 4f9c6fb9 RAT-98: Updated tests for gitignore changes & deprecated 
options (#417)
4f9c6fb9 is described below

commit 4f9c6fb9d5763bd0baf5ad55d9b87474ae99dbd3
Author: Claude Warren <[email protected]>
AuthorDate: Thu Feb 13 17:07:57 2025 +0100

    RAT-98: Updated tests for gitignore changes & deprecated options (#417)
    
    * added working directory
    
    * removed accidentally added invoker.properties files
    
    * adoped changes from master
    
    * updated from master
    
    * refactored DocumentName
    
    * Update changes.xml
    
    Added changelog entry
    
    ---------
    
    Co-authored-by: P. Ottlinger <[email protected]>
---
 .../RAT_335/{ignore.txt => commandLine.txt}        |   2 -
 .../it/resources/ReportTest/RAT_335/src/.gitignore |   7 ++
 .../ReportTest/RAT_335/src/dir1/.gitignore         |   3 +
 .../resources/ReportTest/RAT_335/src/dir1/dir1.txt |   1 +
 .../ReportTest/RAT_335/src/dir1/file1.log          |   1 +
 .../resources/ReportTest/RAT_335/src/dir2/dir2.md  |   1 +
 .../resources/ReportTest/RAT_335/src/dir3/dir3.log |   1 +
 .../ReportTest/RAT_335/src/invoker.properties      |  16 ----
 .../it/resources/ReportTest/RAT_335/src/root.md    |   1 +
 .../it/resources/ReportTest/RAT_335/verify.groovy  |  59 +-----------
 .../java/org/apache/rat/document/DocumentName.java |   2 +-
 .../markdown/development/write_file_processor.md   |   2 +-
 apache-rat-plugin/.gitignore                       |   1 +
 apache-rat-plugin/pom.xml                          |  14 ++-
 .../src/it/CustomLicense/.rat/customConfig.xml     |  17 ++++
 apache-rat-plugin/src/it/CustomLicense/pom.xml     |  28 +-----
 apache-rat-plugin/src/it/RAT-268/pom.xml           |  10 +-
 .../java/org/apache/rat/mp/RatCheckMojoTest.java   |   4 -
 .../src/test/resources/unit/RAT-107/.classpath     |   1 +
 .../src/test/resources/unit/RAT-107/.project       |   1 +
 .../test/resources/unit/RAT-107/.settings/dummy    |   0
 .../src/test/resources/unit/RAT-107/dummy.ipr      |   1 +
 .../resources/unit/RAT-107/submodule/.classpath    |   1 +
 .../test/resources/unit/RAT-107/submodule/.project |   1 +
 .../unit/RAT-107/submodule/.settings/dummy         |   0
 .../resources/unit/RAT-107/submodule/dummy.iml     |   1 +
 .../resources/unit/RAT-107/submodule/dummy.ipr     |   1 +
 .../resources/unit/RAT-107/submodule/dummy.iws     |   1 +
 .../src/test/resources/unit/RAT-335/.gitignore     |   7 ++
 .../test/resources/unit/RAT-335/dir1/.gitignore    |   3 +
 .../src/test/resources/unit/RAT-335/dir1/dir1.txt  |   1 +
 .../src/test/resources/unit/RAT-335/dir1/file1.log |   1 +
 .../src/test/resources/unit/RAT-335/dir2/dir2.md   |   1 +
 .../src/test/resources/unit/RAT-335/dir3/dir3.log  |   1 +
 .../test/resources/unit/RAT-335/invoker.properties |  16 ----
 .../src/test/resources/unit/RAT-335/root.md        |   1 +
 .../src/test/resources/unit/RAT-362/.gitignore     |   2 +
 .../src/test/resources/unit/RAT-362/foo.md         |   1 +
 .../test/resources/unit/RAT-362/invoker.properties |  16 ----
 .../src/test/resources/unit/it5/.bzrignore         |   5 -
 .../test/resources/unit/it5/.rat/customConfig.xml  |  23 +++++
 .../src/test/resources/unit/it5/pom.xml            | 104 +++++----------------
 .../main/java/nl/basjes/something/Something.java   |  26 ++++++
 src/changes/changes.xml                            |   3 +
 44 files changed, 161 insertions(+), 228 deletions(-)

diff --git a/apache-rat-core/src/it/resources/ReportTest/RAT_335/ignore.txt 
b/apache-rat-core/src/it/resources/ReportTest/RAT_335/commandLine.txt
similarity index 63%
rename from apache-rat-core/src/it/resources/ReportTest/RAT_335/ignore.txt
rename to apache-rat-core/src/it/resources/ReportTest/RAT_335/commandLine.txt
index df056a6f..0a6cbd33 100644
--- a/apache-rat-core/src/it/resources/ReportTest/RAT_335/ignore.txt
+++ b/apache-rat-core/src/it/resources/ReportTest/RAT_335/commandLine.txt
@@ -1,7 +1,5 @@
 --output-style
 xml
---input-exclude
-**/.gitignore
 --input-exclude-parsed-scm
 GIT
 --
diff --git a/apache-rat-core/src/it/resources/ReportTest/RAT_335/src/.gitignore 
b/apache-rat-core/src/it/resources/ReportTest/RAT_335/src/.gitignore
new file mode 100644
index 00000000..8855fa80
--- /dev/null
+++ b/apache-rat-core/src/it/resources/ReportTest/RAT_335/src/.gitignore
@@ -0,0 +1,7 @@
+*.md
+
+# This makes it ignore dir3/dir3.log and dir3/file3.log
+*.log
+
+# This makes it "unignore" dir3/file3.log
+!file*.log
diff --git 
a/apache-rat-core/src/it/resources/ReportTest/RAT_335/src/dir1/.gitignore 
b/apache-rat-core/src/it/resources/ReportTest/RAT_335/src/dir1/.gitignore
new file mode 100644
index 00000000..26fd5c95
--- /dev/null
+++ b/apache-rat-core/src/it/resources/ReportTest/RAT_335/src/dir1/.gitignore
@@ -0,0 +1,3 @@
+*.txt
+!dir1.md
+file1.log
\ No newline at end of file
diff --git 
a/apache-rat-core/src/it/resources/ReportTest/RAT_335/src/dir1/dir1.txt 
b/apache-rat-core/src/it/resources/ReportTest/RAT_335/src/dir1/dir1.txt
new file mode 100644
index 00000000..a31cbc89
--- /dev/null
+++ b/apache-rat-core/src/it/resources/ReportTest/RAT_335/src/dir1/dir1.txt
@@ -0,0 +1 @@
+File without a valid license
diff --git 
a/apache-rat-core/src/it/resources/ReportTest/RAT_335/src/dir1/file1.log 
b/apache-rat-core/src/it/resources/ReportTest/RAT_335/src/dir1/file1.log
new file mode 100644
index 00000000..a31cbc89
--- /dev/null
+++ b/apache-rat-core/src/it/resources/ReportTest/RAT_335/src/dir1/file1.log
@@ -0,0 +1 @@
+File without a valid license
diff --git 
a/apache-rat-core/src/it/resources/ReportTest/RAT_335/src/dir2/dir2.md 
b/apache-rat-core/src/it/resources/ReportTest/RAT_335/src/dir2/dir2.md
new file mode 100644
index 00000000..a31cbc89
--- /dev/null
+++ b/apache-rat-core/src/it/resources/ReportTest/RAT_335/src/dir2/dir2.md
@@ -0,0 +1 @@
+File without a valid license
diff --git 
a/apache-rat-core/src/it/resources/ReportTest/RAT_335/src/dir3/dir3.log 
b/apache-rat-core/src/it/resources/ReportTest/RAT_335/src/dir3/dir3.log
new file mode 100644
index 00000000..a31cbc89
--- /dev/null
+++ b/apache-rat-core/src/it/resources/ReportTest/RAT_335/src/dir3/dir3.log
@@ -0,0 +1 @@
+File without a valid license
diff --git 
a/apache-rat-core/src/it/resources/ReportTest/RAT_335/src/invoker.properties 
b/apache-rat-core/src/it/resources/ReportTest/RAT_335/src/invoker.properties
deleted file mode 100644
index 6e8c3479..00000000
--- a/apache-rat-core/src/it/resources/ReportTest/RAT_335/src/invoker.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-# 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.
-
-invoker.goals = clean apache-rat:check
diff --git a/apache-rat-core/src/it/resources/ReportTest/RAT_335/src/root.md 
b/apache-rat-core/src/it/resources/ReportTest/RAT_335/src/root.md
new file mode 100644
index 00000000..a31cbc89
--- /dev/null
+++ b/apache-rat-core/src/it/resources/ReportTest/RAT_335/src/root.md
@@ -0,0 +1 @@
+File without a valid license
diff --git a/apache-rat-core/src/it/resources/ReportTest/RAT_335/verify.groovy 
b/apache-rat-core/src/it/resources/ReportTest/RAT_335/verify.groovy
index 8a3e0765..e3917fee 100644
--- a/apache-rat-core/src/it/resources/ReportTest/RAT_335/verify.groovy
+++ b/apache-rat-core/src/it/resources/ReportTest/RAT_335/verify.groovy
@@ -36,48 +36,11 @@ private static Map<String, String> mapOf(String... parts) {
 output = new File(args[0])
 content = output.text
 
-//Map<ClaimStatistic.Counter, String> data = new HashMap<>()
-//data.put(ClaimStatistic.Counter.APPROVED, "2")
-//data.put(ClaimStatistic.Counter.ARCHIVES, "0")
-//data.put(ClaimStatistic.Counter.BINARIES, "0")
-//data.put(ClaimStatistic.Counter.DOCUMENT_TYPES, "3")
-//data.put(ClaimStatistic.Counter.IGNORED, "6")
-//data.put(ClaimStatistic.Counter.LICENSE_CATEGORIES, "2")
-//data.put(ClaimStatistic.Counter.LICENSE_NAMES, "2")
-//data.put(ClaimStatistic.Counter.NOTICES, "1")
-//data.put(ClaimStatistic.Counter.STANDARDS, "6")
-//data.put(ClaimStatistic.Counter.UNAPPROVED, "4")
-//data.put(ClaimStatistic.Counter.UNKNOWN, "4")
-
 Document document = XmlUtils.toDom(new FileInputStream(args[0]))
 XPath xPath = XPathFactory.newInstance().newXPath()
 
-//for (ClaimStatistic.Counter counter : ClaimStatistic.Counter.values()) {
-//    String xpath = 
String.format("/rat-report/statistics/statistic[@name='%s']", 
counter.displayName())
-//    Map<String, String> map = mapOf("approval",
-//            counter == ClaimStatistic.Counter.UNAPPROVED ? "false" : "true",
-//            "count", data.get(counter),
-//            "description", counter.getDescription())
-//    XmlUtils.assertAttributes(document, xPath, xpath, map)
-//}
-
-//// license categories
-//XmlUtils.assertAttributes(document, xPath, 
"/rat-report/statistics/licenseCategory[@name='?????']",
-//        mapOf("count", "4" ))
-//
-//XmlUtils.assertAttributes(document, xPath, 
"/rat-report/statistics/licenseCategory[@name='AL   ']",
-//        mapOf("count", "2" ))
-//
-//// license names
-//XmlUtils.assertAttributes(document, xPath, 
"/rat-report/statistics/licenseName[@name='Apache License Version 2.0']",
-//        mapOf("count", "2" ))
-//
-//XmlUtils.assertAttributes(document, xPath, 
"/rat-report/statistics/licenseName[@name='Unknown license']",
-//        mapOf("count", "4" ))
-
 List<String> ignoredFiles = new ArrayList<>(Arrays.asList(
         "/dir1/dir1.txt",
-        "/dir1/file1.log",
         "/dir1/.gitignore",
         "/dir2/dir2.md",
         "/dir3/dir3.log",
@@ -102,24 +65,4 @@ XmlUtils.assertAttributes(document, xPath, 
"/rat-report/statistics/documentType[
         mapOf("count", "1" ))
 
 XmlUtils.assertAttributes(document, xPath, 
"/rat-report/statistics/documentType[@name='STANDARD']",
-        mapOf("count", "6" ))
-
-/*
-TextUtils.assertPatternInTarget("^  Approved:\\s+8 ", content)
-TextUtils.assertPatternInTarget("^  Archives:\\s+1 ", content)
-TextUtils.assertPatternInTarget("^  Binaries:\\s+2 ", content)
-TextUtils.assertPatternInTarget("^  Document types:\\s+5 ", content)
-TextUtils.assertPatternInTarget("^  Ignored:\\s+1 ", content)
-TextUtils.assertPatternInTarget("^  License categories:\\s+4 ", content)
-TextUtils.assertPatternInTarget("^  License names:\\s+5", content)
-TextUtils.assertPatternInTarget("^  Notices:\\s+2 ", content)
-TextUtils.assertPatternInTarget("^  Standards:\\s+8 ", content)
-TextUtils.assertPatternInTarget("^  Unapproved:\\s+2 ", content)
-TextUtils.assertPatternInTarget("^  Unknown:\\s+2 ", content)
-
-logOutput = new File(args[1])
-log = logOutput.text
-
-TextUtils.assertPatternNotInTarget("^ERROR:", log)
-TextUtils.assertPatternNotInTarget("^WARN:", log)
-*/
+        mapOf("count", "4" ))
diff --git 
a/apache-rat-core/src/main/java/org/apache/rat/document/DocumentName.java 
b/apache-rat-core/src/main/java/org/apache/rat/document/DocumentName.java
index 74a32671..5e41156a 100644
--- a/apache-rat-core/src/main/java/org/apache/rat/document/DocumentName.java
+++ b/apache-rat-core/src/main/java/org/apache/rat/document/DocumentName.java
@@ -94,7 +94,7 @@ public class DocumentName implements Comparable<DocumentName> 
{
     }
 
     /**
-     * Creates a builder from a File. The {@link #baseName} is set to the file 
name if it is a directory otherwise
+     * Creates a builder from a File.  The {@link #baseName} is set to the 
file name if it is a directory otherwise
      * it is set to the directory containing the file.
      * @param file The file to set defaults from.
      * @return the builder.
diff --git 
a/apache-rat-core/src/site/markdown/development/write_file_processor.md 
b/apache-rat-core/src/site/markdown/development/write_file_processor.md
index 77d843b7..11fb3e62 100644
--- a/apache-rat-core/src/site/markdown/development/write_file_processor.md
+++ b/apache-rat-core/src/site/markdown/development/write_file_processor.md
@@ -22,7 +22,7 @@
 >  * Rat [Exclude Expressions](../exclusion_expression.html): The expressions 
 > that are used to match file names
 
 
-A FileProcessor is a module that locates files with a specific name in the 
directory tree and reads from them file patterns that are translated into Rat 
exclude expressions. These files are normally found in the file directory tree 
and their restrictions normally only applies to files at the same directory 
level as the processed file or below.  This type of file is implemented by the 
`org.apache.rat.config.exclusion.fileProcessors.DescendingFileProcessor`.
+A FileProcessor is a module that locates files with a specific name in the 
directory tree and reads from them file patterns that are translated into Rat 
exclude expressions. These files are normally found in the file directory tree 
and their restrictions normally only applies to files at the same directory 
level as the processed file or below.  This type of file is implemented by the 
`org.apache.rat.config.exclusion.MatcherSet.Builder`.
 
 The `DescendingFileProcessor` takes a file name and one or more comment 
prefixes as in the constructor.  The file name is normally a file that is 
generally hidden on Linux systems like ".gitignore" or ".hgignore".  The 
`DescendingFileProcessor` will scan the directories looking for files with the 
specified name.  If one is found it is passed to the `process(DocumentName)` 
method which reads the document and returns a list of exclude expressions.
 
diff --git a/apache-rat-plugin/.gitignore b/apache-rat-plugin/.gitignore
index d302b51b..47d015ff 100644
--- a/apache-rat-plugin/.gitignore
+++ b/apache-rat-plugin/.gitignore
@@ -1,3 +1,4 @@
 /target/
+/invoker_target/
 /src/site/apt/argument_types.txt
 /invoker_target/
diff --git a/apache-rat-plugin/pom.xml b/apache-rat-plugin/pom.xml
index cabee5cc..9bd8a296 100644
--- a/apache-rat-plugin/pom.xml
+++ b/apache-rat-plugin/pom.xml
@@ -99,6 +99,7 @@
               <exclude>src/it/CustomLicense/src/**/</exclude>
               <!-- RAT-171: needs to be added since SCM ignores are only 
parsed in project root -->
               <exclude>**/.bzrignore</exclude>
+              <exlcude>invoker_target/**</exlcude>
               <exclude>src/test/resources/XmlOutputExamples/**/*</exclude>
             </excludes>
           </configuration>
@@ -246,7 +247,7 @@
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-invoker-plugin</artifactId>
         <configuration>
-          <cloneProjectsTo>${project.build.directory}/invoker</cloneProjectsTo>
+          <cloneProjectsTo>${project.basedir}/invoker_target</cloneProjectsTo>
           
<localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
           <addTestClassPath>true</addTestClassPath>
           <settingsFile>src/it/settings.xml</settingsFile>
@@ -262,6 +263,17 @@
           </execution>
         </executions>
       </plugin>
+      <plugin>
+        <artifactId>maven-clean-plugin</artifactId>
+        <configuration>
+          <filesets>
+            <fileset>
+              <directory>invoker_target</directory>
+              <followSymlinks>false</followSymlinks>
+            </fileset>
+          </filesets>
+        </configuration>
+      </plugin>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-checkstyle-plugin</artifactId>
diff --git a/apache-rat-plugin/src/it/CustomLicense/.rat/customConfig.xml 
b/apache-rat-plugin/src/it/CustomLicense/.rat/customConfig.xml
new file mode 100644
index 00000000..9f0ab7fb
--- /dev/null
+++ b/apache-rat-plugin/src/it/CustomLicense/.rat/customConfig.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<rat-config>
+    <families>
+        <family id="CC" name="Creative Commons"/>"
+    </families>
+    <licenses>
+        <license family="CC" id="CC-BY-NC-ND"
+                 name="Creative Commons 
Attribution-NonCommercial-NoDerivatives 4.0 International">
+            <any>
+                <text>Attribution-NonCommercial-NoDerivatives</text>
+            </any>
+        </license>
+    </licenses>
+    <approved>
+        <family license_ref='CC'/>
+    </approved>
+</rat-config>
diff --git a/apache-rat-plugin/src/it/CustomLicense/pom.xml 
b/apache-rat-plugin/src/it/CustomLicense/pom.xml
index 4a03c487..47487212 100644
--- a/apache-rat-plugin/src/it/CustomLicense/pom.xml
+++ b/apache-rat-plugin/src/it/CustomLicense/pom.xml
@@ -27,31 +27,13 @@
         <artifactId>apache-rat-plugin</artifactId>
         <version>@pom.version@</version>
         <configuration>
-          <addDefaultLicenses>false</addDefaultLicenses>
-          <families>
-            <family>
-              <id>CC</id>
-              <name>Creative Commons</name>
-            </family>
-          </families>
-          <licenses>
-            <license>
-              <family>CC</family>
-              <id>CC-BY-NC-ND</id>
-              <notes/>
-              <name>Creative Commons Attribution-NonCommercial-NoDerivatives 
4.0 International</name>
-              <any>
-                <text>Attribution-NonCommercial-NoDerivatives</text>
-              </any>
-            </license>
-          </licenses>
-          <approvedLicenses>
-            <approvedLicense>CC</approvedLicense>
-          </approvedLicenses>
-          <excludes>
+          <outputStyle>xml</outputStyle>
+          <config>.rat/customConfig.xml</config>
+          <inputExcludes>
+            <exclude>.rat/**</exclude>
             <exclude>pom.xml</exclude>
             <exclude>invoker.properties</exclude>
-          </excludes>
+          </inputExcludes>
         </configuration>
       </plugin>
     </plugins>
diff --git a/apache-rat-plugin/src/it/RAT-268/pom.xml 
b/apache-rat-plugin/src/it/RAT-268/pom.xml
index 2084bef0..9a42f6d0 100644
--- a/apache-rat-plugin/src/it/RAT-268/pom.xml
+++ b/apache-rat-plugin/src/it/RAT-268/pom.xml
@@ -33,12 +33,12 @@
         <artifactId>apache-rat-plugin</artifactId>
         <version>@pom.version@</version>
         <configuration>
-          <counter-mins>
-            <counter-min>STANDARDS:0</counter-min>
-          </counter-mins>
-          <excludes>
+          <counterMins>
+            <counter>STANDARDS:0</counter>
+          </counterMins>
+          <inputExcludes>
             <exclude>**/src.apt</exclude>
-          </excludes>
+          </inputExcludes>
         </configuration>
       </plugin>
     </plugins>
diff --git 
a/apache-rat-plugin/src/test/java/org/apache/rat/mp/RatCheckMojoTest.java 
b/apache-rat-plugin/src/test/java/org/apache/rat/mp/RatCheckMojoTest.java
index d9d5a302..533cdaff 100644
--- a/apache-rat-plugin/src/test/java/org/apache/rat/mp/RatCheckMojoTest.java
+++ b/apache-rat-plugin/src/test/java/org/apache/rat/mp/RatCheckMojoTest.java
@@ -50,7 +50,6 @@ import org.apache.rat.testhelpers.TextUtils;
 import org.apache.rat.testhelpers.XmlUtils;
 import org.junit.jupiter.api.AfterAll;
 import org.junit.jupiter.api.Assertions;
-import org.junit.jupiter.api.Disabled;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.condition.EnabledOnOs;
 import org.junit.jupiter.api.condition.OS;
@@ -246,7 +245,6 @@ public class RatCheckMojoTest {
     /**
      * Tests defining licenses in configuration
      */
-    @Disabled("Disabled until gitignore processing is correct")
     @Test
     void it5() throws Exception {
         final RatCheckMojo mojo = newRatMojo("it5");
@@ -352,7 +350,6 @@ public class RatCheckMojoTest {
     /**
      * Tests verifying gitignore parsing
      */
-    @Disabled("Disabled until gitignore processing is correct")
     @Test
     void rat335() throws Exception {
         final RatCheckMojo mojo = newRatMojo("RAT-335");
@@ -439,7 +436,6 @@ public class RatCheckMojoTest {
      * So for this test we must create such a file which is specific for the 
current
      * working directory.
      */
-    @Disabled("Disabled until gitignore processing is correct")
     @Test
     void rat362() throws Exception {
         final RatCheckMojo mojo = newRatMojo("RAT-362");
diff --git a/apache-rat-plugin/src/test/resources/unit/RAT-107/.classpath 
b/apache-rat-plugin/src/test/resources/unit/RAT-107/.classpath
new file mode 100644
index 00000000..b77e339f
--- /dev/null
+++ b/apache-rat-plugin/src/test/resources/unit/RAT-107/.classpath
@@ -0,0 +1 @@
+This file intentionally has no Apache License Header.
diff --git a/apache-rat-plugin/src/test/resources/unit/RAT-107/.project 
b/apache-rat-plugin/src/test/resources/unit/RAT-107/.project
new file mode 100644
index 00000000..b77e339f
--- /dev/null
+++ b/apache-rat-plugin/src/test/resources/unit/RAT-107/.project
@@ -0,0 +1 @@
+This file intentionally has no Apache License Header.
diff --git a/apache-rat-plugin/src/test/resources/unit/RAT-107/.settings/dummy 
b/apache-rat-plugin/src/test/resources/unit/RAT-107/.settings/dummy
new file mode 100644
index 00000000..e69de29b
diff --git a/apache-rat-plugin/src/test/resources/unit/RAT-107/dummy.ipr 
b/apache-rat-plugin/src/test/resources/unit/RAT-107/dummy.ipr
new file mode 100644
index 00000000..b77e339f
--- /dev/null
+++ b/apache-rat-plugin/src/test/resources/unit/RAT-107/dummy.ipr
@@ -0,0 +1 @@
+This file intentionally has no Apache License Header.
diff --git 
a/apache-rat-plugin/src/test/resources/unit/RAT-107/submodule/.classpath 
b/apache-rat-plugin/src/test/resources/unit/RAT-107/submodule/.classpath
new file mode 100644
index 00000000..b77e339f
--- /dev/null
+++ b/apache-rat-plugin/src/test/resources/unit/RAT-107/submodule/.classpath
@@ -0,0 +1 @@
+This file intentionally has no Apache License Header.
diff --git 
a/apache-rat-plugin/src/test/resources/unit/RAT-107/submodule/.project 
b/apache-rat-plugin/src/test/resources/unit/RAT-107/submodule/.project
new file mode 100644
index 00000000..b77e339f
--- /dev/null
+++ b/apache-rat-plugin/src/test/resources/unit/RAT-107/submodule/.project
@@ -0,0 +1 @@
+This file intentionally has no Apache License Header.
diff --git 
a/apache-rat-plugin/src/test/resources/unit/RAT-107/submodule/.settings/dummy 
b/apache-rat-plugin/src/test/resources/unit/RAT-107/submodule/.settings/dummy
new file mode 100644
index 00000000..e69de29b
diff --git 
a/apache-rat-plugin/src/test/resources/unit/RAT-107/submodule/dummy.iml 
b/apache-rat-plugin/src/test/resources/unit/RAT-107/submodule/dummy.iml
new file mode 100644
index 00000000..b77e339f
--- /dev/null
+++ b/apache-rat-plugin/src/test/resources/unit/RAT-107/submodule/dummy.iml
@@ -0,0 +1 @@
+This file intentionally has no Apache License Header.
diff --git 
a/apache-rat-plugin/src/test/resources/unit/RAT-107/submodule/dummy.ipr 
b/apache-rat-plugin/src/test/resources/unit/RAT-107/submodule/dummy.ipr
new file mode 100644
index 00000000..b77e339f
--- /dev/null
+++ b/apache-rat-plugin/src/test/resources/unit/RAT-107/submodule/dummy.ipr
@@ -0,0 +1 @@
+This file intentionally has no Apache License Header.
diff --git 
a/apache-rat-plugin/src/test/resources/unit/RAT-107/submodule/dummy.iws 
b/apache-rat-plugin/src/test/resources/unit/RAT-107/submodule/dummy.iws
new file mode 100644
index 00000000..b77e339f
--- /dev/null
+++ b/apache-rat-plugin/src/test/resources/unit/RAT-107/submodule/dummy.iws
@@ -0,0 +1 @@
+This file intentionally has no Apache License Header.
diff --git a/apache-rat-plugin/src/test/resources/unit/RAT-335/.gitignore 
b/apache-rat-plugin/src/test/resources/unit/RAT-335/.gitignore
new file mode 100644
index 00000000..8855fa80
--- /dev/null
+++ b/apache-rat-plugin/src/test/resources/unit/RAT-335/.gitignore
@@ -0,0 +1,7 @@
+*.md
+
+# This makes it ignore dir3/dir3.log and dir3/file3.log
+*.log
+
+# This makes it "unignore" dir3/file3.log
+!file*.log
diff --git a/apache-rat-plugin/src/test/resources/unit/RAT-335/dir1/.gitignore 
b/apache-rat-plugin/src/test/resources/unit/RAT-335/dir1/.gitignore
new file mode 100644
index 00000000..26fd5c95
--- /dev/null
+++ b/apache-rat-plugin/src/test/resources/unit/RAT-335/dir1/.gitignore
@@ -0,0 +1,3 @@
+*.txt
+!dir1.md
+file1.log
\ No newline at end of file
diff --git a/apache-rat-plugin/src/test/resources/unit/RAT-335/dir1/dir1.txt 
b/apache-rat-plugin/src/test/resources/unit/RAT-335/dir1/dir1.txt
new file mode 100644
index 00000000..a31cbc89
--- /dev/null
+++ b/apache-rat-plugin/src/test/resources/unit/RAT-335/dir1/dir1.txt
@@ -0,0 +1 @@
+File without a valid license
diff --git a/apache-rat-plugin/src/test/resources/unit/RAT-335/dir1/file1.log 
b/apache-rat-plugin/src/test/resources/unit/RAT-335/dir1/file1.log
new file mode 100644
index 00000000..a31cbc89
--- /dev/null
+++ b/apache-rat-plugin/src/test/resources/unit/RAT-335/dir1/file1.log
@@ -0,0 +1 @@
+File without a valid license
diff --git a/apache-rat-plugin/src/test/resources/unit/RAT-335/dir2/dir2.md 
b/apache-rat-plugin/src/test/resources/unit/RAT-335/dir2/dir2.md
new file mode 100644
index 00000000..a31cbc89
--- /dev/null
+++ b/apache-rat-plugin/src/test/resources/unit/RAT-335/dir2/dir2.md
@@ -0,0 +1 @@
+File without a valid license
diff --git a/apache-rat-plugin/src/test/resources/unit/RAT-335/dir3/dir3.log 
b/apache-rat-plugin/src/test/resources/unit/RAT-335/dir3/dir3.log
new file mode 100644
index 00000000..a31cbc89
--- /dev/null
+++ b/apache-rat-plugin/src/test/resources/unit/RAT-335/dir3/dir3.log
@@ -0,0 +1 @@
+File without a valid license
diff --git 
a/apache-rat-plugin/src/test/resources/unit/RAT-335/invoker.properties 
b/apache-rat-plugin/src/test/resources/unit/RAT-335/invoker.properties
deleted file mode 100644
index 6e8c3479..00000000
--- a/apache-rat-plugin/src/test/resources/unit/RAT-335/invoker.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-# 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.
-
-invoker.goals = clean apache-rat:check
diff --git a/apache-rat-plugin/src/test/resources/unit/RAT-335/root.md 
b/apache-rat-plugin/src/test/resources/unit/RAT-335/root.md
new file mode 100644
index 00000000..a31cbc89
--- /dev/null
+++ b/apache-rat-plugin/src/test/resources/unit/RAT-335/root.md
@@ -0,0 +1 @@
+File without a valid license
diff --git a/apache-rat-plugin/src/test/resources/unit/RAT-362/.gitignore 
b/apache-rat-plugin/src/test/resources/unit/RAT-362/.gitignore
new file mode 100644
index 00000000..4912996b
--- /dev/null
+++ b/apache-rat-plugin/src/test/resources/unit/RAT-362/.gitignore
@@ -0,0 +1,2 @@
+/foo.md
+target
\ No newline at end of file
diff --git a/apache-rat-plugin/src/test/resources/unit/RAT-362/foo.md 
b/apache-rat-plugin/src/test/resources/unit/RAT-362/foo.md
new file mode 100644
index 00000000..a31cbc89
--- /dev/null
+++ b/apache-rat-plugin/src/test/resources/unit/RAT-362/foo.md
@@ -0,0 +1 @@
+File without a valid license
diff --git 
a/apache-rat-plugin/src/test/resources/unit/RAT-362/invoker.properties 
b/apache-rat-plugin/src/test/resources/unit/RAT-362/invoker.properties
deleted file mode 100644
index 6e8c3479..00000000
--- a/apache-rat-plugin/src/test/resources/unit/RAT-362/invoker.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-# 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.
-
-invoker.goals = clean apache-rat:check
diff --git a/apache-rat-plugin/src/test/resources/unit/it5/.bzrignore 
b/apache-rat-plugin/src/test/resources/unit/it5/.bzrignore
deleted file mode 100644
index f59acc08..00000000
--- a/apache-rat-plugin/src/test/resources/unit/it5/.bzrignore
+++ /dev/null
@@ -1,5 +0,0 @@
-## RAT-171: Add rubbish and ensure that the plugin behaves properly
-DoesNotExistAtALL/**
-*\IllegalStuffNotExisting
-Lets-See*+?!OrWhat
-\\nDoesThatWorkAsWell\/
diff --git 
a/apache-rat-plugin/src/test/resources/unit/it5/.rat/customConfig.xml 
b/apache-rat-plugin/src/test/resources/unit/it5/.rat/customConfig.xml
new file mode 100644
index 00000000..6eea4db6
--- /dev/null
+++ b/apache-rat-plugin/src/test/resources/unit/it5/.rat/customConfig.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<rat-config>
+    <families>
+        <family id="CC" name="Creative Commons"/>"
+        <family id="YAL" name="Yet another license family"/>"
+    </families>
+    <licenses>
+        <license family="CC" id="CC-BY-NC-ND"
+                 name="Creative Commons 
Attribution-NonCommercial-NoDerivatives 4.0 International">
+            <text>Attribution-NonCommercial-NoDerivatives</text>
+        </license>
+        <license family="YAL"
+                 name="Yet another license">
+            <any>
+                <text>Yet another license</text>
+                <spdx name="YAL"/>
+            </any>
+        </license>
+    </licenses>
+    <approved>
+        <family license_ref='CC'/>
+    </approved>
+</rat-config>
diff --git a/apache-rat-plugin/src/test/resources/unit/it5/pom.xml 
b/apache-rat-plugin/src/test/resources/unit/it5/pom.xml
index 9cb1327b..47487212 100644
--- a/apache-rat-plugin/src/test/resources/unit/it5/pom.xml
+++ b/apache-rat-plugin/src/test/resources/unit/it5/pom.xml
@@ -1,8 +1,24 @@
 <?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
 <project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>
   <modelVersion>4.0.0</modelVersion>
-  <groupId>org.codehaus.mojo.rat.test</groupId>
-  <artifactId>it1</artifactId>
+  <groupId>org.apache.rat.test</groupId>
+  <artifactId>custom-license</artifactId>
   <version>1.0</version>
   <build>
     <plugins>
@@ -12,84 +28,12 @@
         <version>@pom.version@</version>
         <configuration>
           <outputStyle>xml</outputStyle>
-          <families>
-            <family>
-              <id>YAL</id>
-              <name>Yet another license</name>
-            </family>
-          </families>
-          <licenseFamiliesDenied>YAL</licenseFamiliesDenied>
-          <licenses>
-            <license>
-              <id>MyLicense</id>
-              <family>YAL</family>
-              <text>Yet Another License</text>
-            </license>
-            <license>
-              <family>YAL</family>
-              <id>CpyrT</id>
-              <name>Copyright with tags</name>
-              <notes/>
-              <copyright>
-                <start>1990</start>
-                <end>1991</end>
-                <owner>foo</owner>
-              </copyright>
-            </license>
-            <license>
-              <family>YAL</family>
-              <id>RegxT</id>
-              <name>Regex with tag</name>
-              <notes/>
-              <regex>regex tag</regex>
-            </license>
-            <license>
-              <family>YAL</family>
-              <id>SpdxT</id>
-              <name>Spdx with tag</name>
-              <notes/>
-              <spdx>spxd-tag</spdx>
-            </license>
-            <license>
-              <family>YAL</family>
-              <id>TextT</id>
-              <name>Text with tag</name>
-              <notes/>
-              <text>text-tag</text>
-            </license>
-            <license>
-              <family>YAL</family>
-              <id>Not</id>
-              <name>Not testing</name>
-              <notes/>
-              <not>
-                <text>not test text</text>
-              </not>
-            </license>
-            <license>
-              <family>YAL</family>
-              <id>All</id>
-              <name>All testing</name>
-              <notes/>
-              <all>
-                <text>all test text</text>
-                <spdx>all spdx text</spdx>
-              </all>
-            </license>
-            <license>
-              <family>YAL</family>
-              <id>Any</id>
-              <name>Any testing</name>
-              <notes/>
-              <any>
-                <text>any test text</text>
-                <spdx>any spdx text</spdx>
-              </any>
-            </license>
-          </licenses>
-          <includes>
-            <include>src.apt</include>
-          </includes>
+          <config>.rat/customConfig.xml</config>
+          <inputExcludes>
+            <exclude>.rat/**</exclude>
+            <exclude>pom.xml</exclude>
+            <exclude>invoker.properties</exclude>
+          </inputExcludes>
         </configuration>
       </plugin>
     </plugins>
diff --git 
a/apache-rat-plugin/src/test/resources/unit/it5/src/main/java/nl/basjes/something/Something.java
 
b/apache-rat-plugin/src/test/resources/unit/it5/src/main/java/nl/basjes/something/Something.java
new file mode 100644
index 00000000..4a7f38d9
--- /dev/null
+++ 
b/apache-rat-plugin/src/test/resources/unit/it5/src/main/java/nl/basjes/something/Something.java
@@ -0,0 +1,26 @@
+/*
+ * ***********************************************************************
+ * Ok, this file is really Apache _ licensed but it has a fake header
+ * that does not match the Apache rules to test custom license validation.
+ * ***********************************************************************
+ *
+ * Something toolkit
+ * Copyright (C) 2019-2024 Niels Basjes
+ *
+ * This work is licensed under the Creative Commons
+ * Attribution-NonCommercial-NoDerivatives 4.0 International License.
+ *
+ * You may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    https://creativecommons.org/licenses/by-nc-nd/4.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.
+ */
+package nl.basjes.something;
+
+public class Something {
+    private static final String something = "No real code";
+}
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 6805f006..4e751c49 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -72,6 +72,9 @@ The <action> type attribute can be one of:
     </release>
     -->
     <release version="0.17-SNAPSHOT" date="xxxx-yy-zz" description="Current 
SNAPSHOT - release to be done">
+      <action issue="RAT-98" type="add" dev="claudenw">
+        Report skipped/excluded files and integrate testing of 
inclusion-exclusion and DocumentNames to work under Unix, Windows and Mac.
+      </action>
       <action issue="RAT-471" type="add" dev="pottlinger" due-to="clayjohnson">
         Integrate Creadur RAT into the updated develocity.apache.org instance.
       </action>


Reply via email to