Springboot not recognized on IntelliJ - spring-boot

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.

Related

How to run a spring boot application in intellij?

I am trying to run a spring boot application in intellij 2020.1.1 idea by first generating from spring initializer in start.spring.io then open it with intellij. But when I try the application it doesn't have any output.
Can anyone help me with this? Is this a problem of windows defender?
Try opening the project using the pom.xml file (instead of the project map). File > Open... > select pom.xml
Trust the project when asked.
Run maven when recognized as a maven build.
(Right now there is no maven tab on the right.)
When the maven build is recognized a *.iml will be created and a project configuration will be added to your configurations.
Now you can just press 'run' at the top (or press shift + F10)
Tip: you can also just drag and drop pom files on the start screen and it will open the project.
Click on the run button in Main Class. It will automatically start your project. It worked for me.

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.

IntelliJ run configurations for Netbeans RCP project

there's a project I'm working on with a team (BUMMEL) and we've migrated it's build tool from Ant to Maven, to make it IDE-agnostic, and now I can open it into IntelliJ as a Maven project but I have troubles creating the run configuration for it.
Can anyone suggest me how to create a Run configuration? Also any other suggestions about running NetBeans-RCP maven-based project on IntelliJ are appreciated.
It looks like you should go to Edit Configurations... and add new Maven configuration.
Then put in Working directory: field a path you your app module, for me its application/ in the project root.
And in Command line: field put nbm:cluster-app nbm:run-platform.
Now you can run your app by selecting a newly created configuration and pressing a green "Play" arrow.

Resources