Let's take the following exemple: build a library A that has 3 dependencies X, Y, Z and we create 2 JARs: regular and FAT.
We have a service B in which we first import the normal JAR and then the FAT jar.
- In the first case (regular JAR) will we need to manually import all the dependencies (X, Y, Z) in B so that A works (importing the JAR of A will not automatically import all its transitive(direct) dependencies - X, Y, Z) ? / OR / the library will work (calling it's methods) but trying to call methods from X, Y, Z will fail and we will need to manually import them ?
- In the second scenario because the Fat JAR has all the dependencies imbedded we won't need to add any dependencies right ? We can both use A and also methods and classes from X, Y and Z.
Is what I said at 1) and 2) right ? Is this how it works ?
Runtime Classpath vs Compile Classpath for normal vs FAT JAR
- Including the normal JAR of A as a dependency to B:
- compile classpath will only have A dependency ?
- runtime classpath will have A, X, Y and Z dependencies ?
- Including the FAT JAR of A as a dependency to B:
- compile classpath will have A, X, Y and Z dependencies ?
- runtime classpath will have A, X, Y and Z dependencies ?
Is this how the compile classpath and runtime classpath will look like in these scenarios ?