kongchen / swagger-maven-plugin

JAX-RS & SpringMVC supported maven build plugin, helps you generate Swagger JSON and API document in build phase.
http://kongchen.github.io/swagger-maven-plugin/
Apache License 2.0
761 stars 450 forks source link

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

Open ddbdev opened 1 year ago

ddbdev commented 1 year ago

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! :)

vitomanu96 commented 1 year ago

Same issue here!

ddbdev commented 1 year ago

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

sergey-morenets commented 1 year ago

@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 ?

ddbdev commented 1 year ago

@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 commented 1 year ago

up

funfried commented 1 year ago

@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.

ddbdev commented 1 year ago

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

funfried commented 1 year ago

@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

ddbdev commented 1 year ago

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

traviscollins commented 5 months ago

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