This message was deleted.
# community-support
s
This message was deleted.
m
It's not really a job for the compiler. You could either: • rewrite your Source files before compilation (maybe regexes would do) • rewrite the bytecode after compilation (using something like asm) • overlay guava with your own guava jar at runtime
I guess you could write your own compiler plugin that changes the imports during compilation but that sounds not trivial and quite the footgun
What are you trying to do? If you want to substitute the guava version, I would do so at runtime
l
Emm……thank you martin! It’s a little bit complicated… In my project I have some dependencies like hadoop\hive etc.. and those packages contain guava classes(can not be excluded…) and I want to avoid the conflict between our own dependency and those from external libs…
m
If you control your code, is there a reason you can't use your relocated version of guava in your sources? By compiling against your own guava you'll have more guarantees. If not, it's dangerous because you're compiling against a different version of guava than the runtime one