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

Copy both files even if their path is the same #79

Closed
amorfis opened this issue Aug 3, 2014 · 3 comments
Closed

Copy both files even if their path is the same #79

amorfis opened this issue Aug 3, 2014 · 3 comments

Comments

@amorfis
Copy link

amorfis commented Aug 3, 2014

Currently, when we are building shadow from 2 jars, and in both of them is the file with the same path (but different content), e.g. LICENSE.txt, or about.html - only one is in shadow jar, and the other one is ignored.

In SBT, both files are copied, but with amended name, e.g. in my fat jar I have files:
about_jetty-http-9.2.0.v20140526.html
about_jetty-io-9.2.0.v20140526.html

Both files exist as about.html in jetty-http-9.2.0.v20140526.jar and jetty-io-9.2.0.v20140526.jar

Of course this is not the case for .class files.

I'd like to implement such behavior in shadow plugin, and issue pull request. What do you think?

@johnrengelman
Copy link
Collaborator

My first thought would be that it should be implemented vi a Transformer implementation, but the API doesn't currently pass any information about which archive file the currently processed source is coming from, so you would need to be some changes there to support something like that.

I'd be willing to review such a pull request.

@amorfis
Copy link
Author

amorfis commented Aug 4, 2014

I was also thinking about a Transformer, and started to fiddle with the code to have this information there (it wasn't difficult). But then I thought that this way we can handle only the files specified for the Transformer, and this should rather be default behavior.

I'll work on it. Thanks!

@johnrengelman johnrengelman added this to the 2.0.0 milestone Aug 26, 2014
@johnrengelman johnrengelman removed this from the 5.0.0 milestone Jan 20, 2019
@johnrengelman johnrengelman reopened this Mar 21, 2023
@Goooler
Copy link
Member

Goooler commented Mar 3, 2025

This should be outdated, the last one will be kept with the default duplicates strategy, see #1233.

@Goooler Goooler closed this as not planned Won't fix, can't repro, duplicate, stale Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants