Включить JavaParserJsonSerializer в проект JavaParser Maven?JAVA

Программисты JAVA общаются здесь
Гость
Включить JavaParserJsonSerializer в проект JavaParser Maven?

Сообщение Гость »


Я пытаюсь включить

Код: Выделить всё

JavaParserJsonSerializer
class in my Java program using the JavaParser library. I'm using the latest JavaParser v3.25.9, and the IntelliJ IDE v2023.2.5.
I wanted to compile one of the basic

Код: Выделить всё

JavaParserJsonSerializer
examples. However, while I am able to import the core JavaParser classes such as

Код: Выделить всё

CompilationUnit
(located in

Код: Выделить всё

com.github.javaparser.ast
), I am not able to import any of the classes in the

Код: Выделить всё

com.github.javaparser.serialization
package (including

Код: Выделить всё

JavaParserJsonSerializer
) in any of my project files. Instead I'm simply prompted with:

Код: Выделить всё

Cannot resolve symbol 'serialization'
I am including the JavaParser library in my Maven project via the following dependency in the project's file:

Код: Выделить всё


com.github.javaparser
javaparser-core
3.25.9


I am not very experienced with Maven's methods of handling dependencies, but I initially assumed that I would need to add the

Код: Выделить всё

com.github.javaparser.serialization
dependency in addition to the core

Код: Выделить всё

com.github.javaparser
dependency. However, that does not appear to be the issue. Attempting to change the dependencies like such:

Код: Выделить всё


com.github.javaparser
javaparser-core
3.25.9


com.github.javaparser.serialization
javaparser-core-serialization
3.25.9


Results in:

Код: Выделить всё

Dependency 'com.github.javaparser.serialization:javaparser-core-serialization:3.25.9' not found
What is the proper way to import the JavaParser classes from the

Код: Выделить всё

com.github.javaparser.serialization
package, such as

Код: Выделить всё

JavaParserJsonSerializer
?
Thanks for reading my post, any guidance is appreciated.


Источник: https://stackoverflow.com/questions/781 ... en-project

Вернуться в «JAVA»