'upgrading spring-boot plugin and replacing BootRepackage

I have a Boot application. It generates two artifacts: admin, and worker.

Under Boot 1.4.x, I had a task like :

task adminBoot(type: BootRepackage, dependsOn: adminJar) {

It generated the fat jar for admin, and I depended on this task on my docker task. Note that I needed it named so that I could create two artifacts.

Upgrading to boot 2.0.2, I noticed that BootRepackage is renamed to bootJar and bootWar. But I cannot make it work

task adminBoot(type: BootJar, dependsOn: adminJar) {

gives me an error

Could not get unknown property 'BootJar' for root project 'XXX' of type org.gradle.api.Project.

And this

task adminBoot(type: bootJar, dependsOn: adminJar) {

Give me

rg.springframework.boot.gradle.tasks.bundling.BootJar_Decorated cannot be cast to java.lang.Class

What is the proper name to create a task of bootJar?



Solution 1:[1]

You have to include the full path of the class...

Like this...

task bootJarApp(type:org.springframework.boot.gradle.tasks.bundling.BootJar)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Esteban