Cannot find template location: classpath:/templates/ (please add some templates, check your Thymeleaf configuration, or set spring.thymeleaf.check - spring

I am facing the following warning when I run my Spring boot project,
DefaultTemplateResolverConfiguration Cannot find template location: classpath:/templates/ (please add some templates, check your Thymeleaf configuration, or set spring.thymeleaf.check-template-location=false)
I am facing this issue once i update my project with Maven 3.8.6. I am assuming this problem has to do with the Maven settings. I tried creating a new project and it works fine until I update the build with Maven.
Can anyone help with this issue?

in my project .classpath file there was a rule that excludes all the sources under src/main/resources. i removed that and it worked.

Related

Maven and intellijIDEA

Today I found disattached maven libraries in IDEA project,
went through file->settings->pluggins, marked disbundled 'maven', restarted IDEA. Nothing
changes. Json etc still reddish. Any ideas?
I’ve configured the project by adding a new Maven module and copied the pom.xml file into it once again. Now it works fine.
More information on how to convert a project to Maven is described in the documentation: https://www.jetbrains.com/help/idea/convert-a-regular-project-into-a-maven-project.html

Importing to IntelliJ - Error package org.springframework.boot does not exist

Dear Stackoverflow Community, I have the following problem with my spring boot starter application. I imported the starter project as a new maven project into IntelliJ. But IntelliJ does not find the dependencies I specified in the pom.
Image of my Application Class:
If I try to run the project I get the following error message.
Image of the Error Message:
I already tried everything from re-installing IntelliJ to re-importing the project or redownloading the dependencies. I simply dont know why IntelliJ doesn´t find the dependencies.
My pom.xml looks as following
Image of my pom.xml:
The first time I tried to edit the pom.xml it said to me "this file does not belong to the project". Maybe this might be one reason.
Running the whole thing with 'mvn install' or 'mvn clean verify' works.
Try this and then build: mvn -U idea:idea
Had the same problem. I have tried everything: invalidating cache, deleting the whole .m2 folder, changing settings, reloding the project, nothing helped.
The solution for me was to delete the .iml files which are IntelliJ module files used for keeping module configuration. After reopening the project it worked.
The idea was not mine, I found the hint here: https://intellij-support.jetbrains.com/hc/en-us/community/posts/203365204--package-does-not-exist-error-despite-autocomplete-being-aware-of-them
Sometimes your workspace could get corrupted.
In my case, I tried to Reload the project and it worked
in my case changed JDK version in Maven importer from JDK 11 to my local JDK version 1.8
Here is how my IntelliJ settings for spring boot application looks like
Click open -> browse your workspace -> and select POM.xml file
Check this in your intelliJ settings
Do this too [Settings --> Maven --> Importing]
I just had the same issue. My solution was to remove all dependencies from the pom, reload via maven -> Reload All Maven Projects. Run mvn compile. Add dependencies back to the pom, maven -> Reload All Maven Projects. Run mvn compile.
Now the Intellij build works.
You need to change Maven's JDK for importing option from Project JDK to the Path variable for Java on your machine.
You can get to this by going to Settings -> Build, Execution, Deployment -> Build Tools -> Maven -> Importing. Scroll down to the bottom and look for JDK for importing:. Select from the list the path variable for JAVA.
For Windows users, JAVA_HOME should be an option in the drop-down list.
Follow these steps, your problem should be solved. You just need to add Spring-framework-starter-web and Spring-framework-starter-tester from your pom.xml file.
Got to generate(ALT+Insert)
Add dependencies
Search "springframwork"
Add...
Here is the link
In my case, adding the project as maven project helped .

Show Logback error when I run Simple Spring Boot project

I follow this tutorial to create spring boot project, when I run the project, it shows an error. Please help me to fix it.
my pom.xml
You mentioned that it worked with gradle but not Maven.
One possible solution is to delete your local maven repository to force it to redownload the dependencies:
Go to your home folder and remove the folder ~/.m2/repository.
Then, try rebuilding your project with maven : mvn clean install
I try to update Java and Maven,but it also do not work,and then I change Maven to Gradle,the application can run! Maybe Maven has problem.

Gradle project dependency not working

Can some one please help me in below:
I am using RTC and checkout Gradle project, but at the end when I am checking the properties and looking for source folder for my build, I am getting nothing.
Also I am not send the repository specific Gradle jars. What i am doing wrong?
I tried including external jars but no luck as their are too many jars.
Error: project is not at all building.
right click on your project then configure and convert it to gradle project.
Refresh and you will see all dependencies.

Spring boot actuator sample not working

I checked out spring-boot project from:
https://github.com/spring-projects/spring-boot
and after running spring-boot-sample-actuator with mvn spring-boot:run and navigating to http://localhost:8080/info
I see:
{version: "#project.version#", artifact: "#project.artifactId#", group: "#project.groupId#", name: "#project.name#"}
It seems that Automatic property expansion using Maven (also exlained here http://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#production-ready-application-info-automatic-expansion)
is not working.
What am I missing, how to make it work?
The thing is that the spring-boot-maven-plugin tries first to be able to make the developer productive.
In short, when a path/file is both present in target/classes and in the sources or resources (such as application.properties), it will delete the contents under target/classes.
This is clearly visible here.
So as it is deleting the target/classes/application.properties, and adding the project resources to the classpath (so adding here src/main/resources/application.properties), you can only get the non-filtered file.
Fortunately, you can disable this behaviour by adding this flag to the command line:
-Drun.addResources=false
or in the POM plugin configuration
<addResources>false</addResources>

Resources