From b55844800c7268860bbdd9a9e57e2d3c70d348e7 Mon Sep 17 00:00:00 2001 From: Richard Eckart de Castilho Date: Sun, 25 Feb 2024 12:14:33 +0100 Subject: [PATCH] #3611 - Upgrade to Spring 6, Boot 3, Wicket 10, etc. - Adjust boot loader - Adjust dependencies --- inception/inception-app-webapp/pom.xml | 22 +++---- ...ExtensibleClasspathEnabledWarLauncher.java | 58 ++++++------------- inception/inception-concept-linking/pom.xml | 10 ---- inception/inception-dependencies/pom.xml | 24 ++++++-- .../pom.xml | 26 --------- inception/inception-imls-external/pom.xml | 10 ---- inception/inception-imls-opennlp/pom.xml | 24 -------- inception/inception-imls-stringmatch/pom.xml | 12 ---- inception/inception-imls-weblicht/pom.xml | 4 -- ...owledgeBaseServiceImplIntegrationTest.java | 1 - .../MetadataSuggestionExtractionTest.java | 1 - inception/inception-plugin-parent/pom.xml | 8 +-- inception/inception-ui-curation/pom.xml | 4 -- .../inception-ui-dashboard-activity/pom.xml | 5 -- .../ActivitiesDashletControllerImpl.java | 3 +- inception/pom.xml | 14 ++--- pom.xml | 4 +- 17 files changed, 54 insertions(+), 176 deletions(-) diff --git a/inception/inception-app-webapp/pom.xml b/inception/inception-app-webapp/pom.xml index b9d2d241e43..cf5d33e82cb 100644 --- a/inception/inception-app-webapp/pom.xml +++ b/inception/inception-app-webapp/pom.xml @@ -513,10 +513,6 @@ org.slf4j slf4j-api - - org.slf4j - jcl-over-slf4j - org.slf4j log4j-over-slf4j @@ -536,13 +532,6 @@ log4j-layout-template-json - - - commons-logging - commons-logging - provided - - io.sentry @@ -976,11 +965,9 @@ org.hsqldb:hsqldb org.slf4j:log4j-over-slf4j - org.slf4j:jcl-over-slf4j org.apache.logging.log4j:log4j-slf4j2-impl org.apache.logging.log4j:log4j-core org.apache.logging.log4j:log4j-layout-template-json - commons-logging:commons-logging io.sentry:sentry-spring-boot-starter io.sentry:sentry-log4j2 @@ -1116,13 +1103,20 @@ true - + false standalone + + + commons-logging + commons-logging + + diff --git a/inception/inception-boot-loader/src/main/java/de/tudarmstadt/ukp/inception/bootloader/ExtensibleClasspathEnabledWarLauncher.java b/inception/inception-boot-loader/src/main/java/de/tudarmstadt/ukp/inception/bootloader/ExtensibleClasspathEnabledWarLauncher.java index 1a26b3f2d18..dac6e162ce4 100644 --- a/inception/inception-boot-loader/src/main/java/de/tudarmstadt/ukp/inception/bootloader/ExtensibleClasspathEnabledWarLauncher.java +++ b/inception/inception-boot-loader/src/main/java/de/tudarmstadt/ukp/inception/bootloader/ExtensibleClasspathEnabledWarLauncher.java @@ -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 getClassPathArchivesIterator() throws Exception + protected Set getClassPathUrls() throws Exception { - List archives = new ArrayList<>(); - super.getClassPathArchivesIterator().forEachRemaining(archives::add); + Set urls = new LinkedHashSet<>(super.getClassPathUrls()); Path extraLibPath = Paths.get(getApplicationHome() + EXTRA_LIB); @@ -72,7 +59,7 @@ protected Iterator 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 { @@ -80,18 +67,7 @@ protected Iterator getClassPathArchivesIterator() throws Exception + "] - 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) @@ -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"))); diff --git a/inception/inception-concept-linking/pom.xml b/inception/inception-concept-linking/pom.xml index 1840b51b609..7b024bfe81b 100644 --- a/inception/inception-concept-linking/pom.xml +++ b/inception/inception-concept-linking/pom.xml @@ -238,14 +238,6 @@ dkpro-core-io-conll-asl test - - - org.yaml - snakeyaml - - 1.33 - test - @@ -255,8 +247,6 @@ maven-dependency-plugin - - org.yaml:snakeyaml org.danekja:jdk-serializable-functional javax.persistence:javax.persistence-api diff --git a/inception/inception-dependencies/pom.xml b/inception/inception-dependencies/pom.xml index bb8a3bde2c4..024b7ddaedf 100644 --- a/inception/inception-dependencies/pom.xml +++ b/inception/inception-dependencies/pom.xml @@ -433,11 +433,23 @@ org.apache.pdfbox pdfbox ${pdfbox.version} + + + commons-logging + commons-logging + + org.apache.pdfbox fontbox ${pdfbox.version} + + + commons-logging + commons-logging + + @@ -462,6 +474,12 @@ commons-beanutils commons-beanutils 1.9.4 + + + commons-logging + commons-logging + + org.apache.commons @@ -691,11 +709,6 @@ validation-api 2.0.1.Final - - javax.persistence - javax.persistence-api - 2.2 - org.javassist javassist @@ -1209,7 +1222,6 @@ org.codelibs.opensearch opensearch-runner - ${opensearch.version}.0 diff --git a/inception/inception-example-imls-data-majority/pom.xml b/inception/inception-example-imls-data-majority/pom.xml index cae263c2b55..82e6f61682d 100644 --- a/inception/inception-example-imls-data-majority/pom.xml +++ b/inception/inception-example-imls-data-majority/pom.xml @@ -129,31 +129,5 @@ dkpro-core-io-conll-asl test - - - - org.yaml - snakeyaml - - 1.33 - test - - - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - - org.yaml:snakeyaml - - - - - - diff --git a/inception/inception-imls-external/pom.xml b/inception/inception-imls-external/pom.xml index e7570feef63..ea6a62f384d 100644 --- a/inception/inception-imls-external/pom.xml +++ b/inception/inception-imls-external/pom.xml @@ -142,14 +142,6 @@ dkpro-core-api-ner-asl test - - - org.yaml - snakeyaml - - 1.33 - test - @@ -160,8 +152,6 @@ maven-dependency-plugin - - org.yaml:snakeyaml com.fasterxml.jackson.core:jackson-core diff --git a/inception/inception-imls-opennlp/pom.xml b/inception/inception-imls-opennlp/pom.xml index 3a4bf573ac6..a53affffb34 100644 --- a/inception/inception-imls-opennlp/pom.xml +++ b/inception/inception-imls-opennlp/pom.xml @@ -176,29 +176,5 @@ dkpro-core-api-io-asl test - - - org.yaml - snakeyaml - - 1.33 - test - - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - - org.yaml:snakeyaml - - - - - - diff --git a/inception/inception-imls-stringmatch/pom.xml b/inception/inception-imls-stringmatch/pom.xml index d6b628f4aab..fafdfe8ccd0 100644 --- a/inception/inception-imls-stringmatch/pom.xml +++ b/inception/inception-imls-stringmatch/pom.xml @@ -222,14 +222,6 @@ hsqldb test - - - org.yaml - snakeyaml - - 1.33 - test - @@ -238,10 +230,6 @@ org.apache.maven.plugins maven-dependency-plugin - - - org.yaml:snakeyaml - org.hsqldb:hsqldb diff --git a/inception/inception-imls-weblicht/pom.xml b/inception/inception-imls-weblicht/pom.xml index 8f97c628c44..53683fbaad3 100644 --- a/inception/inception-imls-weblicht/pom.xml +++ b/inception/inception-imls-weblicht/pom.xml @@ -26,10 +26,6 @@ inception-imls-weblicht INCEpTION - ML - WebLicht - - javax.persistence - javax.persistence-api - eu.clarin.weblicht wlfxb diff --git a/inception/inception-kb/src/test/java/de/tudarmstadt/ukp/inception/kb/KnowledgeBaseServiceImplIntegrationTest.java b/inception/inception-kb/src/test/java/de/tudarmstadt/ukp/inception/kb/KnowledgeBaseServiceImplIntegrationTest.java index 9e59d924f4d..fcad556888d 100644 --- a/inception/inception-kb/src/test/java/de/tudarmstadt/ukp/inception/kb/KnowledgeBaseServiceImplIntegrationTest.java +++ b/inception/inception-kb/src/test/java/de/tudarmstadt/ukp/inception/kb/KnowledgeBaseServiceImplIntegrationTest.java @@ -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, // diff --git a/inception/inception-layer-docmetadata/src/test/java/de/tudarmstadt/ukp/inception/ui/core/docanno/recommendation/MetadataSuggestionExtractionTest.java b/inception/inception-layer-docmetadata/src/test/java/de/tudarmstadt/ukp/inception/ui/core/docanno/recommendation/MetadataSuggestionExtractionTest.java index 6480b2a1c45..be67b222091 100644 --- a/inception/inception-layer-docmetadata/src/test/java/de/tudarmstadt/ukp/inception/ui/core/docanno/recommendation/MetadataSuggestionExtractionTest.java +++ b/inception/inception-layer-docmetadata/src/test/java/de/tudarmstadt/ukp/inception/ui/core/docanno/recommendation/MetadataSuggestionExtractionTest.java @@ -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 diff --git a/inception/inception-plugin-parent/pom.xml b/inception/inception-plugin-parent/pom.xml index dced09b2866..ac8d403dbdc 100644 --- a/inception/inception-plugin-parent/pom.xml +++ b/inception/inception-plugin-parent/pom.xml @@ -45,7 +45,7 @@ provided - + org.apache.logging.log4j @@ -64,12 +64,6 @@ log4j-over-slf4j provided - - - org.slf4j - jcl-over-slf4j - provided - commons-logging diff --git a/inception/inception-ui-curation/pom.xml b/inception/inception-ui-curation/pom.xml index 0faaad12a12..294c5f6c57e 100644 --- a/inception/inception-ui-curation/pom.xml +++ b/inception/inception-ui-curation/pom.xml @@ -26,10 +26,6 @@ INCEpTION - UI - Curation jar - - javax.persistence - javax.persistence-api - org.apache.commons commons-lang3 diff --git a/inception/inception-ui-dashboard-activity/pom.xml b/inception/inception-ui-dashboard-activity/pom.xml index a3cd470a42a..4041bae58d0 100644 --- a/inception/inception-ui-dashboard-activity/pom.xml +++ b/inception/inception-ui-dashboard-activity/pom.xml @@ -26,11 +26,6 @@ INCEpTION - Dashboard - Recent activity jar - - javax.persistence - javax.persistence-api - - de.tudarmstadt.ukp.inception.app inception-documents-api diff --git a/inception/inception-ui-dashboard-activity/src/main/java/de/tudarmstadt/ukp/inception/ui/core/dashboard/activity/ActivitiesDashletControllerImpl.java b/inception/inception-ui-dashboard-activity/src/main/java/de/tudarmstadt/ukp/inception/ui/core/dashboard/activity/ActivitiesDashletControllerImpl.java index 7de228a1ed8..9ba299e9a6f 100644 --- a/inception/inception-ui-dashboard-activity/src/main/java/de/tudarmstadt/ukp/inception/ui/core/dashboard/activity/ActivitiesDashletControllerImpl.java +++ b/inception/inception-ui-dashboard-activity/src/main/java/de/tudarmstadt/ukp/inception/ui/core/dashboard/activity/ActivitiesDashletControllerImpl.java @@ -42,8 +42,6 @@ import java.util.Set; import java.util.concurrent.atomic.AtomicLong; -import javax.persistence.NoResultException; - import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; import org.springframework.web.bind.annotation.GetMapping; @@ -75,6 +73,7 @@ import de.tudarmstadt.ukp.inception.ui.core.dashboard.activity.panel.ActivityOverviewItem; import de.tudarmstadt.ukp.inception.ui.core.dashboard.activity.panel.ActivitySummary; import de.tudarmstadt.ukp.inception.ui.core.dashboard.activity.panel.ActivitySummaryItem; +import jakarta.persistence.NoResultException; import jakarta.servlet.ServletContext; @ConditionalOnWebApplication diff --git a/inception/pom.xml b/inception/pom.xml index 0b0a37d27b1..502df0d42b6 100644 --- a/inception/pom.xml +++ b/inception/pom.xml @@ -84,17 +84,17 @@ log4j-over-slf4j runtime - - - org.slf4j - jcl-over-slf4j - runtime - org.apache.logging.log4j log4j-layout-template-json + + + org.springframework + spring-jcl + runtime + commons-logging @@ -422,8 +422,8 @@ org.apache.logging.log4j:log4j-layout-template-json org.apache.logging.log4j:log4j-core org.slf4j:log4j-over-slf4j - org.slf4j:jcl-over-slf4j commons-logging:commons-logging + org.springframework:spring-jcl diff --git a/pom.xml b/pom.xml index 860ba119a87..8db4350e8bd 100644 --- a/pom.xml +++ b/pom.xml @@ -129,7 +129,7 @@ - 1.3.14 + 1.3.13 @@ -151,7 +151,7 @@ 20230227 2.6.0 2.16.1 - 1.33 + 2.2 4.12.0 3.8.0