Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
pjfanning opened this issue Jan 4, 2022 · 9 comments
Closed

Comments

@pjfanning
Copy link
Contributor

pjfanning commented Jan 4, 2022

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 pjfanning changed the title swagger-jaxrs2-jakarta v2.1.12 sources and javasoc jars are missing files swagger-jaxrs2-jakarta v2.1.12 sources and javadoc jars are missing files Jan 4, 2022
@pjfanning
Copy link
Contributor Author

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

@thisdudeiknew
Copy link

@netmikey
Copy link

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

@DevSnobo
Copy link

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?

@quovide
Copy link

quovide commented Jun 20, 2023

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

@adriansuarez
Copy link

adriansuarez commented Jul 23, 2023

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.

@sgdesmet
Copy link

Still an issue in 2.2.16

@lbruun
Copy link

lbruun commented Nov 11, 2023

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?

@frantuma
Copy link
Member

This has been fixed in #4578 (release 2.2.20)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants