Spring Boot Dependency - spring

Why this error occurs every time while I import a spring boot project?

It is due to missing of dependencies.
Use mvn clean install from command line before importing project to eclipse.
Also, this question can help - Eclipse showing "Maven Configuration Problem: Unknown"

Related

Springboot not recognized on IntelliJ

Even after installing Java and Maven, creating a spring project from springinitializr is facing an issue. The issue is that the project is not recognised as spring project, the annotations, import nothing are working. Can anyone please help out
I tried to redo the process, but things were same. Is any settings.xml needs to be made but I don't see it as necessity.
When opening your project in intellij. you should do so via the import > new Project and choose the pom.xml for the generated project from spring initialize. This way it can resolve dependencies and properly open your project.
if the problem persists you can go to your MainApplication.java > right click > run as spring boot project.
If it does not put the configuration on the run shortcut on the up right of the application you can configure it by adding the command : mvn spring-boot:run and add other configurations id desired.

Intellij MavenWrapperDownloader.java: Can not resolve symbol error

Setup:
Intellij IDEA community edition 2020.2
Spring Bott starter parent: 2.3.5
Java 11
WRAPPER_VERSION: 0.5.6
mvn 2
Hi,
I googled a lot e.g. here but I just can't fix it.
I created a new mvn spring project with Intellij. When I commit the project I get errors detected by code analyses in class: MavenWrapperDownloader.java.
e.g. It reports:
Cannot resolve symbol String
I tried:
invalidate caches and restart
delete .idea folder and reimport
checked sdk setup
mvn reimport
mvn clean and then rebuild (while the build is always successful)
I'm pretty new to maven. I guess the scope of the mvn package might be wrong because the build process works as expected.
UPDATE:
I reinstallt my openjdk11. No success. Then I found out that my .mvn/wrapper dir is not set as source root. I know that was never the case in my other projects. As a trial I've set my .mvn folder as source root and now the MavenWrapperDownloader.java file is recognized as a java class and the compiler interprets the symbols. But now there is another error. It says I have to define a package name for that class because the class does not have one per default. It is pretty strange to me. I also tried to use another spring boot starter version but nothing changed
When I execute Analyze->inspect code I get the following:
I had the same problem and File -> Invalidate Caches/Restart fixed it - at least for now.
IntelliJ Ultimate 2020.3
Spring Boot Starter Parent 2.4.2
Java 15
Maven 4.0.0
Maven Wrapper 0.5.6
The easiest solution is to generate your project again with Spring Starter.
After you set up everything you need at pom file -> Generate -> Download it.
Open with your IDE and copy-paste all code sources which you have already written.

Spring Boot Maven pom.xml error

I am using Spring Boot to build an application. I downloaded initialized zip project file from start.spring.io/. When I import the project I am getting the following error. By googling I could hardly understand it is proxy or connection issue. But I am able to open the url in browser.
Some people mentioned to change in settings.xml in maven. My eclipse implicitly comes with maven so I did not install maven separately. I tried adding proxy in eclipse as well. But no luck.

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.

What is the correct Eclipse setup for JHipster?

I am getting this error from the first attempt to get a jhipster project compiled in STS Eclipse.
The type org.springframework.core.NestedRuntimeException cannot be resolved. It is indirectly referenced from required .class files CustomPersistentRememberMeServices.java /us-modeldrivers-jhipsterTest003/src/main/java/us/modeldrivers/jhipsterTest003/security line 1 Java Problem
My process so far :
Install jhipster and run a project build
Create a Spring project in STS Eclipse
Update the pom to that generated by jhipster
Copy the jhipster code into the appropriate package in the eclipse project
Get "tools.jar not found error, so force eclipse to use JDK, not JRE
Get "javax.servlet.http.HttpServletResponse cannot be resolved" error, so add Tomcat runtime libary to the build path
Get the NestedRuntimeException not found error, fail to find any answers, realize must be doing something fundamentally wrong.
Any help gratefully received.
EDIT 2014-03-17
I installed fresh versions of STS, including 32 bit and older versions - same result - missing jar files.
I can get rid of missing javax.servlet.http.HttpServletResponse by adding
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-servlet_2.5_spec</artifactId>
<version>1.2</version>
</dependency>
I can get rid of missing javax.servlet.http.HttpServletResponse by adding
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>3.1.0.RELEASE</version>
</dependency>
But jhipster cant expect you to add core spring to the pom to work.
Something must be wrong outside STS?
I have had the problem before that Maven tries to download the required jar files to Users\IBP.m2\repository\org\springframework\spring-instrument\3.0.5.RELEASE (for example). If this fails then it doesnt try again. So you find the thing that failed and delete its directory - that forces a re-download. But in this case the things that said to be missing are in .m2 from other projects.
Anyway, that is a total guess, and I am totally stuck.
I did the following steps and it works
Install the version 3.4.0 of sts
Generate a new project using yo jhipster command
Import the generated project in sts
Run the Application.java as application
Everything works.
This was caused by a corrupt Maven repository. I cleared out the maven cache and it worked fine. Thanks to the support guys of IntelliJ.
you can install sts in eclipse and import the project as existing maven project and then exclude the node_modes and bower components from project properties.
Your answer above is correct... the primary problem is more than likely that you're doing one of two things:
Copy/pasting code into STS rather than doing an import.
Trying to run the application by executing "Run on Server", rather than "Run as Spring Boot".
In the "Run As" context menu you should run "Maven clean" then "Maven install". Then you can start the application by "Run As/Java Application" on the Application class.

Resources