1

I have weird dependency in springboot app that expects itself to be loaded as jar. springboot gradle plugin creates fatJar. it doesn't work.

Is it possible to build springboot app as springboot jar with application thin jar and a library folder with all dependencies? I don't want to smash them in single jar.

I'm using

plugins {
    id 'java'
    id 'org.springframework.boot' version '2.2.6.RELEASE'

}
apply plugin: 'io.spring.dependency-management'
Capacytron
  • 3,425
  • 6
  • 47
  • 80

1 Answers1

0

Yes, possible.

Sample task to achieve that from Creating archives (zip, tar, etc.) section in Gradle User Guide:

From the perspective of Gradle, packing files into an archive is effectively a copy in which the destination is the archive file rather than a directory on the file system. This means that creating archives looks a lot like copying, with all of the same features!

task packageDistribution(type: Zip) {
    archiveFileName = "my-distribution.zip"
    destinationDirectory = file("$buildDir/dist")

    from "$buildDir/toArchive"
}
Minar Mahmud
  • 2,577
  • 6
  • 20
  • 32