Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SpringBoot with Gradle missing dependency for Thymeleaf

Tags:

I'm trying to setup a very simple Springboot application using Thymeleaf as my templating engine. I am %100 certain my @Controller is working fine but when I try to access the default url ("/") I get the dreaded "Whitelabel" error page.

Below is my gradle.build file...

buildscript {
     ext { springBootVersion = '1.4.0.RELEASE' }
     repositories { mavenCentral() }
     dependencies { classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") }
}

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

jar {
     baseName = 'masterSpringMvc'
     version = '0.0.1-SNAPSHOT'
}

sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories { mavenCentral() }

 dependencies {
     compile('org.springframework.boot:spring-boot-starter-web')
     compile('org.springframework.boot:spring-boot-starter-thymeleaf')
     testCompile('org.springframework.boot:spring-boot-starter-test')
 }

eclipse {
    classpath {
         containers.remove('org.eclipse.jdt.launching.JRE_CONTAINER')
         containers 'org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8'
}

Pretty sure I got everything setup right, so I go ahead and run the below build steps...

enter image description here

After this I am expecting to see the spring-boot-starter-thymeleaf.jar in my "Project and External Dependencies" but its not there. I'm very new to Gradle and was assuming that the build would pull in this required dependency, and then it would be "enabled" while starting my application. Any clue what I might be doing wrong here?

enter image description here

Here is my .html page, I am expecting to see "Test" displayed in the browser.

enter image description here

like image 567
Jason Avatar asked Aug 19 '16 15:08

Jason


1 Answers

You need to update dependencies. On Package Explorer: -> right click your project -> Gradle ->Enable Dependency Management -> right click it again -> Refresh Dependencies

like image 113
Mateus M.R. Avatar answered Sep 22 '22 16:09

Mateus M.R.