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

*.jar files in resources directory are always excluded #276

Closed
ags799 opened this issue Mar 3, 2017 · 8 comments · Fixed by #1233
Closed

*.jar files in resources directory are always excluded #276

ags799 opened this issue Mar 3, 2017 · 8 comments · Fixed by #1233
Labels

Comments

@ags799
Copy link

ags799 commented Mar 3, 2017

Writing a language server for a language that requires having certain jars on the classpath for compilation. Note that these jars are not needed to compile the language server itself. But the language server needs them to compile code in the served language. I was thinking that I could put these jars in the resources/ directory of my project, and that they would then make it into the language server's jar file. This works for a normal jar, but it seems that when creating a shadow jar, any kind of *.jar file in the resources directory is excluded, regardless of my includes and excludes configuration.

Shadow Version

1.2.3

Gradle Version

3.3

Expected Behavior

*.jar files in the resources/ directory are included in the shadow jar.

Actual Behavior

The *.jar files are always excluded. Their parent directories may be included, though.

@ags799
Copy link
Author

ags799 commented Mar 6, 2017

Actually, it seems that the *.jar files are being exploded. Furthermore, after trying to override the transformer, it seems that my custom transformer never has the chance to transform these jars.

@MarcMagnin
Copy link

+1

@MarcMagnin
Copy link

I've renamed the jar extension to prevent that to happen for now.

@johnrengelman
Copy link
Collaborator

the problem here is that at the time Shadow runs, it doesn't know if the Jar file was provide as a dependency or included in the source files since the compiled code is being run through the processor so that transformers and relocators can modify it.

I don't see an easy way around this other than naming it something other than .jar

@ags799
Copy link
Author

ags799 commented Apr 29, 2017

that works for me, thanks for the help @johnrengelman

@ags799 ags799 closed this as completed Apr 29, 2017
@tylerbenson
Copy link
Contributor

I just lost several hours to this. I think it would help if this edge case is more explicitly documented. I was about to file a new issue, but then I found this. Are the docs available somewhere in github that would allow for a PR?

@johnrengelman
Copy link
Collaborator

@Goooler
Copy link
Member

Goooler commented Feb 27, 2025

I believe this should be fixed by #1233.

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

Successfully merging a pull request may close this issue.

5 participants