1

I am trying to build a gradle project, where we have several dependent jars. One of this jar is a FAT jar which consist of hundreds of jar. All dependent jars are uploaded to artifactory.

build.gradle is able to compile all other jars however it is not able to get this fat jar compile due to transitive dependency

compile(group:"com.xyz.test", name:"joda-time",Version:"1.6") --works for normal jar compile(group:"com.xyz.test", name:"FAT_JAR", Version:"1.0") --does not works for FAT jar

Getting following Error

Could not find org.objectweb.asm.Type ( class present in the asm.jar which is present in the FAT JAR)  
Searched in following locations  
.....  
.....Artifactory repository locations  
.....  
For Required  
  project: Test> com.xyz.test.FAT_JAR.Test  

I also tried other options like api/implementation instead of compile but it did not help.

I looked into many places, many pages have answer to build a FAT Jar, but what I am looking for compile build with dependent FAT jar.

Please advise.

Yoskutik
  • 1,859
  • 2
  • 17
  • 43
nils
  • 11
  • 3
  • How did you generate the fat jar? Some tools just merge all files together, and some bundles the dependent jars as they are and require a special class loader to load them. (You also usually don't use fat jars as libraries in the first place, unless it is for isolating the transitive dependencies.) – Bjørn Vester Aug 27 '20 at 07:19
  • This FAT jar is provided by third party, our project consumes few classes from it. It is totally build by them. We can extract individual jars and upload to our artifactory but that will require every time splitting jar, comparing each individual jar with one on artifactory and load them. This FAT jar contains 100+ jars so we do not want to take approach to extract individual jars. – nils Aug 27 '20 at 14:41
  • Jars embedded in another jar will not automatically be searched by the Java class loader. So in that sense it is probably not so much a fatjar as it is a zip file with dependencies that just happens to have a jar extension. Maybe you can extract them to a temporary folder during the build and make file dependencies? – Bjørn Vester Aug 28 '20 at 07:29

0 Answers0