Use idea, go all the way to next, and finally generate the project
Then the pom file reports an error
I deliberately changed to a new maven, and found that the jar could not be pulled down, so I configured a domestic image
Find maven, conf and open settings.xml. I wrote
<!-- 阿里云镜像 --> <mirror> <id>alimaven</id> <name>aliyun maven</name> <url>http://maven.aliyun.com/nexus/content/groups/public/</url> <mirrorOf>central</mirrorOf> </mirror> <mirror> <id>central</id> <name>Maven Repository Switchboard</name> <url>http://repo1.maven.org/maven2/</url> <mirrorOf>central</mirrorOf></mirror> <mirror> <id>repo2</id> <mirrorOf>central</mirrorOf> <name>Human Readable Name for this Mirror.</name> <url>http://repo2.maven.org/maven2/</url> </mirror> <mirror> <id>ibiblio</id> <mirrorOf>central</mirrorOf> <name>Human Readable Name for this Mirror.</name> <url>http://mirrors.ibiblio.org/pub/mirrors/maven2/</url> </mirror> <!-- 中央仓库在中国的镜像 --> <mirror> <id>maven.net.cn</id> <name>oneof the central mirrors in china</name> <url>http://maven.net.cn/content/groups/public/</url> <mirrorOf>central</mirrorOf> </mirror>
in the mirrors and then found that there were still some problems and some could not be pulled out.
Continue to set up the idea, open the settings, search for maven
Tick the above check box
and enter
under VM Options-Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.http.ssl.ignore.validity.dates=true
Then click maven on the far right and reinstall it
(After pulling the jar, uncheck it and restore it)
This has been solved All my error problems were solved, and then the startup project could not be started because there was no web
Continue to add spring-boot-starter-web
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency>
to the pom startup class and add hello code correction Verification
# is started, and the browser enters http://localhost:8080/hello
Record a problem encountered when creating a project (Maven related)
After creating the Springboot project through IDEA, pom.xml reports an error in the following code
Prompt spring-boot-starter-parent not found
<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.4.4</version> <relativePath/> </parent>
I found two solutions on the Internet:
Right mouse button----Maven----Reload Project
Through the Maven menu bar on the right----Reload Project
Actually, it’s just one. No matter how I reload or download the source, it doesn't work (I also tried changing the version number), and then I restarted, and it was fine again
Another problem I encountered also reminded me of spring-boot- maven-plugin not found
<groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId>
Solution:
Add the version number corresponding to the above spring-boot-starter-parent. I used 2.4.4 above, and I tried 2.4.4 here, and the result was really good
If the error is still not resolved, you can also try reload project or restart the idea
The above is the detailed content of How to solve the error in the pom file of new springboot project in Idea. For more information, please follow other related articles on the PHP Chinese website!