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

mawiesne 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 2c8e58b7 OPENNLP-1708: Raise OpenNLP version to 3.x on main branch 
(#785)
2c8e58b7 is described below

commit 2c8e58b77145915e1385e3da45a3013920281de4
Author: Martin Wiesner <[email protected]>
AuthorDate: Sat May 24 20:59:20 2025 +0200

    OPENNLP-1708: Raise OpenNLP version to 3.x on main branch (#785)
    
    * OPENNLP-1708: Raise OpenNLP version to 3.x on main branch
    - adjusts all pom.xml files towards 3.0.0-SNAPSHOT
    - adjusts upper major model version to 3.x
    - adds static method Version#between for simpler version range checks in 
BaseModel
    - adds 'opennlp-2.x' branch to protected branches in .asf.yml
    - updates README.md with infos on 'Branches and Merging Strategy'
    - cures a typo
    - adds external link to the ONNX website
---
 .asf.yaml                                          |  5 +++
 README.md                                          | 36 ++++++++++++++++++----
 opennlp-distr/pom.xml                              |  2 +-
 opennlp-dl-gpu/pom.xml                             |  2 +-
 opennlp-dl/pom.xml                                 |  2 +-
 opennlp-docs/pom.xml                               |  2 +-
 opennlp-morfologik-addon/pom.xml                   |  2 +-
 opennlp-tools-models/pom.xml                       |  2 +-
 opennlp-tools/pom.xml                              |  2 +-
 .../src/main/java/opennlp/tools/util/Version.java  | 12 ++++++++
 .../java/opennlp/tools/util/model/BaseModel.java   |  2 +-
 opennlp-uima/pom.xml                               |  2 +-
 pom.xml                                            |  2 +-
 13 files changed, 57 insertions(+), 16 deletions(-)

diff --git a/.asf.yaml b/.asf.yaml
index a0ad9daf..cb13aa6f 100644
--- a/.asf.yaml
+++ b/.asf.yaml
@@ -12,6 +12,11 @@ github:
         dismiss_stale_reviews: false
         require_code_owner_reviews: false
         required_approving_review_count: 1
+    opennlp-2.x:
+      required_pull_request_reviews:
+        dismiss_stale_reviews: false
+        require_code_owner_reviews: false
+        required_approving_review_count: 1
   autolink_jira:
     - OPENNLP
   custom_subjects:
diff --git a/README.md b/README.md
index ddd98141..f12b5394 100644
--- a/README.md
+++ b/README.md
@@ -71,10 +71,10 @@ Currently, the library has different packages:
 * `opennlp-tools` : The core toolkit.
 * `opennlp-tools-models` : A set of classes to load [OpenNLP 
models](https://github.com/apache/opennlp-models) from the classpath.
 * `opennlp-uima` : A set of [Apache UIMA](https://uima.apache.org) annotators.
-* `opennlp-morfologik-addon` : An addon for Morfologik
-* `opennlp-dl` : OpenNLP interface implementations for ONNX models using the 
`onnxruntime` dependency.
+* `opennlp-morfologik-addon` : An addon for _Morfologik_.
+* `opennlp-dl` : OpenNLP interface implementations for [ONNX](https://onnx.ai) 
models using the `onnxruntime` dependency.
 * `opennlp-dl-gpu` : Replaces `onnxruntime` with the `onnxruntime_gpu` 
dependency to support GPU acceleration.
-* `opennlp-sandbox`: Other projects in progress are found in the 
[sandbox](https://github.com/apache/opennlp-sandbox)
+* `opennlp-sandbox`: Other projects in progress reside in the 
[sandbox](https://github.com/apache/opennlp-sandbox).           
 
 ## Getting Started
 
@@ -104,6 +104,28 @@ compile group: "org.apache.opennlp", name: 
"opennlp-tools", version: "${opennlp.
 
 For more details please check our 
[documentation](http://opennlp.apache.org/docs/)
 
+## Branches and Merging Strategy
+
+To support ongoing development and stable maintenance of Apache OpenNLP, the 
project follows a dual-branch model:
+
+### Branch overview
+
+- **`main`**: Development branch for version **3.0** and beyond. All feature 
development and 3.x releases occur here.
+- **`opennlp-2.x`**: Maintains the stable **2.x** release line. This branch 
will receive selective updates and patch releases.
+
+### Workflow summary
+
+- Feature development
+  - New features targeting versions 3.0+ are developed on feature branches 
_off_ `main` and merged _into_ `main`.
+- Bug fixes and dependency updates
+  - Relevant fixes or dependency updates from `main` may be cherry-picked into 
`opennlp-2.x` as needed.
+- Releases
+  - **3.x** releases are made from the `main` branch.
+  - **2.x** releases are made from the `opennlp-2.x` branch.
+- Release tags
+  - Release tags are applied directly to the appropriate version branch 
(`main` for 3.x or `opennlp-2.x` for 2.x). 
+  - The presence of a version branch does not affect the tagging or visibility 
of releases.
+
 ## Building OpenNLP
 
 At least JDK 17 and Maven 3.3.9 are required to build the library.
@@ -114,12 +136,14 @@ After cloning the repository go into the destination 
directory and run:
 mvn install
 ```
 
-### Additional Developement Information
+### Additional Development Information
 
-- [Building and Integrating Snowball Stemmer for 
OpenNLP](dev/Snowball-Stemmer.md)
+- Building and integrating [Snowball Stemmer](dev/Snowball-Stemmer.md) for 
OpenNLP.
 
 ## Contributing
 
-The Apache OpenNLP project is developed by volunteers and is always looking 
for new contributors to work on all parts of the project. Every contribution is 
welcome and needed to make it better. A contribution can be anything from a 
small documentation typo fix to a new component.
+The Apache OpenNLP project is developed by volunteers and is always looking 
for new contributors to work on all parts of the project. 
+Every contribution is welcome and needed to make it better. 
+A contribution can be anything from a small documentation typo fix to a new 
component.
 
 If you would like to get involved please follow the instructions 
[here](https://github.com/apache/opennlp/blob/main/.github/CONTRIBUTING.md)
diff --git a/opennlp-distr/pom.xml b/opennlp-distr/pom.xml
index 0ada8ff0..ba0b8640 100644
--- a/opennlp-distr/pom.xml
+++ b/opennlp-distr/pom.xml
@@ -24,7 +24,7 @@
   <parent>
     <groupId>org.apache.opennlp</groupId>
     <artifactId>opennlp</artifactId>
-    <version>2.5.5-SNAPSHOT</version>
+    <version>3.0.0-SNAPSHOT</version>
     <relativePath>../pom.xml</relativePath>
   </parent>
 
diff --git a/opennlp-dl-gpu/pom.xml b/opennlp-dl-gpu/pom.xml
index 81b7c368..c79d0084 100644
--- a/opennlp-dl-gpu/pom.xml
+++ b/opennlp-dl-gpu/pom.xml
@@ -24,7 +24,7 @@
   <parent>
     <groupId>org.apache.opennlp</groupId>
     <artifactId>opennlp</artifactId>
-    <version>2.5.5-SNAPSHOT</version>
+    <version>3.0.0-SNAPSHOT</version>
     <relativePath>../pom.xml</relativePath>
   </parent>
   <groupId>org.apache.opennlp</groupId>
diff --git a/opennlp-dl/pom.xml b/opennlp-dl/pom.xml
index 6ab97601..ef84ee97 100644
--- a/opennlp-dl/pom.xml
+++ b/opennlp-dl/pom.xml
@@ -24,7 +24,7 @@
   <parent>
     <groupId>org.apache.opennlp</groupId>
     <artifactId>opennlp</artifactId>
-    <version>2.5.5-SNAPSHOT</version>
+    <version>3.0.0-SNAPSHOT</version>
     <relativePath>../pom.xml</relativePath>
   </parent>
   <groupId>org.apache.opennlp</groupId>
diff --git a/opennlp-docs/pom.xml b/opennlp-docs/pom.xml
index d7f6e534..298114aa 100644
--- a/opennlp-docs/pom.xml
+++ b/opennlp-docs/pom.xml
@@ -24,7 +24,7 @@
   <parent>
        <groupId>org.apache.opennlp</groupId>
        <artifactId>opennlp</artifactId>
-       <version>2.5.5-SNAPSHOT</version>
+       <version>3.0.0-SNAPSHOT</version>
     <relativePath>../pom.xml</relativePath>
   </parent>
   
diff --git a/opennlp-morfologik-addon/pom.xml b/opennlp-morfologik-addon/pom.xml
index edc84b6a..0479354f 100644
--- a/opennlp-morfologik-addon/pom.xml
+++ b/opennlp-morfologik-addon/pom.xml
@@ -24,7 +24,7 @@
        <parent>
                <groupId>org.apache.opennlp</groupId>
                <artifactId>opennlp</artifactId>
-               <version>2.5.5-SNAPSHOT</version>
+               <version>3.0.0-SNAPSHOT</version>
                <relativePath>../pom.xml</relativePath>
        </parent>
 
diff --git a/opennlp-tools-models/pom.xml b/opennlp-tools-models/pom.xml
index 3d1f9188..c084d019 100644
--- a/opennlp-tools-models/pom.xml
+++ b/opennlp-tools-models/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.apache.opennlp</groupId>
         <artifactId>opennlp</artifactId>
-        <version>2.5.5-SNAPSHOT</version>
+        <version>3.0.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>opennlp-tools-models</artifactId>
diff --git a/opennlp-tools/pom.xml b/opennlp-tools/pom.xml
index 1876cdb9..43bb5ebc 100644
--- a/opennlp-tools/pom.xml
+++ b/opennlp-tools/pom.xml
@@ -25,7 +25,7 @@
   <parent>
     <groupId>org.apache.opennlp</groupId>
     <artifactId>opennlp</artifactId>
-    <version>2.5.5-SNAPSHOT</version>
+    <version>3.0.0-SNAPSHOT</version>
     <relativePath>../pom.xml</relativePath>
   </parent>
 
diff --git a/opennlp-tools/src/main/java/opennlp/tools/util/Version.java 
b/opennlp-tools/src/main/java/opennlp/tools/util/Version.java
index 20474a7f..64438175 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/util/Version.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/util/Version.java
@@ -199,4 +199,16 @@ public class Version {
 
     return Version.parse(versionString);
   }
+
+  /**
+   * Checks whether a {@code version} is in between an interval and its 
boundaries.
+   *
+   * @param version The (major) version number to check.
+   * @param minValue The inclusive value of the lower interval boundary.
+   * @param maxValue The inclusive value of the upper interval boundary.
+   * @return {@code true} if the value is in between the boundary, {@code 
false} otherwise.
+   */
+  public static boolean between(int version, int minValue, int maxValue) {
+    return (version >= minValue && version <= maxValue);
+  }
 }
diff --git 
a/opennlp-tools/src/main/java/opennlp/tools/util/model/BaseModel.java 
b/opennlp-tools/src/main/java/opennlp/tools/util/model/BaseModel.java
index 35e47763..7716bd0d 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/util/model/BaseModel.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/util/model/BaseModel.java
@@ -460,7 +460,7 @@ public abstract class BaseModel implements 
ArtifactProvider, Serializable {
       // Version check is only performed if current version is not the 
dev/debug version
       if (!Version.currentVersion().equals(Version.DEV_VERSION)) {
         // Support OpenNLP 1.x models.
-        if (version.getMajor() != 1 && version.getMajor() != 2) {
+        if (!Version.between(version.getMajor(), 1, 3)) {
           throw new InvalidFormatException("Model version " + version + " is 
not supported by this ("
               + Version.currentVersion() + ") version of OpenNLP!");
         }
diff --git a/opennlp-uima/pom.xml b/opennlp-uima/pom.xml
index 7c4f05b8..e81d3b8c 100644
--- a/opennlp-uima/pom.xml
+++ b/opennlp-uima/pom.xml
@@ -25,7 +25,7 @@
        <parent>
            <groupId>org.apache.opennlp</groupId>
            <artifactId>opennlp</artifactId>
-           <version>2.5.5-SNAPSHOT</version>
+           <version>3.0.0-SNAPSHOT</version>
            <relativePath>../pom.xml</relativePath>
     </parent>
 
diff --git a/pom.xml b/pom.xml
index b244e204..e410f9e0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -31,7 +31,7 @@
 
        <groupId>org.apache.opennlp</groupId>
        <artifactId>opennlp</artifactId>
-       <version>2.5.5-SNAPSHOT</version>
+       <version>3.0.0-SNAPSHOT</version>
        <packaging>pom</packaging>
 
        <name>Apache OpenNLP Reactor</name>

Reply via email to