mudasar187
12/13/2022, 12:41 PMshadowJar
withType<ShadowJar> {
archiveFileName.set("app.jar")
manifest {
attributes["Main-Class"] = "no.nav.sokos.prosjektnavn.BootstrapKt"
}
}
But it appears two jars? One with app.jar and one with name of the project projectName.jar , why two jars?
If i remove archiveFileName.set("app.jar") the i get projectName.jar and projectName-all.jar . How can I make my Gradle config so I only have one jar with name app.jar ?tapchicoma
12/13/2022, 12:55 PMmudasar187
12/13/2022, 12:56 PMwithType<Jar> {
isEnabled = false
}
There is no libs folder when it have built the project. Means no jars at all.mudasar187
12/13/2022, 1:03 PMwithType().named("jar") {
enabled = false
}
This above solution is working. But below solution this not working? 🤔
withType<Jar> {
isEnabled = false
}
Why?Vampire
12/13/2022, 1:29 PMJar.
So if you set isEnabled = false for all tasks of type Jar you also disable the fat jar building.
With named("jar") you configure only exactly that task named jar.mudasar187
12/13/2022, 6:58 PMjar 🙂