swagger-core icon indicating copy to clipboard operation
swagger-core copied to clipboard

swagger-jaxrs2-jakarta v2.1.12 sources and javadoc jars are missing files

Open pjfanning opened this issue 3 years ago • 1 comments

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/

pjfanning avatar Jan 04 '22 07:01 pjfanning

This also affects swagger-core-jakarta - eg https://repo1.maven.org/maven2/io/swagger/core/v3/swagger-core-jakarta/2.2.1/

pjfanning avatar Aug 06 '22 00:08 pjfanning

And version 2.2.8 - https://repo1.maven.org/maven2/io/swagger/core/v3/swagger-core-jakarta/2.2.8/

thisdudeiknew avatar Jan 18 '23 18:01 thisdudeiknew

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 :(

netmikey avatar Apr 26 '23 07:04 netmikey

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?

DevSnobo avatar May 15 '23 11:05 DevSnobo

Same issue here, it would be highly appreciated if this issue is fixed.

quovide avatar Jun 20 '23 10:06 quovide

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:

  1. Temporarily change the dependencies in pom.xml to the non-jakarta ones and run a Maven build just to download those sources into ~/.m2/.
  2. Revert back to the jakarta dependencies.
  3. In Eclipse, navigate to one of the Swagger classes that does not have source, and click the "Change Attached Source" button.
  4. 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.

adriansuarez avatar Jul 23 '23 04:07 adriansuarez

Still an issue in 2.2.16

sgdesmet avatar Sep 26 '23 07:09 sgdesmet

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?

lbruun avatar Nov 11 '23 18:11 lbruun

This has been fixed in #4578 (release 2.2.20)

frantuma avatar Dec 19 '23 07:12 frantuma