Home  >  Article  >  Java  >  How to solve the error in the pom file of new springboot project in Idea

How to solve the error in the pom file of new springboot project in Idea

王林
王林forward
2023-05-14 14:28:121994browse

    Problems with creating a new springboot project

    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

    How to solve the error in the pom file of new springboot project in Idea

    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)

    How to solve the error in the pom file of new springboot project in Idea

    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

    How to solve the error in the pom file of new springboot project in Idea

    # is started, and the browser enters http://localhost:8080/hello

    How to solve the error in the pom file of new springboot project in Idea

    after creating Springboot pom. xml file error report

    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!

    Statement:
    This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete