Skip to content

Commit

Permalink
#241 Update dependency Spring to version 6.x
Browse files Browse the repository at this point in the history
- sets the compiler level to `17` to comply with Spring 6.x requirements
- updates Spring dependencies to version 6.0.13
- adds necessary references to `spring-context` in wikimachine pom.xml
- removes reference to `XmlBeanFactory` in `SpringFactory` as this interface was long-time deprecated and removed in Spring 6.x
  • Loading branch information
mawiesne committed Oct 30, 2023
1 parent 18d3dfc commit 87a702f
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
java: [ 11, 17, 21 ]
java: [ 17, 21 ]
experimental: [false]

steps:
Expand Down
4 changes: 4 additions & 0 deletions dkpro-jwpl-wikimachine/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</dependency>
<dependency>
<groupId>org.dkpro.jwpl</groupId>
<artifactId>dkpro-jwpl-mwdumper</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@
import java.io.File;

import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.FileSystemResource;
import org.springframework.core.io.Resource;
import org.springframework.context.support.AbstractXmlApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;

import org.dkpro.jwpl.wikimachine.debug.ILogger;
import org.dkpro.jwpl.wikimachine.decompression.IDecompressor;
Expand Down Expand Up @@ -67,19 +66,26 @@ private static BeanFactory getBeanFactory() {
File outerContextFile = new File(OUTER_APPLICATION_CONTEXT);
boolean outerContextFileProper = outerContextFile.exists()
&& outerContextFile.isFile() && outerContextFile.canRead();
Resource res = (outerContextFileProper) ? new FileSystemResource(outerContextFile) :
new ClassPathResource(INNER_APPLICATION_CONTEXT);
return new XmlBeanFactory(res);

AbstractXmlApplicationContext ctx;
if (outerContextFileProper) {
ctx = new FileSystemXmlApplicationContext(OUTER_APPLICATION_CONTEXT);
} else {
ctx = new ClassPathXmlApplicationContext(INNER_APPLICATION_CONTEXT);
}
return ctx;
}

public static SpringFactory getInstance() {
return instance;
}

@Override
public ILogger getLogger() {
return (ILogger) factory.getBean(LOG_BEAN);
}

@Override
public IDecompressor getDecompressor() {
return (IDecompressor) factory.getBean(DECOMPRESSOR_BEAN);
}
Expand Down
10 changes: 9 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,15 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.target>17</maven.compiler.target>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.release>17</maven.compiler.release>
<ukp.wikipedia.version>2.0.0-SNAPSHOT</ukp.wikipedia.version>
<fau.ptk.version>3.0.8</fau.ptk.version>
<fau.utils.version>3.0.8</fau.utils.version>
<org.sweble.wikitext.version>3.1.9</org.sweble.wikitext.version>

<spring.version>5.3.30</spring.version>
<spring.version>6.0.13</spring.version>
<commons.lang3.version>3.13.0</commons.lang3.version>

<!-- DB specific dependency versions -->
Expand Down Expand Up @@ -165,6 +168,11 @@
<artifactId>spring-beans</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.wikimedia</groupId>
<artifactId>mwdumper</artifactId>
Expand Down

0 comments on commit 87a702f

Please sign in to comment.