Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
5c07d88
convert to jackson 3
Siedlerchr Nov 8, 2025
511f42a
checkstyle
Siedlerchr Nov 8, 2025
f5f6682
checkstyle
Siedlerchr Nov 8, 2025
2ab4cda
fix jbang and checkstlye
Siedlerchr Nov 8, 2025
9649cc3
fix typo
Siedlerchr Nov 8, 2025
1a2979b
fix jbang
Siedlerchr Nov 9, 2025
da9133e
fix jbang
Siedlerchr Nov 9, 2025
c07d71c
fix jbang
Siedlerchr Nov 9, 2025
cc621ce
fix jbang
Siedlerchr Nov 9, 2025
b9fe2e4
fix artifat id
Siedlerchr Nov 9, 2025
398f1eb
add jackson annotations
Siedlerchr Nov 9, 2025
2b33910
Merge branch 'main' into jackson3
Siedlerchr Nov 9, 2025
431c9e9
fix imports
Siedlerchr Nov 9, 2025
9b30927
fix imports
Siedlerchr Nov 9, 2025
bbce853
Add debug
koppor Nov 9, 2025
7c8f43d
Merge branch 'main' into jackson3
Siedlerchr Nov 9, 2025
f291512
fix imports
Siedlerchr Nov 9, 2025
395fade
add jackson deps to jbang
Siedlerchr Nov 9, 2025
ee56c1e
fix import
Siedlerchr Nov 9, 2025
bc7b308
Merge branch 'main' into jackson3
Siedlerchr Nov 10, 2025
bf6b1dc
fix imports
Siedlerchr Nov 10, 2025
d7b6e80
reveRT CSL CHANGE
Siedlerchr Nov 10, 2025
b828262
fix imports
Siedlerchr Nov 10, 2025
a1ab067
add to example
Siedlerchr Nov 10, 2025
b4aaae4
cahnge mscocde utils
Siedlerchr Nov 10, 2025
f404793
Merge remote-tracking branch 'upstream/main' into jackson3
Siedlerchr Nov 13, 2025
5aee419
Merge remote-tracking branch 'upstream/main' into jackson3
Siedlerchr Nov 13, 2025
fcfebab
fix lsp import
Siedlerchr Nov 13, 2025
5891f4b
ad jackson annotaitons
Siedlerchr Nov 13, 2025
00f1f31
ad jackson annotaitons
Siedlerchr Nov 13, 2025
62bdd16
Merge branch 'main' into jackson3
koppor Nov 14, 2025
99b55b7
Try to fix ..
koppor Nov 14, 2025
f345a8f
Fix variable
koppor Nov 14, 2025
ed5520f
Merge branch 'main' into jackson3
koppor Nov 14, 2025
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
1 change: 1 addition & 0 deletions .github/workflows/tests-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,7 @@ jobs:
echo "//SOURCES ../../$f" >> "${{ matrix.script }}"
fi
done
- run: cat ${{ matrix.script }}
- run: jbang build "${{ matrix.script }}"
shell: bash
- run: jbang "${{ matrix.script }}" --help
Expand Down
4 changes: 4 additions & 0 deletions .jbang/JabKitLauncher.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
//DEPS io.github.darvil82:terminal-text-formatter:2.3.0c
//DEPS info.picocli:picocli:4.7.7
//DEPS com.github.ben-manes.caffeine:caffeine:3.2.3
//DEPS com.fasterxml.jackson.core:jackson-annotations:2.20
//DEPS tools.jackson.core:jackson-core:3.0.2
//DEPS tools.jackson.core:jackson-databind:3.0.2
//DEPS tools.jackson.dataformat:jackson-dataformat-yaml:3.0.2
Comment on lines +33 to +36
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe, this can be left out, because it will come in using the jablib SNAPSHOT from maven central.


/// This class is required for [jbang](https://www.jbang.dev/)
public class JabKitLauncher {
Expand Down
5 changes: 4 additions & 1 deletion .jbang/JabLsLauncher.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@
//DEPS org.jspecify:jspecify:1.0.0

// from jabls
//DEPS com.fasterxml.jackson.core:jackson-databind:2.20.1
//DEPS com.fasterxml.jackson.core:jackson-annotations:2.20
//DEPS tools.jackson.core:jackson-core:3.0.2
//DEPS tools.jackson.core:jackson-databind:3.0.2
//DEPS tools.jackson.dataformat:jackson-dataformat-yaml:3.0.2
//DEPS info.picocli:picocli:4.7.7
//DEPS org.apache.logging.log4j:log4j-to-slf4j:2.25.2
//DEPS org.eclipse.lsp4j:org.eclipse.lsp4j:0.24.0
Expand Down
3 changes: 3 additions & 0 deletions .jbang/JabSrvLauncher.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@
//DEPS net.harawata:appdirs:1.5.0
//DEPS de.undercouch:citeproc-java:3.4.0
//DEPS com.github.ben-manes.caffeine:caffeine:3.2.3
//DEPS tools.jackson.core:jackson-core:3.0.2
//DEPS tools.jackson.core:jackson-databind:3.0.2
//DEPS tools.jackson.dataformat:jackson-dataformat-yaml:3.0.2
//DEPS org.apache.commons:commons-lang3:3.19.0

/// This class is required for [jbang](https://www.jbang.dev/)
Expand Down
4 changes: 4 additions & 0 deletions jablib-examples/jbang/ieee_pdf_references_to_bibtex.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
//DEPS org.jabref:jablib:6.0-SNAPSHOT
// JabRef relies on PR https://github.com/unicode-org/icu/pull/2127; for experiments the release version is OK.
//DEPS com.ibm.icu:icu4j:78.1
//DEPS com.fasterxml.jackson.core:jackson-annotations:2.20
//DEPS tools.jackson.core:jackson-core:3.0.2
//DEPS tools.jackson.core:jackson-databind:3.0.2
//DEPS tools.jackson.dataformat:jackson-dataformat-yaml:3.0.2

void main() throws Exception {
var preferences = JabRefCliPreferences.getInstance();
Expand Down
4 changes: 2 additions & 2 deletions jablib/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ dependencies {

implementation("org.eclipse.jgit:org.eclipse.jgit")

implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml")
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310")
implementation("tools.jackson.dataformat:jackson-dataformat-yaml")
implementation("tools.jackson.core:jackson-databind")
// TODO: Somwewhere we get a warning: unknown enum constant Id.CLASS reason: class file for com.fasterxml.jackson.annotation.JsonTypeInfo$Id not found
// implementation("com.fasterxml.jackson.core:jackson-annotations:2.19.1")

Expand Down
6 changes: 3 additions & 3 deletions jablib/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,9 @@
// region: data mapping
requires jdk.xml.dom;
requires com.google.gson;
requires com.fasterxml.jackson.databind;
requires com.fasterxml.jackson.dataformat.yaml;
requires com.fasterxml.jackson.datatype.jsr310;
requires tools.jackson.databind;
requires tools.jackson.dataformat.yaml;
requires tools.jackson.core;
// endregion

// region HTTP clients
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@

import org.jabref.logic.openoffice.OpenOfficePreferences;

import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.jspecify.annotations.NonNull;
import org.jspecify.annotations.Nullable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import tools.jackson.core.type.TypeReference;
import tools.jackson.databind.ObjectMapper;

/**
* Manages the loading of CitationStyles from both internal resources and external files.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@

import org.jabref.model.study.Study;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
import com.fasterxml.jackson.dataformat.yaml.YAMLGenerator;
import tools.jackson.databind.ObjectMapper;
import tools.jackson.dataformat.yaml.YAMLFactory;
import tools.jackson.dataformat.yaml.YAMLMapper;
import tools.jackson.dataformat.yaml.YAMLWriteFeature;

/**
* Example use: <code>new StudyYamlParser().parseStudyYamlFile(studyDefinitionFile);</code>
Expand All @@ -30,8 +31,10 @@ public Study parseStudyYamlFile(Path studyYamlFile) throws IOException {
* Writes the given study instance into a yaml file to the given path
*/
public void writeStudyYamlFile(Study study, Path studyYamlFile) throws IOException {
ObjectMapper yamlMapper = new ObjectMapper(new YAMLFactory().disable(YAMLGenerator.Feature.WRITE_DOC_START_MARKER)
.enable(YAMLGenerator.Feature.MINIMIZE_QUOTES));

ObjectMapper yamlMapper = new YAMLMapper(YAMLFactory.builder()
.disable(YAMLWriteFeature.WRITE_DOC_START_MARKER)
.enable(YAMLWriteFeature.MINIMIZE_QUOTES).build());
yamlMapper.writeValue(studyYamlFile.toFile(), study);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@

import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
import com.google.common.collect.HashBiMap;
import org.jspecify.annotations.NonNull;
import tools.jackson.core.JacksonException;
import tools.jackson.databind.ObjectMapper;
import tools.jackson.dataformat.yaml.YAMLFactory;
import tools.jackson.dataformat.yaml.YAMLMapper;

public class CffImporter extends Importer {

Expand Down Expand Up @@ -171,7 +173,7 @@ private void setValues(String key, String value) {

@Override
public ParserResult importDatabase(@NonNull BufferedReader reader) throws IOException {
ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
ObjectMapper mapper = new YAMLMapper(new YAMLFactory());
CffFormat citation = mapper.readValue(reader, CffFormat.class);
List<BibEntry> entriesList = new ArrayList<>();

Expand Down Expand Up @@ -263,14 +265,13 @@ public ParserResult importDatabase(@NonNull BufferedReader reader) throws IOExce

@Override
public boolean isRecognizedFormat(@NonNull BufferedReader reader) throws IOException {

ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
ObjectMapper mapper = new YAMLMapper(new YAMLFactory());
CffFormat citation;

try {
citation = mapper.readValue(reader, CffFormat.class);
return (citation != null) && (citation.values.get("title") != null);
} catch (IOException e) {
} catch (JacksonException e) {
return false;
}
}
Expand Down
15 changes: 8 additions & 7 deletions jablib/src/main/java/org/jabref/logic/util/MscCodeUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@

import org.jabref.logic.shared.exception.MscCodeLoadingException;

import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.collect.HashBiMap;
import org.jspecify.annotations.NonNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import tools.jackson.core.exc.StreamReadException;
import tools.jackson.core.type.TypeReference;
import tools.jackson.databind.DatabindException;
import tools.jackson.databind.ObjectMapper;
import tools.jackson.databind.json.JsonMapper;

public class MscCodeUtils {
private static final Logger LOGGER = LoggerFactory.getLogger(MscCodeUtils.class);
Expand All @@ -29,10 +30,10 @@ public class MscCodeUtils {
@NonNull
public static Optional<HashBiMap<String, String>> loadMscCodesFromJson(URL resourceUrl) throws MscCodeLoadingException {

ObjectMapper mapper = new ObjectMapper();
ObjectMapper mapper = new JsonMapper();
try {
Map<String, String> mapping =
mapper.readValue(resourceUrl, new TypeReference<>() {
mapper.readValue(resourceUrl.openStream(), new TypeReference<>() {
});
HashBiMap<String, String> result = HashBiMap.create(mapping);

Expand All @@ -41,7 +42,7 @@ public static Optional<HashBiMap<String, String>> loadMscCodesFromJson(URL resou
}

return Optional.of(result);
} catch (JsonParseException | JsonMappingException e) {
} catch (StreamReadException | DatabindException e) {
LOGGER.error("Error parsing MSC codes from JSON", e);
throw new MscCodeLoadingException("Failed to parse MSC codes from JSON", e);
} catch (IOException e) {
Expand Down
2 changes: 1 addition & 1 deletion jabls/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

requires org.jabref.jablib;

requires com.fasterxml.jackson.databind;
requires tools.jackson.databind;

requires com.google.common;
requires com.google.gson;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package org.jabref.languageserver;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.gson.JsonObject;
import org.slf4j.Logger;
import tools.jackson.core.JacksonException;
import tools.jackson.databind.JsonNode;
import tools.jackson.databind.ObjectMapper;
import tools.jackson.databind.json.JsonMapper;

public class ExtensionSettings {

Expand All @@ -29,15 +30,15 @@ public static ExtensionSettings getDefaultSettings() {
}

public void copyFromJsonObject(JsonObject object) {
ObjectMapper mapper = new ObjectMapper();
ObjectMapper mapper = new JsonMapper();
try {
JsonNode node = mapper.readTree(object.toString());
this.consistencyCheck = node.at("/jabref/consistencyCheck/enabled").asBoolean(this.consistencyCheck);
this.consistencyCheckRequired = node.at("/jabref/consistencyCheck/required").asBoolean(this.consistencyCheckRequired);
this.consistencyCheckOptional = node.at("/jabref/consistencyCheck/optional").asBoolean(this.consistencyCheckOptional);
this.consistencyCheckUnknown = node.at("/jabref/consistencyCheck/unknown").asBoolean(this.consistencyCheckUnknown);
this.integrityCheck = node.at("/jabref/integrityCheck/enabled").asBoolean(this.integrityCheck);
} catch (JsonProcessingException processingException) {
} catch (JacksonException processingException) {
LOGGER.error("Error parsing settings from JSON", processingException);
}
}
Expand Down
5 changes: 2 additions & 3 deletions jabsrv/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
exports org.jabref.http.server.command to jersey.server;
opens org.jabref.http.server.cayw to com.google.gson, org.glassfish.hk2.locator, org.glassfish.hk2.utilities;
opens org.jabref.http.dto to com.google.gson;
opens org.jabref.http.server.command to com.google.gson, org.glassfish.hk2.locator, org.glassfish.hk2.utilities, com.fasterxml.jackson.databind;
opens org.jabref.http.server.command to com.google.gson, org.glassfish.hk2.locator, org.glassfish.hk2.utilities, tools.jackson.databind;
exports org.jabref.http.server.services;
exports org.jabref.http;
opens org.jabref.http.server.resources to org.glassfish.hk2.locator, org.glassfish.hk2.utilities;
Expand Down Expand Up @@ -58,6 +58,5 @@
requires java.logging;
requires jersey.container.grizzly2.http;
requires jersey.server;
requires com.fasterxml.jackson.annotation;
requires com.fasterxml.jackson.databind;
requires tools.jackson.databind;
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package org.jabref.http.server.command;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import jakarta.inject.Inject;
import jakarta.ws.rs.Consumes;
import jakarta.ws.rs.POST;
Expand All @@ -10,6 +8,9 @@
import jakarta.ws.rs.core.MediaType;
import jakarta.ws.rs.core.Response;
import org.glassfish.hk2.api.ServiceLocator;
import tools.jackson.core.JacksonException;
import tools.jackson.databind.ObjectMapper;
import tools.jackson.databind.json.JsonMapper;

@Path("commands")
public class CommandResource {
Expand All @@ -21,13 +22,13 @@ public class CommandResource {
@Consumes({MediaType.APPLICATION_JSON})
@Produces({MediaType.APPLICATION_JSON})
public Response dispatchCommand(String jsonCommand) {
ObjectMapper objectMapper = new ObjectMapper();
ObjectMapper objectMapper = new JsonMapper();
try {
Command command = objectMapper.readValue(jsonCommand, Command.class);
command.setServiceLocator(serviceLocator);

return command.execute();
} catch (JsonProcessingException e) {
} catch (JacksonException e) {
return Response.serverError().entity(e.getMessage()).build();
}
}
Expand Down
6 changes: 4 additions & 2 deletions versions/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ dependencies {
api("org.junit.jupiter:junit-jupiter")
api("org.junit.platform:junit-platform-launcher")

api(platform("tools.jackson:jackson-bom:3.0.2"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The version has to go to below to the constraints (doesn't it?)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have absolutely no idea, because it's a bom and other boms are declared at the top as well

api("tools.jackson.core:jackson-core")
api("tools.jackson.core:jackson-databind")
api("tools.jackson.dataformat:jackson-dataformat-yaml")
}

dependencies.constraints {
Expand All @@ -47,8 +51,6 @@ dependencies.constraints {
api("com.dlsc.gemsfx:gemsfx:3.6.2")
api("com.dlsc.pdfviewfx:pdfviewfx:3.3.2")
api("com.ibm.icu:icu4j:72.0.1!!")
api("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.20.1")
api("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.20.1")
api("com.fasterxml:aalto-xml:1.3.4")
api("org.eclipse.lsp4j:org.eclipse.lsp4j:0.24.0")
api("org.eclipse.lsp4j:org.eclipse.lsp4j.websocket:0.24.0")
Expand Down
Loading