Skip to content

Commit

Permalink
#241 Update dependency Spring to version 6.x
Browse files Browse the repository at this point in the history
- 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 26, 2023
1 parent b52e4a9 commit 4b654be
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 8 deletions.
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
7 changes: 6 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<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>

<!-- DB specific dependency versions -->
<hibernate.version>6.1.7.Final</hibernate.version>
Expand Down Expand Up @@ -156,6 +156,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 4b654be

Please sign in to comment.