swagger-core
swagger-core copied to clipboard
swagger-jaxrs2-jakarta v2.1.12 sources and javadoc jars are missing files
Note how much smaller the sources and javadoc jars are in https://repo1.maven.org/maven2/io/swagger/core/v3/swagger-jaxrs2-jakarta/2.1.12/ to those in https://repo1.maven.org/maven2/io/swagger/core/v3/swagger-jaxrs2/2.1.12/
This also affects swagger-core-jakarta - eg https://repo1.maven.org/maven2/io/swagger/core/v3/swagger-core-jakarta/2.2.1/
And version 2.2.8 - https://repo1.maven.org/maven2/io/swagger/core/v3/swagger-core-jakarta/2.2.8/
Same problem for swagger-annotations-jakarta-2.2.9-sources.jar
, it only contains:
\META-INF\
\META-INF\maven\
\META-INF\maven\io.swagger.core.v3\
\META-INF\maven\io.swagger.core.v3\swagger-annotations-jakarta\
\META-INF\LICENSE
\META-INF\MANIFEST.MF
\META-INF\maven\io.swagger.core.v3\swagger-annotations-jakarta\pom.properties
\META-INF\maven\io.swagger.core.v3\swagger-annotations-jakarta\pom.xml
\META-INF\NOTICE
\pom.xml
But no actual source files, so no support in the IDE :(
And the sources are still missing, when half of the world already had to move to jakarta. This makes debugging our issues either hard or impossible. Is there really not going to be any solution in the foreseeable future?
Same issue here, it would be highly appreciated if this issue is fixed.
Not sure why the maintainers haven't addressed this, but it seems like the issue is that they rely on a Maven plugin to transform the javax.ws.rs.*
classes to jakarta.ws.rs.*
, so there are no static source files to package for these modules.
Anyway, there is a simple fix for this in Eclipse:
- Temporarily change the dependencies in
pom.xml
to the non-jakarta ones and run a Maven build just to download those sources into~/.m2/
. - Revert back to the jakarta dependencies.
- In Eclipse, navigate to one of the Swagger classes that does not have source, and click the "Change Attached Source" button.
- Remove
-jakarta
from the path that appears under "External location", which should be selected. E.g. change~/.m2/repository/io/swagger/core/v3/swagger-annotations-jakarta/2.2.15/swagger-annotations-jakarta-2.2.15-sources.jar
to~/.m2/repository/io/swagger/core/v3/swagger-annotations/2.2.15/swagger-annotations-2.2.15-sources.jar
, which should have been downloaded by step 1.
You have to do steps 3 and 4 for all Swagger libraries that are pulled in.
These source files will have javax.ws.rs.*
, but they should be identical otherwise, so they're totally usable for code navigation purposes.
Still an issue in 2.2.16
This is really annoying. I think the issue is compounded by the fact that indeed *-sources.jar
and *-javadoc.jar
files are published into Maven Central, but they are empty. This confuses IDEs.
As pointed out by Adrian here the issue is the project's use of the Eclipse Transformer which is used to transform an already build binary (a jar) into the jakarta namespace, meaning it operates on .class
files (not .java
files), so there is no resulting source code files for Jakarta. Hence no source exists which can be uploaded to Maven Central and no Javadoc can be produced either.
At the moment this repo doesn't have to maintain two code bases for jakarta and pre-jakarta. That is of course a clear benefit. But I wonder if there is another way to do it?
This has been fixed in #4578 (release 2.2.20)