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

Resource files are no longer relocated #93

Closed
pron opened this issue Aug 31, 2014 · 7 comments
Closed

Resource files are no longer relocated #93

pron opened this issue Aug 31, 2014 · 7 comments
Labels
Milestone

Comments

@pron
Copy link

pron commented Aug 31, 2014

Hi.
I've just upgraded from 0.8 to 1.1.1, and noticed that resource (non-class) files are no longer relocated. Is there a way to relocate them?

@pron
Copy link
Author

pron commented Aug 31, 2014

Correction: it seems like the reference to the resource files (in the classes) are re-mapped to their supposed new location, it's just that the resource files themselves aren't moved.

@johnrengelman
Copy link
Collaborator

How are you doing the relocation? Relocation only applies to Java Class files because it has to do with changing package names and rewriting those in the corresponding .class files.

@pron
Copy link
Author

pron commented Sep 2, 2014

relocate 'org.', 'mydom.org.'
  • Relocation also has to do with changing files' paths.
  • 0.8 relocated resource files as well as classes.
  • The references to the resources are being transformed in the current version (e.g., ...getResourceAsStream("org/...") is (correctly) being turned into ...getResourceAsStream("mydom/org/..."))
  • Resource files should be relocated because the shadow plugin is meant to prevent collisions (i.e. if some other transformation isn't applied).
  • AFAIK (I may be wrong) the Maven Shade plugin also relocates resource files

@johnrengelman johnrengelman added this to the 1.1.2 milestone Sep 8, 2014
@johnrengelman johnrengelman modified the milestones: 1.1.3, 1.1.2 Sep 9, 2014
@pron
Copy link
Author

pron commented Nov 24, 2014

Hi.
Just tried 1.2.0 and unfortunately this doesn't seem to work (i.e. the problem persists exactly as reported before).

@pron
Copy link
Author

pron commented Nov 24, 2014

OK, I think the problem is that you've applied the fix to visitFile but not to visitArchiveFile, so the relocation is not applied on dependencies.

@johnrengelman
Copy link
Collaborator

ah, my bad. I'll have a patch later today.

@pron
Copy link
Author

pron commented Nov 24, 2014

Thanks!

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

No branches or pull requests

2 participants