You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opennlp.apache.org by rz...@apache.org on 2026/10/03 19:56:00 UTC

(opennlp) branch main updated: Minor: Make the RAT check read rat-excludes and fail on unapproved files (#1386)

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

rzo1 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/opennlp.git


The following commit(s) were added to refs/heads/main by this push:
     new 4c523a083 Minor: Make the RAT check read rat-excludes and fail on unapproved files (#1386)
4c523a083 is described below

commit 4c523a0832cd7a718a534c0e21e2eca726f91f09
Author: Richard Zowalla <13...@users.noreply.github.com>
AuthorDate: Sat Oct 3 21:55:55 2026 +0200

    Minor: Make the RAT check read rat-excludes and fail on unapproved files (#1386)
    
    * Minor: Make the RAT check read rat-excludes and fail on unapproved files
    
    Use inputExcludeFile so RAT 0.18 reads rat-excludes from the repo root
    and drop the numUnapprovedLicenses override so any unapproved file fails.
    Exclude the remaining test fixtures and CaseFolding.txt, and add the ASF
    header to the poms, docs and config files that were missing it.
    
    * Keep the OPENNLP issue keys in the rat-excludes comments
---
 .gitattributes                                   | 17 ++++++
 opennlp-core/opennlp-cli/pom.xml                 | 20 +++++++
 opennlp-core/opennlp-formats/pom.xml             | 20 +++++++
 opennlp-core/opennlp-ml/opennlp-dl-gpu/README.md | 17 ++++++
 opennlp-core/opennlp-ml/opennlp-dl/README.md     | 17 ++++++
 opennlp-core/opennlp-runtime/BENCHMARKS.md       | 17 ++++++
 opennlp-core/opennlp-runtime/pom.xml             | 20 +++++++
 opennlp-core/pom.xml                             | 20 +++++++
 opennlp-distr/README_FOOTER.html                 | 17 ++++++
 opennlp-distr/src/main/docker/Dockerfile         | 17 ++++++
 pom.xml                                          | 30 ++--------
 rat-excludes                                     | 70 +++++++++++++++---------
 12 files changed, 229 insertions(+), 53 deletions(-)

diff --git a/.gitattributes b/.gitattributes
index 39bfc13c4..70049b8a2 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1,3 +1,20 @@
+# 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.
+
 # Handle line endings automatically for files detected as text
 # and leave all files detected as binary untouched.
 * text=auto
diff --git a/opennlp-core/opennlp-cli/pom.xml b/opennlp-core/opennlp-cli/pom.xml
index 1a4666d6f..fc37c589e 100644
--- a/opennlp-core/opennlp-cli/pom.xml
+++ b/opennlp-core/opennlp-cli/pom.xml
@@ -1,4 +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/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>
   <parent>
diff --git a/opennlp-core/opennlp-formats/pom.xml b/opennlp-core/opennlp-formats/pom.xml
index b7fefdcca..1f5640f75 100644
--- a/opennlp-core/opennlp-formats/pom.xml
+++ b/opennlp-core/opennlp-formats/pom.xml
@@ -1,4 +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/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>
   <parent>
diff --git a/opennlp-core/opennlp-ml/opennlp-dl-gpu/README.md b/opennlp-core/opennlp-ml/opennlp-dl-gpu/README.md
index e44cdd3ba..f28a2f5fa 100644
--- a/opennlp-core/opennlp-ml/opennlp-dl-gpu/README.md
+++ b/opennlp-core/opennlp-ml/opennlp-dl-gpu/README.md
@@ -1,3 +1,20 @@
+<!--
+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.
+-->
+
 # OpenNLP DL (GPU)
 
 This module brings in `onnxruntime_gpu` bindings to the existing `opennlp-dl` module. If you are planning to run with GPU acceleration, please use this BOM.
diff --git a/opennlp-core/opennlp-ml/opennlp-dl/README.md b/opennlp-core/opennlp-ml/opennlp-dl/README.md
index fc6a79245..39cc41b56 100644
--- a/opennlp-core/opennlp-ml/opennlp-dl/README.md
+++ b/opennlp-core/opennlp-ml/opennlp-dl/README.md
@@ -1,3 +1,20 @@
+<!--
+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.
+-->
+
 # OpenNLP DL
 
 This module provides OpenNLP interface implementations for ONNX models using the `onnxruntime` dependency.
diff --git a/opennlp-core/opennlp-runtime/BENCHMARKS.md b/opennlp-core/opennlp-runtime/BENCHMARKS.md
index 21cb71a66..280575ee4 100644
--- a/opennlp-core/opennlp-runtime/BENCHMARKS.md
+++ b/opennlp-core/opennlp-runtime/BENCHMARKS.md
@@ -1,3 +1,20 @@
+<!--
+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.
+-->
+
 # Thread Safety Benchmarks
 
 ## JMH Benchmarks
diff --git a/opennlp-core/opennlp-runtime/pom.xml b/opennlp-core/opennlp-runtime/pom.xml
index e18fd70bd..8a67908a0 100644
--- a/opennlp-core/opennlp-runtime/pom.xml
+++ b/opennlp-core/opennlp-runtime/pom.xml
@@ -1,4 +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/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>
   <parent>
diff --git a/opennlp-core/pom.xml b/opennlp-core/pom.xml
index 237247933..4bb7ec56c 100644
--- a/opennlp-core/pom.xml
+++ b/opennlp-core/pom.xml
@@ -1,4 +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/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>
   <parent>
diff --git a/opennlp-distr/README_FOOTER.html b/opennlp-distr/README_FOOTER.html
index 20d92daef..b628fe204 100644
--- a/opennlp-distr/README_FOOTER.html
+++ b/opennlp-distr/README_FOOTER.html
@@ -1,3 +1,20 @@
+<!--
+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.
+-->
+
 <h2><a name="report.issues">How to Report Issues</a></h2>
 <p>
     The Apache OpenNLP project uses GitHub Issues for issue tracking.  Please report any
diff --git a/opennlp-distr/src/main/docker/Dockerfile b/opennlp-distr/src/main/docker/Dockerfile
index adf03ea4f..636378ae2 100644
--- a/opennlp-distr/src/main/docker/Dockerfile
+++ b/opennlp-distr/src/main/docker/Dockerfile
@@ -1,3 +1,20 @@
+# 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.
+
 FROM openjdk:21-alpine
 MAINTAINER Apache OpenNLP (dev@opennlp.apache.org)
 
diff --git a/pom.xml b/pom.xml
index 5442a8e83..3089ce5f7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -473,11 +473,11 @@ org.xml.sax.helpers.XMLReaderFactory#createXMLReader(**)
 						</goals>
 						<phase>verify</phase>
 						<configuration>
-							<excludes>
+							<inputExcludeFile>${maven.multiModuleProjectDirectory}/rat-excludes</inputExcludeFile>
+							<inputExcludes>
 								<!-- File generated by maven-release-plugin -->
-								<exclude>release.properties</exclude>
-							</excludes>
-							<numUnapprovedLicenses>1000000</numUnapprovedLicenses>
+								<inputExclude>release.properties</inputExclude>
+							</inputExcludes>
 						</configuration>
 					</execution>
 				</executions>
@@ -680,28 +680,6 @@ org.xml.sax.helpers.XMLReaderFactory#createXMLReader(**)
 	</build>
 
 	<profiles>
-		<profile>
-		<id>apache-release</id>
-		<build>
-			<plugins>
-				<plugin>
-					<groupId>org.apache.rat</groupId>
-					<artifactId>apache-rat-plugin</artifactId>
-					<configuration>
-						<excludes>
-							<excludesFile>rat-excludes</excludesFile>
-						</excludes>
-					</configuration>
-					<executions>
-						<execution>
-							<id>default-cli</id>
-						</execution>
-					</executions>
-				</plugin>
-			</plugins>
-		</build>
-		</profile>
-
 		<profile>
 			<id>jacoco</id>
 			<properties>
diff --git a/rat-excludes b/rat-excludes
index 0e291b309..53c444cf6 100644
--- a/rat-excludes
+++ b/rat-excludes
@@ -1,21 +1,19 @@
-<!--
-   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.
--->
+# 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.
 
 src/license/NOTICE.template
 src/test/resources/opennlp/tools/*/*.txt
@@ -40,32 +38,28 @@ src/test/resources/data/ppa/test
 src/test/resources/data/ppa/training
 src/test/resources/data/ppa/NOTICE
 src/test/resources/opennlp/tools/doccat/DoccatSample.txt
-src/test/resources/opennlp/tools/formats/brat/voa-with-entities.ann
-src/test/resources/opennlp/tools/formats/brat/voa-with-entities.txt
-src/test/resources/opennlp/tools/formats/brat/voa-with-relations.ann
-src/test/resources/opennlp/tools/formats/brat/voa-with-relations.txt
 src/test/resources/opennlp/tools/languagemodel/sentences.txt
 src/test/resources/opennlp/tools/lemmatizer/trial.old.tsv
 src/test/resources/opennlp/tools/lemmatizer/output.txt
 src/test/resources/opennlp/tools/cmdline/languagemodel/sentences_set_1.txt
 src/test/resources/opennlp/tools/cmdline/languagemodel/sentences_set_2.txt
 
-<!-- OPENNLP-1832 spellcheck tiny test fixtures (data files, no AL header possible) -->
+# OPENNLP-1832 spellcheck tiny test fixtures (data files, no Apache header possible)
 src/test/resources/opennlp/spellcheck/frequency_dictionary_tiny.txt
 src/test/resources/opennlp/spellcheck/frequency_bigramdictionary_tiny.txt
 src/test/resources/opennlp/spellcheck/misspellings_tiny.txt
 
-<!-- head rule files, format does not allow AL header -->
+# head rule files, format does not allow an Apache header
 lang/en/parser/en-head_rules
 lang/es/parser/es-head-rules
 src/test/resources/*.txt
 src/test/resources/*.info
 
-<!-- other licence -->
+# other licence
 src/main/java/opennlp/tools/stemmer/snowball/*.java
 src/main/resources/opennlp/tools/stopword/*.txt
 
-<!-- OPENNLP-1850 bundled Unicode data files (Unicode License V3, no Apache header possible) -->
+# OPENNLP-1850 bundled Unicode data files (Unicode License V3, no Apache header possible)
 src/main/resources/opennlp/tools/tokenize/uax29/WordBreakProperty.txt
 src/main/resources/opennlp/tools/tokenize/uax29/ExtendedPictographic.txt
 src/main/resources/opennlp/tools/util/normalizer/confusables.txt
@@ -73,6 +67,28 @@ src/main/resources/opennlp/tools/util/normalizer/CaseFolding.txt
 src/main/resources/opennlp/tools/util/normalizer/EmojiSequences.txt
 src/test/resources/opennlp/tools/tokenize/uax29/WordBreakTest.txt
 
-<!-- opennlp-dl tiny ONNX test models (project-generated binaries, see the gen_tiny_*_model.py scripts committed next to them) -->
+# opennlp-dl tiny ONNX test models (project-generated binaries, see the gen_tiny_*_model.py scripts next to them)
 src/test/resources/opennlp/dl/vectors/tiny-vectors.onnx
 src/test/resources/opennlp/dl/vectors/tiny-pooled.onnx
+
+# test fixtures and expected outputs (data files, no Apache header possible)
+src/test/resources/opennlp/tools/util/wordvector/glove-example-*.txt
+src/test/resources/opennlp/tools/cmdline/chunker/*.txt
+src/test/resources/opennlp/tools/cmdline/languagemodel/origin_of_text_samples.txt
+src/test/resources/opennlp/tools/ml/maxent/football.dat
+src/test/resources/opennlp/tools/lemmatizer/*.dict
+src/test/resources/opennlp/tools/lemmatizer/trial.old-insufficient.tsv
+src/test/resources/opennlp/dl/vocab-plain.txt
+
+# corpus format samples read by the opennlp-formats tests (data files, no Apache header possible)
+src/test/resources/opennlp/tools/formats/ad/ad.sample
+src/test/resources/opennlp/tools/formats/brat/brat-ann.conf
+src/test/resources/opennlp/tools/formats/brat/*.ann
+src/test/resources/opennlp/tools/formats/brat/*.txt
+src/test/resources/opennlp/tools/formats/conllu/*.conllu
+src/test/resources/opennlp/tools/formats/irishsentencebank/*.xml
+src/test/resources/opennlp/tools/formats/leipzig/samples/**
+src/test/resources/opennlp/tools/formats/masc/fakeMASC*
+src/test/resources/opennlp/tools/formats/moses/*.sample
+src/test/resources/opennlp/tools/formats/nkjp/*.xml
+src/test/resources/opennlp/tools/formats/ontonotes/ontonotes-sample-*