Skip to content

Commit

Permalink
#3611 - Upgrade to Spring 6, Boot 3, Wicket 10, etc.
Browse files Browse the repository at this point in the history
- Adjust boot loader
- Adjust dependencies
  • Loading branch information
reckart committed Feb 25, 2024
1 parent 7b03898 commit b558448
Show file tree
Hide file tree
Showing 17 changed files with 54 additions and 176 deletions.
22 changes: 8 additions & 14 deletions inception/inception-app-webapp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -513,10 +513,6 @@
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>log4j-over-slf4j</artifactId>
Expand All @@ -536,13 +532,6 @@
<artifactId>log4j-layout-template-json</artifactId>
</dependency>

<!-- LOGGING DEPENDENCIES - Avoid Commons Logging -->
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<scope>provided</scope>
</dependency>

<!-- SENTRY DEPENDENCIES -->
<dependency>
<groupId>io.sentry</groupId>
Expand Down Expand Up @@ -976,11 +965,9 @@
<usedDependency>org.hsqldb:hsqldb</usedDependency>
<!-- Logging - used via reflection / optional -->
<usedDependency>org.slf4j:log4j-over-slf4j</usedDependency>
<usedDependency>org.slf4j:jcl-over-slf4j</usedDependency>
<usedDependency>org.apache.logging.log4j:log4j-slf4j2-impl</usedDependency>
<usedDependency>org.apache.logging.log4j:log4j-core</usedDependency>
<usedDependency>org.apache.logging.log4j:log4j-layout-template-json</usedDependency>
<usedDependency>commons-logging:commons-logging</usedDependency>
<!-- Monitoring - used via reflection / optional -->
<usedDependency>io.sentry:sentry-spring-boot-starter</usedDependency>
<usedDependency>io.sentry:sentry-log4j2</usedDependency>
Expand Down Expand Up @@ -1116,13 +1103,20 @@
</goals>
<configuration>
<executable>true</executable>
<layoutFactory implementation="de.tudarmstadt.ukp.inception.bootloader.ExtensibleClasspathEnabledWarLayoutFactory" />
<layoutFactory
implementation="de.tudarmstadt.ukp.inception.bootloader.ExtensibleClasspathEnabledWarLayoutFactory" />
<!--
We want the original file to be the WAR and the repackaged all-inclusive runnable
thing with the embedded Tomcat to be the JAR.
-->
<attach>false</attach>
<classifier>standalone</classifier>
<excludes>
<exclude>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclude>
</excludes>
</configuration>
</execution>
</executions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,49 +21,36 @@
import static java.lang.System.getProperty;

import java.awt.GraphicsEnvironment;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.LinkedHashSet;
import java.util.Set;

import org.springframework.boot.loader.PropertiesLauncher;
import org.springframework.boot.loader.archive.Archive;
import org.springframework.boot.loader.archive.JarFileArchive;
import org.springframework.boot.loader.launch.Archive;
import org.springframework.boot.loader.launch.WarLauncher;

public class ExtensibleClasspathEnabledWarLauncher
extends PropertiesLauncher
extends WarLauncher
{
private static final String DEBUG = "loader.debug";

private static final String WEB_INF = "WEB-INF/";

private static final String WEB_INF_CLASSES = WEB_INF + "classes/";

private static final String WEB_INF_LIB = WEB_INF + "lib/";

private static final String WEB_INF_LIB_PROVIDED = WEB_INF + "lib-provided/";

private static final String EXTRA_LIB = "/lib";

private final Archive archive;
public ExtensibleClasspathEnabledWarLauncher() throws Exception
{
}

public ExtensibleClasspathEnabledWarLauncher()
protected ExtensibleClasspathEnabledWarLauncher(Archive archive) throws Exception
{
try {
archive = createArchive();
}
catch (Exception ex) {
throw new IllegalStateException(ex);
}
super(archive);
}

@Override
protected Iterator<Archive> getClassPathArchivesIterator() throws Exception
protected Set<URL> getClassPathUrls() throws Exception
{
List<Archive> archives = new ArrayList<>();
super.getClassPathArchivesIterator().forEachRemaining(archives::add);
Set<URL> urls = new LinkedHashSet<>(super.getClassPathUrls());

Path extraLibPath = Paths.get(getApplicationHome() + EXTRA_LIB);

Expand All @@ -72,26 +59,15 @@ protected Iterator<Archive> getClassPathArchivesIterator() throws Exception

for (Path jar : Files.newDirectoryStream(extraLibPath, "*.jar")) {
debug("Registering JAR: [" + jar + "]");
archives.add(new JarFileArchive(jar.toFile()));
urls.add(jar.toUri().toURL());
}
}
else {
debug("Not scanning for additional JARs in [" + extraLibPath
+ "] - path does not exist");
}

return archives.iterator();
}

protected boolean isNestedArchive(Archive.Entry entry)
{
if (entry.isDirectory()) {
return entry.getName().equals(WEB_INF_CLASSES);
}
else {
return entry.getName().startsWith(WEB_INF_LIB)
|| entry.getName().startsWith(WEB_INF_LIB_PROVIDED);
}
return urls;
}

private void debug(String message)
Expand Down Expand Up @@ -147,10 +123,10 @@ public static int getJavaVersion()

public static boolean checkSystemRequirements(int ver)
{
if (ver < 11) {
if (ver < 17) {
StringBuilder message = new StringBuilder();
message.append(
format("INCEpTION requires at least Java 11, but you are running Java %s.%n%n",
format("INCEpTION requires at least Java 17, but you are running Java %s.%n%n",
getProperty("java.specification.version")));
message.append(format("Installation: %s%n", getProperty("java.home")));
message.append(format("Vendor: %s%n", getProperty("java.vendor")));
Expand Down
10 changes: 0 additions & 10 deletions inception/inception-concept-linking/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -238,14 +238,6 @@
<artifactId>dkpro-core-io-conll-asl</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<!-- DKPro Core Datasets isn't compatible with SnakeYAML 2.0 atm -->
<version>1.33</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<pluginManagement>
Expand All @@ -255,8 +247,6 @@
<artifactId>maven-dependency-plugin</artifactId>
<configuration>
<ignoredDependencies>
<!-- DKPro Core Datasets isn't compatible with SnakeYAML 2.0 atm -->
<ignoredDependency>org.yaml:snakeyaml</ignoredDependency>
<!-- Dependency analysis does not get it... -->
<ignoredDependency>org.danekja:jdk-serializable-functional</ignoredDependency>
<ignoredDependency>javax.persistence:javax.persistence-api</ignoredDependency>
Expand Down
24 changes: 18 additions & 6 deletions inception/inception-dependencies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -433,11 +433,23 @@
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox</artifactId>
<version>${pdfbox.version}</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>fontbox</artifactId>
<version>${pdfbox.version}</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
Expand All @@ -462,6 +474,12 @@
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.9.4</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
Expand Down Expand Up @@ -691,11 +709,6 @@
<artifactId>validation-api</artifactId>
<version>2.0.1.Final</version>
</dependency>
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>javax.persistence-api</artifactId>
<version>2.2</version>
</dependency>
<dependency>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
Expand Down Expand Up @@ -1209,7 +1222,6 @@
<dependency>
<groupId>org.codelibs.opensearch</groupId>
<artifactId>opensearch-runner</artifactId>
<!-- <version>${opensearch.version}.0</version>-->
<version>${opensearch.version}.0</version>
</dependency>
<dependency>
Expand Down
26 changes: 0 additions & 26 deletions inception/inception-example-imls-data-majority/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -129,31 +129,5 @@
<artifactId>dkpro-core-io-conll-asl</artifactId>
<scope>test</scope>
</dependency>


<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<!-- DKPro Core Datasets isn't compatible with SnakeYAML 2.0 atm -->
<version>1.33</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<configuration>
<ignoredDependencies>
<!-- DKPro Core Datasets isn't compatible with SnakeYAML 2.0 atm -->
<ignoredDependency>org.yaml:snakeyaml</ignoredDependency>
</ignoredDependencies>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
10 changes: 0 additions & 10 deletions inception/inception-imls-external/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,6 @@
<artifactId>dkpro-core-api-ner-asl</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<!-- DKPro Core Datasets isn't compatible with SnakeYAML 2.0 atm -->
<version>1.33</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand All @@ -160,8 +152,6 @@
<artifactId>maven-dependency-plugin</artifactId>
<configuration>
<ignoredDependencies>
<!-- DKPro Core Datasets isn't compatible with SnakeYAML 2.0 atm -->
<ignoredDependency>org.yaml:snakeyaml</ignoredDependency>
<!-- Plugin does not get it -->
<ignoredDependency>com.fasterxml.jackson.core:jackson-core</ignoredDependency>
</ignoredDependencies>
Expand Down
24 changes: 0 additions & 24 deletions inception/inception-imls-opennlp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -176,29 +176,5 @@
<artifactId>dkpro-core-api-io-asl</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<!-- DKPro Core Datasets isn't compatible with SnakeYAML 2.0 atm -->
<version>1.33</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<configuration>
<ignoredDependencies>
<!-- DKPro Core Datasets isn't compatible with SnakeYAML 2.0 atm -->
<ignored>org.yaml:snakeyaml</ignored>
</ignoredDependencies>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
12 changes: 0 additions & 12 deletions inception/inception-imls-stringmatch/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -222,14 +222,6 @@
<artifactId>hsqldb</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<!-- DKPro Core Datasets isn't compatible with SnakeYAML 2.0 atm -->
<version>1.33</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<pluginManagement>
Expand All @@ -238,10 +230,6 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<configuration>
<ignoredDependencies>
<!-- DKPro Core Datasets isn't compatible with SnakeYAML 2.0 atm -->
<ignored>org.yaml:snakeyaml</ignored>
</ignoredDependencies>
<usedDependencies>
<!-- Testing - used via reflection -->
<usedDependency>org.hsqldb:hsqldb</usedDependency>
Expand Down
4 changes: 0 additions & 4 deletions inception/inception-imls-weblicht/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@
<artifactId>inception-imls-weblicht</artifactId>
<name>INCEpTION - ML - WebLicht</name>
<dependencies>
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>javax.persistence-api</artifactId>
</dependency>
<dependency>
<groupId>eu.clarin.weblicht</groupId>
<artifactId>wlfxb</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@
import de.tudarmstadt.ukp.inception.kb.reification.Reification;
import de.tudarmstadt.ukp.inception.kb.util.TestFixtures;
import de.tudarmstadt.ukp.inception.kb.yaml.KnowledgeBaseProfile;
import jakarta.persistence.EntityManager;

@DataJpaTest( //
showSql = false, //
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
import de.tudarmstadt.ukp.inception.schema.api.AnnotationSchemaService;
import de.tudarmstadt.ukp.inception.support.uima.SegmentationUtils;
import de.tudarmstadt.ukp.inception.ui.core.docanno.layer.DocumentMetadataLayerSupport;
import de.tudarmstadt.ukp.inception.ui.core.docanno.recommendation.MetadataSuggestionSupport;

@ExtendWith(MockitoExtension.class)
class MetadataSuggestionExtractionTest
Expand Down
Loading

0 comments on commit b558448

Please sign in to comment.