This is an automated email from the ASF dual-hosted git repository.
mawiesne pushed a commit to branch opennlp-2.x
in repository https://gitbox.apache.org/repos/asf/opennlp.git
The following commit(s) were added to refs/heads/opennlp-2.x by this push:
new 9ad1d6d0 OPENNLP-1760: Make SourceForge URLs in Tests Configurable to
Avoid 403/Rate Limiting Issues (OpenNLP 2.x)
9ad1d6d0 is described below
commit 9ad1d6d08680a1eccf5fa4136293d1ef422bfee3
Author: Martin Wiesner <[email protected]>
AuthorDate: Wed Jul 9 07:34:01 2025 +0200
OPENNLP-1760: Make SourceForge URLs in Tests Configurable to Avoid 403/Rate
Limiting Issues (OpenNLP 2.x)
---
.../src/test/java/opennlp/tools/AbstractModelLoaderTest.java | 4 ++--
opennlp-uima/src/test/java/opennlp/uima/AbstractIT.java | 4 ++--
pom.xml | 5 +++--
3 files changed, 7 insertions(+), 6 deletions(-)
diff --git
a/opennlp-tools/src/test/java/opennlp/tools/AbstractModelLoaderTest.java
b/opennlp-tools/src/test/java/opennlp/tools/AbstractModelLoaderTest.java
index c83fe781..53ec0298 100644
--- a/opennlp-tools/src/test/java/opennlp/tools/AbstractModelLoaderTest.java
+++ b/opennlp-tools/src/test/java/opennlp/tools/AbstractModelLoaderTest.java
@@ -34,8 +34,8 @@ public abstract class AbstractModelLoaderTest {
private static final Logger logger =
LoggerFactory.getLogger(AbstractModelLoaderTest.class);
- private static final String BASE_URL_MODELS_V15 =
"https://opennlp.sourceforge.net/models-1.5/";
- private static final String BASE_URL_MODELS_V183 =
"https://dlcdn.apache.org/opennlp/models/langdetect/1.8.3/";
+ private static final String BASE_URL_MODELS_V15 =
System.getProperty("opennlp.model.v15.base.url",
"https://opennlp.sourceforge.net/models-1.5/");
+ private static final String BASE_URL_MODELS_V183 =
System.getProperty("opennlp.model.v183.base.url",
"https://dlcdn.apache.org/opennlp/models/langdetect/1.8.3/");
protected static final Path OPENNLP_DIR =
Paths.get(System.getProperty("OPENNLP_DOWNLOAD_HOME",
System.getProperty("user.home"))).resolve(".opennlp");
protected static final String VER = "1.3-2.5.4";
diff --git a/opennlp-uima/src/test/java/opennlp/uima/AbstractIT.java
b/opennlp-uima/src/test/java/opennlp/uima/AbstractIT.java
index 39c27387..477e9301 100644
--- a/opennlp-uima/src/test/java/opennlp/uima/AbstractIT.java
+++ b/opennlp-uima/src/test/java/opennlp/uima/AbstractIT.java
@@ -53,8 +53,8 @@ abstract class AbstractIT extends AbstractUimaTest {
protected static final String BIN = ".bin";
- private static final String BASE_URL_MODELS_V15 =
"https://opennlp.sourceforge.net/models-1.5/";
-
+ private static final String BASE_URL_MODELS_V15 =
System.getProperty("opennlp.model.v15.base.url",
"https://opennlp.sourceforge.net/models-1.5/");
+
@BeforeAll
public static void initEnv() throws IOException {
// ensure referenced UD models are present in download home
diff --git a/pom.xml b/pom.xml
index 8e7a0841..b7f80a9c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -293,7 +293,7 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
- <argLine>-Xmx2048m
-Dorg.slf4j.simpleLogger.defaultLogLevel=off</argLine>
+ <argLine>-Xmx2048m
-Dorg.slf4j.simpleLogger.defaultLogLevel=off
-Dopennlp.model.v15.base.url="${opennlp.model.v15.base.url}"</argLine>
<forkCount>${opennlp.forkCount}</forkCount>
<failIfNoSpecifiedTests>false</failIfNoSpecifiedTests>
<excludes>
@@ -318,7 +318,7 @@
</execution>
</executions>
<configuration>
-
<argLine>-DOPENNLP_DOWNLOAD_HOME=${opennlp.download.home}</argLine>
+
<argLine>-DOPENNLP_DOWNLOAD_HOME=${opennlp.download.home}
-Dopennlp.model.v15.base.url="${opennlp.model.v15.base.url}"</argLine>
<excludes>
<exclude>**/*Test.java</exclude>
</excludes>
@@ -621,6 +621,7 @@
<id>ci</id>
<properties>
<opennlp.download.home>${project.build.directory}</opennlp.download.home>
+
<opennlp.model.v15.base.url>https://nightlies.apache.org/opennlp/models-1.5/</opennlp.model.v15.base.url>
</properties>
</profile>