Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to Jakarta libraries #5247

Merged
merged 5 commits into from
Aug 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 16 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,10 @@ configurations {
errorprone
libreoffice

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

Expand Down Expand Up @@ -149,9 +150,12 @@ dependencies {

compile 'org.postgresql:postgresql:42.2.6'

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

compile group: 'javax.annotation', name: 'javax.annotation-api', version: '1.3.2'
compile group: 'jakarta.annotation', name: 'jakarta.annotation-api', version: '1.3.4'

// JavaFX stuff
compile 'de.jensd:fontawesomefx-commons:11.0'
Expand All @@ -161,7 +165,7 @@ dependencies {
compile 'org.fxmisc.easybind:easybind:1.0.3'
compile 'org.fxmisc.flowless:flowless:0.6.1'
compile 'org.fxmisc.richtext:richtextfx:0.10.1'
compile 'javax.inject:javax.inject:1'
compile group: 'org.glassfish.hk2.external', name: 'jakarta.inject', version: '2.6.1'
compile 'com.jfoenix:jfoenix:9.0.9'
compile 'org.controlsfx:controlsfx:11.0.0'

Expand All @@ -177,9 +181,9 @@ dependencies {

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

compile group: 'javax.xml.bind', name: 'jaxb-api', version: '2.3.1'
compile group: 'org.glassfish.jaxb', name: 'jaxb-runtime', version: '2.3.1'
compile 'com.sun.activation:javax.activation:1.2.0'
compile group: 'jakarta.activation', name: 'jakarta.activation-api', version: '1.2.1'
compile group: 'jakarta.xml.bind', name: 'jakarta.xml.bind-api', version: '2.3.2'
compile group: 'org.glassfish.jaxb', name: 'jaxb-runtime', version: '2.3.2'

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

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

// TODO: Remove the following correction to the merged module
// The module descriptor automatically generated by the plugin for the merged module contained some invalid entries.
Expand Down Expand Up @@ -637,7 +643,6 @@ jlink {
provides 'org.controlsfx.glyphfont.GlyphFont' with 'org.controlsfx.glyphfont.FontAwesome'
provides 'org.apache.commons.logging.LogFactory' with 'org.apache.logging.log4j.jcl.LogFactoryImpl'
provides 'org.slf4j.spi.SLF4JServiceProvider' with 'org.apache.logging.slf4j.SLF4JServiceProvider'
provides 'javax.annotation.processing.Processor' with 'org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor'
provides 'com.microsoft.applicationinsights.core.dependencies.io.grpc.ServerProvider' with 'com.microsoft.applicationinsights.core.dependencies.io.grpc.netty.shaded.io.grpc.netty.NettyServerProvider'
provides 'com.microsoft.applicationinsights.core.dependencies.io.grpc.NameResolverProvider' with 'com.microsoft.applicationinsights.core.dependencies.io.grpc.internal.DnsNameResolverProvider'
provides 'java.security.Provider' with 'org.bouncycastle.jce.provider.BouncyCastleProvider', 'org.bouncycastle.pqc.jcajce.provider.BouncyCastlePQCProvider'
Expand Down
117 changes: 59 additions & 58 deletions src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -1,74 +1,75 @@
open module org.jabref {
exports org.jabref;
exports org.jabref;

exports org.jabref.gui;
exports org.jabref.gui.logging;
exports org.jabref.gui.maintable;
exports org.jabref.gui.specialfields;
exports org.jabref.gui;
exports org.jabref.gui.logging;
exports org.jabref.gui.maintable;
exports org.jabref.gui.specialfields;

exports org.jabref.model.database;
exports org.jabref.model.database;

exports org.jabref.logic;
exports org.jabref.logic.citationstyle;
exports org.jabref.logic.search;
exports org.jabref.logic;
exports org.jabref.logic.citationstyle;
exports org.jabref.logic.search;

// Swing
requires java.desktop;
// Swing
requires java.desktop;

// SQL
requires java.sql;
// SQL
requires java.sql;

// JavaFX
requires javafx.graphics;
requires javafx.swing;
requires javafx.controls;
requires javafx.web;
requires javafx.fxml;
requires afterburner.fx;
requires com.jfoenix;
requires de.saxsys.mvvmfx;
requires de.jensd.fx.fontawesomefx.commons;
requires de.jensd.fx.fontawesomefx.materialdesignicons;
requires org.controlsfx.controls;
// JavaFX
requires javafx.graphics;
requires javafx.swing;
requires javafx.controls;
requires javafx.web;
requires javafx.fxml;
requires afterburner.fx;
requires com.jfoenix;
requires de.saxsys.mvvmfx;
requires de.jensd.fx.fontawesomefx.commons;
requires de.jensd.fx.fontawesomefx.materialdesignicons;
requires org.controlsfx.controls;

provides com.airhacks.afterburner.views.ResourceLocator
with org.jabref.gui.util.JabRefResourceLocator;
provides com.airhacks.afterburner.views.ResourceLocator
with org.jabref.gui.util.JabRefResourceLocator;

provides com.airhacks.afterburner.injection.PresenterFactory
with org.jabref.gui.DefaultInjector;
provides com.airhacks.afterburner.injection.PresenterFactory
with org.jabref.gui.DefaultInjector;

// Logging
requires org.slf4j;
requires org.apache.logging.log4j;
requires org.apache.logging.log4j.core;
requires applicationinsights.logging.log4j2;
// Logging
requires org.slf4j;
requires org.apache.logging.log4j;
requires org.apache.logging.log4j.core;
requires applicationinsights.logging.log4j2;

// Preferences and XML
requires java.prefs;
requires java.xml.bind;
requires jdk.xml.dom;
// Preferences and XML
requires java.prefs;
requires java.xml.bind;
requires jdk.xml.dom;

// Annotations (@PostConstruct)
requires java.annotation;
// Annotations (@PostConstruct)
requires java.annotation;

// Microsoft application insights
requires applicationinsights.core;
// Microsoft application insights
requires applicationinsights.core;

// Libre Office
requires org.jabref.thirdparty.libreoffice;
// Libre Office
requires org.jabref.thirdparty.libreoffice;

// Other modules
requires commons.logging;
requires com.google.common;
requires easybind;
requires javax.inject;
requires pdfbox;
requires reactfx;
requires commons.cli;
requires httpclient;
requires com.github.tomtung.latex2unicode;
requires jbibtex;
requires citeproc.java;
requires antlr.runtime;
requires commons.lang3;
// Other modules
requires commons.logging;
requires com.google.common;
requires easybind;
requires jakarta.inject;
requires pdfbox;
requires reactfx;
requires commons.cli;
requires httpclient;
requires com.github.tomtung.latex2unicode;
requires jbibtex;
requires citeproc.java;
requires antlr.runtime;
requires commons.lang3;
requires xmpbox;
}
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/logic/l10n/Localization.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public static String lang(String key, String... params) {
public static void setLanguage(Language language) {
Optional<Locale> knownLanguage = Language.convertToSupportedLocale(language);
final Locale defaultLocale = Locale.getDefault();
if (!knownLanguage.isPresent()) {
if (knownLanguage.isEmpty()) {
LOGGER.warn("Language " + language + " is not supported by JabRef (Default:" + defaultLocale + ")");
setLanguage(Language.ENGLISH);
return;
Expand Down