diff --git a/build.gradle b/build.gradle index 6681afaf3e3..3daa53628ce 100644 --- a/build.gradle +++ b/build.gradle @@ -19,7 +19,6 @@ plugins { id 'application' id "com.simonharrer.modernizer" version '1.8.0-1' id 'me.champeau.gradle.jmh' version '0.5.0' - //id 'net.ltgt.errorprone' version '0.8.1' id 'com.github.ben-manes.versions' version '0.28.0' id 'org.javamodularity.moduleplugin' version '1.5.0' id 'org.openjfx.javafxplugin' version '0.0.8' @@ -46,10 +45,14 @@ apply from: 'eclipse.gradle' group = "org.jabref" version = project.findProperty('projVersion') ?: '100.0.0' -sourceCompatibility = 13 -targetCompatibility = 13 +java { + sourceCompatibility = JavaVersion.VERSION_13 + targetCompatibility = JavaVersion.VERSION_13 +} -mainClassName = "$moduleName/org.jabref.JabRefLauncher" +application { + mainClassName = "$moduleName/org.jabref.JabRefLauncher" +} // TODO: Ugly workaround to temporarily ignore build errors to dependencies of latex2unicode // These should be removed, as well as the files in the lib folder, as soon as they have valid module names @@ -91,7 +94,6 @@ repositories { } configurations { - //errorprone libreoffice // TODO: Remove the following workaround for split error messages such as @@ -108,121 +110,108 @@ javafx { dependencies { // Include all jar-files in the 'lib' folder as dependencies - compile fileTree(dir: 'lib', includes: ['*.jar']) + implementation fileTree(dir: 'lib', includes: ['*.jar']) - compile 'org.apache.pdfbox:pdfbox:2.0.18' - compile 'org.apache.pdfbox:fontbox:2.0.18' - compile 'org.apache.pdfbox:xmpbox:2.0.18' + implementation 'org.apache.pdfbox:pdfbox:2.0.18' + implementation 'org.apache.pdfbox:fontbox:2.0.18' + implementation 'org.apache.pdfbox:xmpbox:2.0.18' - compile group: 'org.apache.commons', name: 'commons-csv', version: '1.8' + implementation group: 'org.apache.commons', name: 'commons-csv', version: '1.8' - compile group: 'org.apache.tika', name: 'tika-core', version: '1.23' + implementation group: 'org.apache.tika', name: 'tika-core', version: '1.23' // required for reading write-protected PDFs - see https://github.com/JabRef/jabref/pull/942#issuecomment-209252635 - compile 'org.bouncycastle:bcprov-jdk15on:1.64' + implementation 'org.bouncycastle:bcprov-jdk15on:1.64' - compile 'commons-cli:commons-cli:1.4' + implementation 'commons-cli:commons-cli:1.4' // For Java 9+ compatibility, we include a bundled version of the libreoffice libraries // See https://bugs.documentfoundation.org/show_bug.cgi?id=117331#c8 for background information // Use the task bundleLibreOffice to update the bundled jar - //compile "org.libreoffice:juh:6.2.3" - //compile "org.libreoffice:jurt:6.2.3" - //compile "org.libreoffice:ridl:6.2.3" - //compile "org.libreoffice:unoil:6.2.3" + //implementation "org.libreoffice:juh:6.2.3" + //implementation "org.libreoffice:jurt:6.2.3" + //implementation "org.libreoffice:ridl:6.2.3" + //implementation "org.libreoffice:unoil:6.2.3" - compile 'io.github.java-diff-utils:java-diff-utils:4.5' - compile 'info.debatty:java-string-similarity:1.2.1' + implementation 'io.github.java-diff-utils:java-diff-utils:4.5' + implementation 'info.debatty:java-string-similarity:1.2.1' antlr3 'org.antlr:antlr:3.5.2' - compile 'org.antlr:antlr-runtime:3.5.2' + implementation 'org.antlr:antlr-runtime:3.5.2' antlr4 'org.antlr:antlr4:4.8-1' - compile 'org.antlr:antlr4-runtime:4.8-1' + implementation 'org.antlr:antlr4-runtime:4.8-1' - compile group: 'org.mariadb.jdbc', name: 'mariadb-java-client', version: '2.5.4' + implementation group: 'org.mariadb.jdbc', name: 'mariadb-java-client', version: '2.5.4' - compile 'org.postgresql:postgresql:42.2.10' + implementation 'org.postgresql:postgresql:42.2.10' - compile ('com.oracle.ojdbc:ojdbc10:19.3.0.0') { + implementation ('com.oracle.ojdbc:ojdbc10:19.3.0.0') { // causing module issues exclude module: 'oraclepki' } - compile ('com.google.guava:guava:28.2-jre') { + implementation ('com.google.guava:guava:28.2-jre') { // TODO: Remove this as soon as https://github.com/google/guava/issues/2960 is fixed exclude module: "jsr305" } - compile group: 'jakarta.annotation', name: 'jakarta.annotation-api', version: '1.3.5' + implementation group: 'jakarta.annotation', name: 'jakarta.annotation-api', version: '1.3.5' // JavaFX stuff - compile 'de.jensd:fontawesomefx-commons:11.0' - compile 'de.jensd:fontawesomefx-materialdesignfont:1.7.22-11' - compile 'de.saxsys:mvvmfx-validation:1.9.0-SNAPSHOT' - compile 'de.saxsys:mvvmfx:1.8.0' - compile 'org.fxmisc.easybind:easybind:1.0.3' - compile 'org.fxmisc.flowless:flowless:0.6.1' - compile 'org.fxmisc.richtext:richtextfx:0.10.4' - 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.1' - - compile 'org.jsoup:jsoup:1.12.2' - compile 'com.konghq:unirest-java:3.6.00' - - compile 'org.slf4j:slf4j-api:2.0.0-alpha1' - compile group: 'org.apache.logging.log4j', name: 'log4j-jcl', version: '3.0.0-SNAPSHOT' - compile group: 'org.apache.logging.log4j', name: 'log4j-slf4j18-impl', version: '3.0.0-SNAPSHOT' - compile group: 'org.apache.logging.log4j', name: 'log4j-plugins', version: '3.0.0-SNAPSHOT' + implementation 'de.jensd:fontawesomefx-commons:11.0' + implementation 'de.jensd:fontawesomefx-materialdesignfont:1.7.22-11' + implementation 'de.saxsys:mvvmfx-validation:1.9.0-SNAPSHOT' + implementation 'de.saxsys:mvvmfx:1.8.0' + implementation 'org.fxmisc.easybind:easybind:1.0.3' + implementation 'org.fxmisc.flowless:flowless:0.6.1' + implementation 'org.fxmisc.richtext:richtextfx:0.10.4' + implementation group: 'org.glassfish.hk2.external', name: 'jakarta.inject', version: '2.6.1' + implementation 'com.jfoenix:jfoenix:9.0.9' + implementation 'org.controlsfx:controlsfx:11.0.1' + + implementation 'org.jsoup:jsoup:1.12.2' + implementation 'com.konghq:unirest-java:3.6.00' + + implementation 'org.slf4j:slf4j-api:2.0.0-alpha1' + implementation group: 'org.apache.logging.log4j', name: 'log4j-jcl', version: '3.0.0-SNAPSHOT' + implementation group: 'org.apache.logging.log4j', name: 'log4j-slf4j18-impl', version: '3.0.0-SNAPSHOT' + implementation group: 'org.apache.logging.log4j', name: 'log4j-plugins', version: '3.0.0-SNAPSHOT' implementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: '3.0.0-SNAPSHOT' - compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '3.0.0-SNAPSHOT' + implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: '3.0.0-SNAPSHOT' annotationProcessor group: 'org.apache.logging.log4j', name: 'log4j-core', version: '3.0.0-SNAPSHOT' - compile 'de.undercouch:citeproc-java:2.0.0' + implementation 'de.undercouch:citeproc-java:2.0.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' + implementation group: 'jakarta.activation', name: 'jakarta.activation-api', version: '1.2.1' + implementation group: 'jakarta.xml.bind', name: 'jakarta.xml.bind-api', version: '2.3.2' + implementation group: 'org.glassfish.jaxb', name: 'jaxb-runtime', version: '2.3.2' - compile ('com.github.tomtung:latex2unicode_2.12:0.2.6') { + implementation ('com.github.tomtung:latex2unicode_2.12:0.2.6') { exclude module: 'fastparse_2.12' } - /* - TODO: Reenable error prone as soon as https://github.com/google/error-prone/issues/1210 is fixed - errorprone ('com.google.errorprone:error_prone_core:2.3.2') { - exclude module: "jsr305" - exclude group: 'org.checkerframework', module: 'checker-qual' - exclude group: 'com.google.errorprone', module: 'error_prone_annotation' - exclude group: 'com.google.errorprone', module: 'error_prone_annotations' - exclude group: 'com.google.errorprone', module: 'error_prone_check_api' - } - */ - - compile group: 'com.microsoft.azure', name: 'applicationinsights-core', version: '2.4.1' - compile (group: 'com.microsoft.azure', name: 'applicationinsights-logging-log4j2', version: '2.4.1') { + implementation group: 'com.microsoft.azure', name: 'applicationinsights-core', version: '2.4.1' + implementation (group: 'com.microsoft.azure', name: 'applicationinsights-logging-log4j2', version: '2.4.1') { exclude module: "log4j-core" } - testCompile 'io.github.classgraph:classgraph:4.8.65' + testImplementation 'io.github.classgraph:classgraph:4.8.65' testImplementation 'org.junit.jupiter:junit-jupiter:5.6.0' testRuntimeOnly 'org.junit.vintage:junit-vintage-engine:5.6.0' - testCompile 'org.junit.platform:junit-platform-launcher:1.6.0' + testImplementation 'org.junit.platform:junit-platform-launcher:1.6.0' - testCompile 'net.bytebuddy:byte-buddy-parent:1.10.8' + testImplementation 'net.bytebuddy:byte-buddy-parent:1.10.8' testRuntime group: 'org.apache.logging.log4j', name: 'log4j-core', version: '3.0.0-SNAPSHOT' testRuntime group: 'org.apache.logging.log4j', name: 'log4j-jul', version: '3.0.0-SNAPSHOT' - testCompile 'org.mockito:mockito-core:3.3.0' - //testCompile 'com.github.tomakehurst:wiremock:2.24.1' - testCompile 'org.xmlunit:xmlunit-core:2.6.3' - testCompile 'org.xmlunit:xmlunit-matchers:2.6.3' - testCompile 'com.tngtech.archunit:archunit-junit5-api:0.13.1' - //testRuntime 'com.tngtech.archunit:archunit-junit5-engine:0.13.0' - testCompile "org.testfx:testfx-core:4.0.17-alpha-SNAPSHOT" - testCompile "org.testfx:testfx-junit5:4.0.17-alpha-SNAPSHOT" - testCompile "org.hamcrest:hamcrest-library:2.2" + testImplementation 'org.mockito:mockito-core:3.3.0' + testImplementation 'org.xmlunit:xmlunit-core:2.6.3' + testImplementation 'org.xmlunit:xmlunit-matchers:2.6.3' + testImplementation 'com.tngtech.archunit:archunit-junit5-api:0.13.1' + testImplementation "org.testfx:testfx-core:4.0.17-alpha-SNAPSHOT" + testImplementation "org.testfx:testfx-junit5:4.0.17-alpha-SNAPSHOT" + testImplementation "org.hamcrest:hamcrest-library:2.2" checkstyle 'com.puppycrawl.tools:checkstyle:8.29' xjc group: 'org.glassfish.jaxb', name: 'jaxb-xjc', version: '2.3.2' @@ -310,7 +299,6 @@ processResources { } } - task generateSource(dependsOn: ["generateBstGrammarSource", "generateSearchGrammarSource", "generateMedlineSource", @@ -379,7 +367,6 @@ task generateModsSource(type: XjcTask) { } tasks.withType(JavaCompile) { - // use UTF-8 options.encoding = 'UTF-8' } @@ -552,12 +539,6 @@ checkstyle { sourceSets = [] } -modernizer { - // We have more than 20 issues, which are not fixed yet. Nevertheless, we produce the modernizer output. - // See https://github.com/andrewgaul/modernizer-maven-plugin for more information on modernizer - failOnViolations = false -} - // Release tasks task deleteInstallerTemp(type: Delete) { delete "$buildDir/installer" diff --git a/docs/README.md b/docs/README.md index 77a97ec85c4..efaebcf04e8 100644 --- a/docs/README.md +++ b/docs/README.md @@ -2,9 +2,15 @@ This page presents all development informatation around JabRef. For users documentation see . +## Excersises + +Uni Basel offers a German (🇩🇪) Software Engineering course which uses JabRef as one example. +Look at [Exercise 5](https://github.com/unibas-marcelluethi/software-engineering/blob/master/docs/week5/exercises/practical-exercises.md) for an exercise where some important points of JabRef are touched. + ## How tos -- [Sync your fork with the JabRef repository](https://help.github.com/articles/syncing-a-fork/) +- External: [Sync your fork with the JabRef repository](https://help.github.com/articles/syncing-a-fork/) +- External (🇩🇪): Branches and pull requests: ## Command Line diff --git a/docs/code-quality.md b/docs/code-quality.md index 725d292b3c8..717d9caf039 100644 --- a/docs/code-quality.md +++ b/docs/code-quality.md @@ -2,7 +2,7 @@ We monitor the general source code quality at three places: -* [codacy](https://www.codacy.com/) is a hosted service to monitor code quality. The code quality analysis for JabRef is available at , especially the [list of open issues](https://app.codacy.com/gh/JabRef/jabref/issues/index). +* [codacy](https://www.codacy.com/) is a hosted service to monitor code quality. It thereby combines the results of available open source code quality checkers such as [Checkstyle](https://checkstyle.sourceforge.io/) or [PMD](https://pmd.github.io/). The code quality analysis for JabRef is available at , especially the [list of open issues](https://app.codacy.com/gh/JabRef/jabref/issues/index). In case a rule feels wrong, it is most likely a PMD rule. The JabRef team can change the configuration at . * [codecov](https://codecov.io/) is a solution to check code coverage of test cases. The code coverage metrics for JabRef are available at . * [Teamscale](https://www.cqse.eu/de/produkte/teamscale/landing/) is a popular German product analyzing code quality. The analysis results are available at . diff --git a/src/main/java/org/jabref/gui/JabRefFrame.java b/src/main/java/org/jabref/gui/JabRefFrame.java index 64261e76c9b..3ac91212dbf 100644 --- a/src/main/java/org/jabref/gui/JabRefFrame.java +++ b/src/main/java/org/jabref/gui/JabRefFrame.java @@ -653,6 +653,7 @@ private MenuBar createMenu() { Menu edit = new Menu(Localization.lang("Edit")); Menu library = new Menu(Localization.lang("Library")); Menu quality = new Menu(Localization.lang("Quality")); + Menu lookup = new Menu(Localization.lang("Lookup")); Menu view = new Menu(Localization.lang("View")); Menu tools = new Menu(Localization.lang("Tools")); Menu options = new Menu(Localization.lang("Options")); @@ -764,6 +765,10 @@ private MenuBar createMenu() { factory.createMenuItem(StandardActions.SET_FILE_LINKS, new AutoLinkFilesAction(this, prefs, stateManager, undoManager, Globals.TASK_EXECUTOR)) ); + lookup.getItems().addAll( + factory.createMenuItem(StandardActions.FIND_DUPLICATES, new DuplicateSearch(this, dialogService, stateManager)) + ); + // PushToApplication final PushToApplicationAction pushToApplicationAction = pushToApplicationsManager.getPushToApplicationAction(); final MenuItem pushToApplicationMenuItem = factory.createMenuItem(pushToApplicationAction.getActionInformation(), pushToApplicationAction); diff --git a/src/main/java/org/jabref/gui/entryeditor/LatexCitationsTabViewModel.java b/src/main/java/org/jabref/gui/entryeditor/LatexCitationsTabViewModel.java index 9ef038f50b5..13546cbc64e 100644 --- a/src/main/java/org/jabref/gui/entryeditor/LatexCitationsTabViewModel.java +++ b/src/main/java/org/jabref/gui/entryeditor/LatexCitationsTabViewModel.java @@ -65,7 +65,7 @@ public LatexCitationsTabViewModel(BibDatabaseContext databaseContext, Preference this.preferencesService = preferencesService; this.taskExecutor = taskExecutor; this.dialogService = dialogService; - this.directory = new SimpleObjectProperty<>(databaseContext.getMetaData().getLaTexFileDirectory(preferencesService.getUser()) + this.directory = new SimpleObjectProperty<>(databaseContext.getMetaData().getLatexFileDirectory(preferencesService.getUser()) .orElseGet(preferencesService::getWorkingDir)); this.citationList = FXCollections.observableArrayList(); this.status = new SimpleObjectProperty<>(Status.IN_PROGRESS); @@ -126,7 +126,7 @@ private void cancelSearch() { } private Collection searchAndParse(String citeKey) throws IOException { - Path newDirectory = databaseContext.getMetaData().getLaTexFileDirectory(preferencesService.getUser()) + Path newDirectory = databaseContext.getMetaData().getLatexFileDirectory(preferencesService.getUser()) .orElseGet(preferencesService::getWorkingDir); if (texParserResult == null || !newDirectory.equals(directory.get())) { @@ -168,7 +168,7 @@ public void setLatexDirectory() { .withInitialDirectory(directory.get()).build(); dialogService.showDirectorySelectionDialog(directoryDialogConfiguration).ifPresent(selectedDirectory -> - databaseContext.getMetaData().setLaTexFileDirectory(preferencesService.getUser(), selectedDirectory.toAbsolutePath())); + databaseContext.getMetaData().setLatexFileDirectory(preferencesService.getUser(), selectedDirectory.toAbsolutePath())); init(currentEntry); } diff --git a/src/main/java/org/jabref/gui/fieldeditors/URLUtil.java b/src/main/java/org/jabref/gui/fieldeditors/URLUtil.java index 5ab4a3b8e87..fc0dd3f3df8 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/URLUtil.java +++ b/src/main/java/org/jabref/gui/fieldeditors/URLUtil.java @@ -1,6 +1,5 @@ package org.jabref.gui.fieldeditors; -import java.io.UnsupportedEncodingException; import java.net.MalformedURLException; import java.net.URL; import java.net.URLDecoder; @@ -53,7 +52,7 @@ public static String cleanGoogleSearchURL(String url) { if (pair.startsWith("url=")) { String value = pair.substring(pair.indexOf('=') + 1); - String decode = URLDecoder.decode(value, StandardCharsets.UTF_8.name()); + String decode = URLDecoder.decode(value, StandardCharsets.UTF_8); // url? if (decode.matches(URL_EXP)) { return decode; @@ -61,7 +60,7 @@ public static String cleanGoogleSearchURL(String url) { } } return url; - } catch (UnsupportedEncodingException | MalformedURLException e) { + } catch (MalformedURLException e) { return url; } } diff --git a/src/main/java/org/jabref/gui/groups/GroupDialogViewModel.java b/src/main/java/org/jabref/gui/groups/GroupDialogViewModel.java index 47a2c88f52f..2a465886d3d 100644 --- a/src/main/java/org/jabref/gui/groups/GroupDialogViewModel.java +++ b/src/main/java/org/jabref/gui/groups/GroupDialogViewModel.java @@ -392,7 +392,7 @@ public void openHelpPage() { private List getFileDirectoriesAsPaths() { List fileDirs = new ArrayList<>(); MetaData metaData = currentDatabase.getMetaData(); - metaData.getLaTexFileDirectory(preferencesService.getFilePreferences().getUser()).ifPresent(fileDirs::add); + metaData.getLatexFileDirectory(preferencesService.getFilePreferences().getUser()).ifPresent(fileDirs::add); return fileDirs; } diff --git a/src/main/java/org/jabref/gui/libraryproperties/LibraryPropertiesDialog.fxml b/src/main/java/org/jabref/gui/libraryproperties/LibraryPropertiesDialog.fxml index 7d43bd84e46..50faf887c78 100644 --- a/src/main/java/org/jabref/gui/libraryproperties/LibraryPropertiesDialog.fxml +++ b/src/main/java/org/jabref/gui/libraryproperties/LibraryPropertiesDialog.fxml @@ -65,9 +65,9 @@