[Maven shade] Problems with dependencies in multi module project...
In many of my projects I create the functionality and the wrappers for
various processing systems in separate modules within the same project.
So I have a multi module project ( for example
https://github.com/nielsbasjes/yauaa ) that effective consists of
1) a module with a library that holds "the functionality" ( in this case
2) a set of modules each with a different framework specific "UDF" wrapper
(i.e. Hadoop, Pig, Hive, Nifi, Flink, etc.)
The library has dependencies on things like Guava, Antlr and Spring which
are common causes of versioning problems within downstream projects that
want to use this.
So in the library I use maven shade to include and relocate these
dependencies into a different package (In this case nl.basjes.shaded. ) to
"get them out of the way".
Now I got a bug report that apparently these dependencies are now included
TWICE in the Hive UDF and therefore still cause problems: Once relocated
and once via transitive dependency.
I have done experiments with marking these dependencies with various scopes
and even with optional.
All of these had various unwanted effects (in one case the build succeeded
but IntelliJ gave a lot of errors).
My question to you: What is the correct pattern to handle this?