-
Notifications
You must be signed in to change notification settings - Fork 392
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
Relocating scala classes #146
Comments
I don't have any Scala experience so I can't comment on this intelligently. Shadow uses the ASM library to do the class relocation. If some other support is necessary for Scala classes then I'd be happy to look at a pull request. |
We're seeing the same problem in a mixed Scala+Java project. Not sure why ASM would treat Scala classes differently. If I can get some time, I'll dig in and see if I can figure this out. This plugin is the key part of what makes it possible for us to build Apache Spark fat jars - thanks John! |
Also seeing this issue with scala classes. This thread is pretty old... @jnadler or anyone else find a solution to this? |
|
Looks like a problem with Maven Shade too: https://issues.apache.org/jira/browse/MSHADE-345 |
Known to work in sbt-assembly tho: https://github.com/sbt/sbt-assembly#shading |
@asm0dey Yeah, but not natively through ASM. See Contributions welcome. |
Workaround, worked in my case: use https://github.com/google/jarjar for relocating
|
I have a possible implementation for this. #756 |
hmm, this is interesting. So sbt works but both gradle & maven fails? I encounter the same problem on scala 2.12.16 & gradle 7.4.2, when relocating json4s |
Yes, because sbt is scala-aware.
вс, 12 июн. 2022 г., 05:03 Peng Cheng ***@***.***>:
… hmm, this is interesting. So sbt works but both gradle & maven fails?
I encounter the same problem on scala 2.12.16 & gradle 7.4.2, when
relocating json4s
—
Reply to this email directly, view it on GitHub
<#146 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJ4XAVLT3WRVD4RTWRBG3LVOVAPRANCNFSM4BKLAU5A>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
This is not a feature of SBT or Gradle. It's a feature of the shadowing plugins. In principle there's no need to change build tools to relocate Scala classes. |
Totally agree, our next patch should be able to introduce the correct behaviour of this feature. For a minimalistic comparative test case, see https://stackoverflow.com/questions/73768130/within-the-ecosystem-of-java-scala-or-kotlin-is-there-a-reliable-way-to-repack/74061407#74061407 |
it is not fixed? looks like sbt has to hang around for a while |
Sorry was thinking about closing stale issues, did that and then backed away from it. Same message as above. If someone wants to contribute support…thiugh id probably want to consider adding that support as an additional library rather than in the core code. |
I see ... I may need to set up a bounty for it |
Relocating scala classes that contain some non-java features like package objects and trait compositions doesn't seem to work with Gradle shadow plugin.
Can it be considered as an enhancement to be included in the future?
The text was updated successfully, but these errors were encountered: