Skip to content

Commit 84436d7

Browse files
authored
Switch to Jakarta libraries (#5247)
* Move to jakarta https://wiki.eclipse.org/New_Maven_Coordinates * Revert "Switch from tika-parsers to tika-core (#5217)" This reverts commit 29cf4f2 * Revert "Revert "Switch from tika-parsers to tika-core (#5217)"" This reverts commit be558fe * Fix build * Fix build
1 parent 2ad1d95 commit 84436d7

File tree

3 files changed

+76
-70
lines changed

3 files changed

+76
-70
lines changed

build.gradle

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,10 @@ configurations {
102102
errorprone
103103
libreoffice
104104

105-
// TODO: Workaround for "ResolutionException: Modules java.annotation and jsr305 export package javax.annotation to module httpcore.nio"
105+
// TODO: Remove the following workaround for split error messages such as
106+
// error: module java.xml.bind reads package javax.annotation from both jsr305 and java.annotation
106107
compile {
107-
exclude group: 'com.google.code.findbugs', module: 'jsr305'
108+
exclude group: "javax.activation"
108109
}
109110
}
110111

@@ -149,9 +150,12 @@ dependencies {
149150

150151
compile 'org.postgresql:postgresql:42.2.6'
151152

152-
compile 'com.google.guava:guava:28.0-jre'
153+
compile ('com.google.guava:guava:28.0-jre') {
154+
// TODO: Remove this as soon as https://github.com/google/guava/issues/2960 is fixed
155+
exclude module: "jsr305"
156+
}
153157

154-
compile group: 'javax.annotation', name: 'javax.annotation-api', version: '1.3.2'
158+
compile group: 'jakarta.annotation', name: 'jakarta.annotation-api', version: '1.3.4'
155159

156160
// JavaFX stuff
157161
compile 'de.jensd:fontawesomefx-commons:11.0'
@@ -161,7 +165,7 @@ dependencies {
161165
compile 'org.fxmisc.easybind:easybind:1.0.3'
162166
compile 'org.fxmisc.flowless:flowless:0.6.1'
163167
compile 'org.fxmisc.richtext:richtextfx:0.10.1'
164-
compile 'javax.inject:javax.inject:1'
168+
compile group: 'org.glassfish.hk2.external', name: 'jakarta.inject', version: '2.6.1'
165169
compile 'com.jfoenix:jfoenix:9.0.9'
166170
compile 'org.controlsfx:controlsfx:11.0.0'
167171

@@ -177,9 +181,9 @@ dependencies {
177181

178182
compile 'de.undercouch:citeproc-java:1.0.1'
179183

180-
compile group: 'javax.xml.bind', name: 'jaxb-api', version: '2.3.1'
181-
compile group: 'org.glassfish.jaxb', name: 'jaxb-runtime', version: '2.3.1'
182-
compile 'com.sun.activation:javax.activation:1.2.0'
184+
compile group: 'jakarta.activation', name: 'jakarta.activation-api', version: '1.2.1'
185+
compile group: 'jakarta.xml.bind', name: 'jakarta.xml.bind-api', version: '2.3.2'
186+
compile group: 'org.glassfish.jaxb', name: 'jaxb-runtime', version: '2.3.2'
183187

184188
compile 'com.github.tomtung:latex2unicode_2.12:0.2.6'
185189

@@ -198,7 +202,9 @@ dependencies {
198202
testRuntime 'org.apache.logging.log4j:log4j-jul:2.12.1'
199203
testCompile 'org.mockito:mockito-core:3.0.0'
200204
//testCompile 'com.github.tomakehurst:wiremock:2.24.1'
201-
testCompile 'org.reflections:reflections:0.9.11'
205+
testCompile ('org.reflections:reflections:0.9.11') {
206+
exclude module: "jsr305"
207+
}
202208
testCompile 'org.xmlunit:xmlunit-core:2.6.3'
203209
testCompile 'org.xmlunit:xmlunit-matchers:2.6.3'
204210
testCompile 'com.tngtech.archunit:archunit-junit5-api:0.11.0'
@@ -604,7 +610,7 @@ jlink {
604610
// The pom.xml associated with such a non-modular artifact does not mention that the artifact depends on the removed code
605611
// (because the artifact was published when this code was still available in the JDK).
606612
forceMerge "javafx"
607-
forceMerge "controlsfx", "bcprov", "jaxb", "javax", "istack", "stax", "log4j"
613+
forceMerge "controlsfx", "bcprov", "jaxb", "istack", "stax", "log4j"
608614

609615
// TODO: Remove the following correction to the merged module
610616
// The module descriptor automatically generated by the plugin for the merged module contained some invalid entries.
@@ -637,7 +643,6 @@ jlink {
637643
provides 'org.controlsfx.glyphfont.GlyphFont' with 'org.controlsfx.glyphfont.FontAwesome'
638644
provides 'org.apache.commons.logging.LogFactory' with 'org.apache.logging.log4j.jcl.LogFactoryImpl'
639645
provides 'org.slf4j.spi.SLF4JServiceProvider' with 'org.apache.logging.slf4j.SLF4JServiceProvider'
640-
provides 'javax.annotation.processing.Processor' with 'org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor'
641646
provides 'com.microsoft.applicationinsights.core.dependencies.io.grpc.ServerProvider' with 'com.microsoft.applicationinsights.core.dependencies.io.grpc.netty.shaded.io.grpc.netty.NettyServerProvider'
642647
provides 'com.microsoft.applicationinsights.core.dependencies.io.grpc.NameResolverProvider' with 'com.microsoft.applicationinsights.core.dependencies.io.grpc.internal.DnsNameResolverProvider'
643648
provides 'java.security.Provider' with 'org.bouncycastle.jce.provider.BouncyCastleProvider', 'org.bouncycastle.pqc.jcajce.provider.BouncyCastlePQCProvider'

src/main/java/module-info.java

Lines changed: 59 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,75 @@
11
open module org.jabref {
2-
exports org.jabref;
2+
exports org.jabref;
33

4-
exports org.jabref.gui;
5-
exports org.jabref.gui.logging;
6-
exports org.jabref.gui.maintable;
7-
exports org.jabref.gui.specialfields;
4+
exports org.jabref.gui;
5+
exports org.jabref.gui.logging;
6+
exports org.jabref.gui.maintable;
7+
exports org.jabref.gui.specialfields;
88

9-
exports org.jabref.model.database;
9+
exports org.jabref.model.database;
1010

11-
exports org.jabref.logic;
12-
exports org.jabref.logic.citationstyle;
13-
exports org.jabref.logic.search;
11+
exports org.jabref.logic;
12+
exports org.jabref.logic.citationstyle;
13+
exports org.jabref.logic.search;
1414

15-
// Swing
16-
requires java.desktop;
15+
// Swing
16+
requires java.desktop;
1717

18-
// SQL
19-
requires java.sql;
18+
// SQL
19+
requires java.sql;
2020

21-
// JavaFX
22-
requires javafx.graphics;
23-
requires javafx.swing;
24-
requires javafx.controls;
25-
requires javafx.web;
26-
requires javafx.fxml;
27-
requires afterburner.fx;
28-
requires com.jfoenix;
29-
requires de.saxsys.mvvmfx;
30-
requires de.jensd.fx.fontawesomefx.commons;
31-
requires de.jensd.fx.fontawesomefx.materialdesignicons;
32-
requires org.controlsfx.controls;
21+
// JavaFX
22+
requires javafx.graphics;
23+
requires javafx.swing;
24+
requires javafx.controls;
25+
requires javafx.web;
26+
requires javafx.fxml;
27+
requires afterburner.fx;
28+
requires com.jfoenix;
29+
requires de.saxsys.mvvmfx;
30+
requires de.jensd.fx.fontawesomefx.commons;
31+
requires de.jensd.fx.fontawesomefx.materialdesignicons;
32+
requires org.controlsfx.controls;
3333

34-
provides com.airhacks.afterburner.views.ResourceLocator
35-
with org.jabref.gui.util.JabRefResourceLocator;
34+
provides com.airhacks.afterburner.views.ResourceLocator
35+
with org.jabref.gui.util.JabRefResourceLocator;
3636

37-
provides com.airhacks.afterburner.injection.PresenterFactory
38-
with org.jabref.gui.DefaultInjector;
37+
provides com.airhacks.afterburner.injection.PresenterFactory
38+
with org.jabref.gui.DefaultInjector;
3939

40-
// Logging
41-
requires org.slf4j;
42-
requires org.apache.logging.log4j;
43-
requires org.apache.logging.log4j.core;
44-
requires applicationinsights.logging.log4j2;
40+
// Logging
41+
requires org.slf4j;
42+
requires org.apache.logging.log4j;
43+
requires org.apache.logging.log4j.core;
44+
requires applicationinsights.logging.log4j2;
4545

46-
// Preferences and XML
47-
requires java.prefs;
48-
requires java.xml.bind;
49-
requires jdk.xml.dom;
46+
// Preferences and XML
47+
requires java.prefs;
48+
requires java.xml.bind;
49+
requires jdk.xml.dom;
5050

51-
// Annotations (@PostConstruct)
52-
requires java.annotation;
51+
// Annotations (@PostConstruct)
52+
requires java.annotation;
5353

54-
// Microsoft application insights
55-
requires applicationinsights.core;
54+
// Microsoft application insights
55+
requires applicationinsights.core;
5656

57-
// Libre Office
58-
requires org.jabref.thirdparty.libreoffice;
57+
// Libre Office
58+
requires org.jabref.thirdparty.libreoffice;
5959

60-
// Other modules
61-
requires commons.logging;
62-
requires com.google.common;
63-
requires easybind;
64-
requires javax.inject;
65-
requires pdfbox;
66-
requires reactfx;
67-
requires commons.cli;
68-
requires httpclient;
69-
requires com.github.tomtung.latex2unicode;
70-
requires jbibtex;
71-
requires citeproc.java;
72-
requires antlr.runtime;
73-
requires commons.lang3;
60+
// Other modules
61+
requires commons.logging;
62+
requires com.google.common;
63+
requires easybind;
64+
requires jakarta.inject;
65+
requires pdfbox;
66+
requires reactfx;
67+
requires commons.cli;
68+
requires httpclient;
69+
requires com.github.tomtung.latex2unicode;
70+
requires jbibtex;
71+
requires citeproc.java;
72+
requires antlr.runtime;
73+
requires commons.lang3;
74+
requires xmpbox;
7475
}

src/main/java/org/jabref/logic/l10n/Localization.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public static String lang(String key, String... params) {
6666
public static void setLanguage(Language language) {
6767
Optional<Locale> knownLanguage = Language.convertToSupportedLocale(language);
6868
final Locale defaultLocale = Locale.getDefault();
69-
if (!knownLanguage.isPresent()) {
69+
if (knownLanguage.isEmpty()) {
7070
LOGGER.warn("Language " + language + " is not supported by JabRef (Default:" + defaultLocale + ")");
7171
setLanguage(Language.ENGLISH);
7272
return;

0 commit comments

Comments
 (0)