-
Notifications
You must be signed in to change notification settings - Fork 38.5k
Sources are missing for java 21 classes in MR-JAR structure #32119
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
Comments
Thanks for the suggestion. That's not something we considered at all so far. Can you share a link to the sources jar format expected by tools? Do you know which IDEs support this feature? Alternatively, pointing to another project that ships sources jars that are supported in your IDE would be a good start. |
I'm new to Multi-Release jars, originally I reported this issue as the v21 .java file was missing from sources.jar, but .class file is present in regular .jar under I investigated a bit more, and IntelliJ IDEA 2024.1 EAP adds some support for Multi-Release jars. For example, I can open with it the v21 I think spring sources.jar should contain the .java file in the same directory structure where regular jar stores the classes. It might be limitation of the gradle plugin |
As far as I can see there are no MR-JAR structure for source and/or javadoc that are concepts built on top of the regular archive. Maven doesn't seem to have any support for that, and so isn't Gradle. That said, given you've tested it, it wouldn't hurt to include the source there with the same structure. |
@andreiamariei can you clarify exactly how and where you manually added the Java 21 source file ? |
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed. |
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue. |
I manually added the .java file into the .jar file using Total Commander, you can see the screenshot below how Intellij 2024.1 EAP shows the 21 version for me. Underlined in red is the location of the .java file. The blue selection is how Intellij navigates to it, which looks like a bug in Intellij. Could you update it to the latest version and try again? |
I still cannot reproduce with version 2024.1 EAP (build 12662.62). I'm really not sure there's any intentional support in IDEA, could be a glitch or perfect circumstances that make it appear to work from your perspective... In any case, there's no official specification for multi-release source jars so until we can refer to anything documented (on IDEA or Java side), we'll set this issue aside. Feel free to re-open or create a new issue if some kind of official support is announced and documented in the future. |
As part of #30241, java 21 classes were added following MR-JAR structure, e.g.
org.springframework.core.task.VirtualThreadDelegate
.While these classes are part of the regular compiled .jar, they are missing from the sources/javadoc jars, making IDEs show the java 17 content, which is confusing.
The text was updated successfully, but these errors were encountered: