swagger-maven-plugin icon indicating copy to clipboard operation
swagger-maven-plugin copied to clipboard

Updating to jakarta.xml.bind >4 doesn't generate anymore the swaggers

Open ddbdev opened this issue 2 years ago • 10 comments

Hi everyone, I'm updating some dependency version in a project and I'm occurring in the following problem.

Library Version (FROM/TO)
jakarta.xml.bind-api 2.3.3 - 4.0.0
org.eclipse.persistence.moxy 2.7.11 - 4.0.0

The updating of those dependencies version, as mentioned above, will not generate the swagger json's.

I'll paste below the error.

[ERROR] Failed to execute goal com.github.kongchen:swagger-maven-plugin:3.1.8:generate (generate_swagger_specification) on project api-event-v1: Execution generate_swagger_specification of goal com.github.kongchen:swagger-maven-plugin:3.1.8:generate failed: A required class was missing while executing com.github.kongchen:swagger-maven-plugin:3.1.8:generate: javax/xml/bind/annotation/XmlRootElement

Since we updated the version the javax/xml/bind/annotation/XmlRootElement is not found anymore but I think the plugin is still using those. Will there be an update of the plugin to have these new classes?

Thanks in advance! :)

ddbdev avatar Mar 14 '23 11:03 ddbdev

Same issue here!

vitomanu96 avatar Mar 20 '23 10:03 vitomanu96

@vitomanu96 I think that this project is abandoned, last commit is from 3 years ago, maybe it's time to migrate to something else

ddbdev avatar Mar 20 '23 14:03 ddbdev

@vitomanu96 I think that this project is abandoned, last commit is from 3 years ago, maybe it's time to migrate to something else

Hi, do you know any replacements of this plugin ?

sergey-morenets avatar Mar 22 '23 20:03 sergey-morenets

@vitomanu96 I think that this project is abandoned, last commit is from 3 years ago, maybe it's time to migrate to something else

Hi, do you know any replacements of this plugin ?

I'm looking forward for something to replace it, any suggestion would be appreciated! 👍

ddbdev avatar Mar 22 '23 22:03 ddbdev

up

ddbdev avatar May 02 '23 18:05 ddbdev

@ddbdev I think you have two options, either use openapi-maven-plugin which seems to be not so mature/stable yet or springdoc but there you have to startup your spring boot server during build time and stop it again which is my problem right now, I can start the server but it seems no to fully stop afterwards (the spring boot process is still there but from the logs it looks like it stopped) So right now there are alternatives but none of them seem to be as good as this plugin was.

funfried avatar Jul 26 '23 19:07 funfried

@funfried I wish I could use spring but it's a business project, hence I cannot change it, probably will adapt to OpenAPI soon

ddbdev avatar Jul 27 '23 09:07 ddbdev

@ddbdev Ah ok, so you have a JEE project? Then you should have a look into the OpenAPI Maven plugin: https://github.com/openapi-tools/swagger-maven-plugin It's quite old, but it should work for JEE projects and OpenAPI 3.x

funfried avatar Jul 27 '23 09:07 funfried

@funfried , appreciate it! I'l take a look asap, thanks a lot! :)

ddbdev avatar Jul 31 '23 21:07 ddbdev

I forked this repo at 3.1.9-SNAPSHOT, replaced all the javax.ws.rs references with jakarta.ws.rs, and published a new drop-in artifact at https://github.com/big-armor/swagger-2-jakarta-maven-plugin

You should be able to replace this plugin with...

<groupId>com.bigarmor</groupId>
<artifactId>swagger-2-jakarta-maven-plugin</artifactId>
<version>3.1.9</version>

Check the latest version here... https://central.sonatype.com/artifact/com.bigarmor/swagger-2-jakarta-maven-plugin

traviscollins avatar May 28 '24 19:05 traviscollins