Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java Spring Basics Creating Controllers and Views Using Thymeleaf to Serve HTML

Diego Camacho
Diego Camacho
9,332 Points

Gradle Error on Refresh task.

When I change the compile dependencies from:

compile 'org.springframework.boot:spring-boot-starter-web:1.2.6.RELEASE'

to

compile 'org.springframework.boot:spring-boot-starter-thymeleaf'

I have the next error:

Gradle 'giflib' project refresh failed
Error:Cause: org.gradle.internal.component.external.model.DefaultModuleComponentSelector

this is my build.gradle file:

group 'com.teamtreehouse'
version '1.0-SNAPSHOT'

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:1.4.2.RELEASE")
    }
}

apply plugin: 'java'
apply plugin: 'org.springframework.boot'

sourceCompatibility = 1.5

repositories {
    mavenCentral()
}

dependencies {
    compile 'org.springframework.boot:spring-boot-starter-thymeleaf'
}

1 Answer

Diego Camacho
Diego Camacho
9,332 Points

I can fix it with some help on the Spring Guides.

this is my new build.gradle file:

group 'com.teamtreehouse'
version '1.0-SNAPSHOT'

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:1.4.3.RELEASE")
    }
}

apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'org.springframework.boot'

sourceCompatibility = 1.8
targetCompatibility = 1.8

repositories {
    mavenCentral()
}

dependencies {
    compile("org.springframework.boot:spring-boot-starter-thymeleaf")
    compile("org.springframework.boot:spring-boot-devtools")
    testCompile("junit:junit")
}

and just works!