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 Spring Components and Configuring Our App Adding a Spring Configuration File

I don’t have an ‘application’ folder under Gradle projects > giflib >Tasks. What am I doing wrong?

Here is a screenshot of my Gradle projects sidebar: http://imgur.com/a/rTzwc In the video at 2:55 there is an application folder with a bootRun file that we need to go forward that I don’t have. What do I need to do?

AppConfig.java

package com.teamtreehouse.giflib;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;

@EnableAutoConfiguration
public class AppConfig {
public static void main(String[] args) {
SpringApplication.run(AppConfig.class, args);
}
}

build.gradle

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

buildscript {
    repositories {
        mavenCentral()
    }

    dependencies {
        classpath 'org.springframework.boot:spring-boot-gradle-plugin:1.2.6.RELEASE'
    }
}

apply plugin: 'java'
apply plugin: 'spring-boot'

sourceCompatibility = 1.5

repositories {
    mavenCentral()
}

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

```

I am getting similar error hence no application folder.

Gradle 'giflib' project refresh failed Error:The supplied build action failed with an exception.

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

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

apply plugin: 'java'
apply plugin: 'spring-boot'

sourceCompatibility = 1.5

repositories {
    mavenCentral()
}

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

4 Answers

Click the blue refresh icon at the top of the gradle panel. If the application group doesn't show up, are there any error/warning messages?

No errors or warnings, but there is a new Run Configurations folder that has appeared: http://imgur.com/a/yEOgr Maybe I need to run a program inside there instead.

Try checking under "Other".

No luck in there either: http://imgur.com/a/306sR I'm stumped.

Hmmm... I notice there's an odd Unicode character at the end of your listing for build.gradle that causes an error if I try to include it. try removing any blank lines after the last dependencies block. You can also try running gradle manually in the terminal from the project directory:

# On Windows:
gradlew.bat bootRun

#on Linux/Mac
./gradlew bootRun

That's it! I removed the whitespace at the end of the file and refreshed and then the Application folder appeared.

Woot! Glad it's fixed!

Hello guys, I have same problem, http://prntscr.com/dp3xzf . did some one have idea, for solution? :)

What does your Gradle window look like?

build.gradle file should have last version .. Then refresh external project

its work with me .. :)

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: 'spring-boot'

sourceCompatibility = 1.8

repositories {
    mavenCentral()
}

dependencies {
    compile 'org.springframework.boot:spring-boot-starter-web:1.4.3.RELEASE'
}

I have same problem. Solved by adding this line, i forgot earlier. Hope it helps smbdy

apply plugin: 'spring-boot'