P
P
postya2020-03-01 10:57:26
IntelliJ IDEA
postya, 2020-03-01 10:57:26

Why is building a gradle project taking so long?

Made an application. simple REST service on Spring Boot. Development environment - Intelij Idea
When you click on the project build (bootRun), the project builds for a very long time, waited an hour, but did not wait, although at the stage

Started TestappApplication in 5.718 seconds (JVM running for 6.171)

the project starts up and everything works, but the project's build icon is still spinning in the Run panel. This is despite the fact that I have only a couple of dependencies.

How can I fix it so that the project builds quickly?

Build Gradle:

plugins {
    id 'org.springframework.boot' version '2.2.5.RELEASE'
    id 'io.spring.dependency-management' version '1.0.9.RELEASE'
    id 'java'
}

group = 'com.test'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'

repositories {
    mavenCentral()
}

dependencies {
    implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
    implementation 'org.springframework.boot:spring-boot-starter-web'
    implementation 'org.liquibase:liquibase-core'
    runtimeOnly 'org.postgresql:postgresql'
    testImplementation('org.springframework.boot:spring-boot-starter-test') {
        exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
    }
}

test {
    useJUnitPlatform()
}


Gradle build settings window:

5e5b6a58a1869475845771.jpeg

Run tab:

5e5b6aa0b2d3e580698362.jpeg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Eugene, 2020-03-03
@postya

In the case of bootRun in the IDEA console (and in any other console), bootRun will spin at 80% (conditionally). You start the application with this command, so it starts and works until you stop it yourself, or until a critical error occurs in the program, at which the program ends. As a rule, to build (namely, build) SpringBoot applications use bootJar / bootWar tasks. I assure you, they are finite, and work fast enough.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question