Questions tagged [spring-boot-gradle-plugin]

The Spring Boot Gradle Plugin provides Spring Boot support in Gradle, allowing you to package executable jar or war archives, run Spring Boot applications and use the dependency management provided by spring-boot-dependencies.

206 questions
42
votes
8 answers

Spring Boot 2 - Change Jar Name

I am using Spring Boot 2 in my Gradle project to do a build to jar in Jenkins, and I would like to change the name of that jar file. By default, Spring Boot 2 used the Gradle property rootProject.name, which can be set in the /settings.gradle…
30
votes
3 answers

Maven profiles equivalent of Gradle

I'm trying to achieve a simple scenario in my spring boot project build: including / excluding dependencies and packaging war or jar depending on the environment. So for example, for the environment dev include devtools and package jar, for prod…
29
votes
5 answers

in intelliJ spring boot gradle plugin 3.0.0 no matching variant found

I'm trying to use version 3.0.0 of the spring boot Gradle plugin. Here's my build.gradle.kts file: import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { id("org.springframework.boot") version "3.0.0" …
Mag Musik
  • 1,274
  • 1
  • 6
  • 13
27
votes
1 answer

Difference between Spring boot 2.5.0 generated *jar and *-plain.jar?

I upgraded my spring boot app to 2.5.0, then is app.jar and app-plain.jar is created by gradle. I would like to the difference between these jars. thanks
Nidhin Dev
  • 499
  • 5
  • 9
20
votes
1 answer

Gradle dependency plugin in a multi module Spring Boot project

What does a correct Gradle configuration look like in a multi-module project that uses the Gradle plugins spring-boot-dependencies and spring-boot? I have the following project setup: parent | + build.gradle | + alpha | | | +…
matsev
  • 32,104
  • 16
  • 121
  • 156
17
votes
6 answers

BootJar + MavenJar. Artifact wasn't produced by this build

I have a sample project with the following hierearhy: Sample (root) -- model (simple jar) -- api (springboot jar) I want to publish both generated jars: plain jar & bootJar to my localRepository. gradlew clean build -xTest…
Ermintar
  • 1,322
  • 3
  • 22
  • 39
14
votes
5 answers

Spring Boot 2 Gradle plugin without executable jar

How do I configure Spring Boot Gradle plugin 2 to disable the Boot distribution in Gradle Script Kotlin. The distribution i want is a assembly bundle zip with all dependencies (and the jar) in the lib folder. I have enabled the Jar task and…
bjartek
  • 929
  • 1
  • 5
  • 11
14
votes
4 answers

Can I create a Maven POM-only (BOM) build using the Gradle maven plugin to be deployed to Nexus?

I have a Gradle project which uses Spring's dependency management plugin to define a list of dependency versions. I am also using the Maven plugin to deploy the project to a Maven repository. I would like to be able to deploy this as a Maven bill…
M. Justin
  • 14,487
  • 7
  • 91
  • 130
10
votes
2 answers

how to proguard with spring-boot gradle plugin

How to setup proguard obfuscation with spring boot 2 and gradle build? Hello. Trying to setup code obfuscation of Spring Boot app with its gradle plugin and Proguard gradle plugin. Google mostly gives some approaches for older…
9
votes
1 answer

Could not set unknown property 'mainClassName' for extension 'springBoot' of type org.springframework.boot.gradle.dsl.SpringBootExtension

I have build.gradle like this and it works : plugins { id 'org.springframework.boot' version '2.5.8' apply false ... } ... springBoot { mainClassName = 'com.mir3.service.contactfileparser.Main' } but if I upgrade spring boot…
gstackoverflow
  • 36,709
  • 117
  • 359
  • 710
9
votes
2 answers

How to get spring-boot dependency version in gradle?

I have a standard spring-boot project with org.springframework.boot:spring-boot-gradle-plugin. i know i can override dependency version with e.g. ext['slf4j.version'] = '1.7.5' but how can i get the version currently imported by spring-boot plugin…
piotrek
  • 13,982
  • 13
  • 79
  • 165
8
votes
2 answers

Spring Boot 2.3.0 bootBuildImage fails

I have updated my project to use springboot 2.3.0 and trying to build docker image using the default springboot gradle task bootBuildImage. The project is a simple rest project broken into two parts:- interface definition and interface…
dareurdream
  • 241
  • 4
  • 13
8
votes
1 answer

SpringBoot JMS Listener: Could not refresh JMS Connection for destination

I have Spring Boot application which listen IBM MQ Queue via @JmsListener annotation as below from component class. The MQ properties (hostname, channel, port, etc) are set from yaml file. @JmsListener(destination = "") public void…
8
votes
5 answers

Kotlin Gradle Could not find or load main class

I tried to copy the Spring Boot Kotlin sample project https://github.com/JetBrains/kotlin-examples/tree/master/tutorials/spring-boot-restful. I Added some more dependencies and when I tried to build the executable jar and run it, I got the…
dks551
  • 1,113
  • 1
  • 15
  • 39
8
votes
3 answers

Spring Boot 2.0 Actuator git properties not added to /info

I'm using Gradle with Spring Boot 2.0.0.M7 and have the following plugins applied: buildscript { repositories { maven { url "https://plugins.gradle.org/m2/" } maven { url "https://repo.spring.io/milestone" } } …
1
2 3
13 14