Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does my Spring Boot web app not run completely in Gradle?

Tags:

I've been trying to set up a new Spring Boot Web application using the following command:

spring init --java-version=1.7 --build=gradle --packaging=war --groupId=me.psychopunch.lab.springboot --artifactId=sample --name=quickstart sample

However, when I trying running the generated code using: gradle bootRun, I build does not complete, and does not throw error either. I only get:

...
2016-01-11 22:44:28.127  INFO 3579 --- [           main] o.s.j.e.a.AnnotationMBeanExporter        : Registering beans for JMX exposure on startup
2016-01-11 22:44:28.260  INFO 3579 --- [           main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8080 (http)
2016-01-11 22:44:28.266  INFO 3579 --- [           main] com.example.QuickstartApplication        : Started QuickstartApplication in 5.312 seconds (JVM running for 6.091)
> Building 80% > :bootRun

The build gets stuck at around 80%. Sometimes it's 83%, 85%, etc. but it won't complete up to 100%. What am I doing wrong here?

like image 375
Psycho Punch Avatar asked Jan 11 '16 14:01

Psycho Punch


People also ask

Can Gradle be used with spring boot?

Introduction. The Spring Boot Gradle Plugin provides Spring Boot support in Gradle. It allows you to package executable jar or war archives, run Spring Boot applications, and use the dependency management provided by spring-boot-dependencies . Spring Boot's Gradle plugin requires Gradle 6.8, 6.9, or 7.

How do I change the Gradle version in spring boot?

You are going to need to update gradle, as newer spring boot versions are incompatible with older versions of gradle. You can either download the new gradle manually or use gradle wrapper to set the version for your project.

What is bootRun in Gradle?

The Spring Boot gradle plugin provides the bootRun task that allows a developer to start the application in a “developer mode” without first building a JAR file and then starting this JAR file. Thus, it's a quick way to test the latest changes you made to the codebase.


1 Answers

It's actually running that's what the Started QuickstartApplication in 5.312 seconds (JVM running for 6.091) indicate.

Ignore the > Building 80% > :bootRun. When you terminate the spring process some more cleanup things will run in gradle.

I have a pretty big build process, mine prints Started... at 96%. :)

It's perfectly normal.

like image 180
Lakatos Gyula Avatar answered Nov 03 '22 00:11

Lakatos Gyula