Home > Java > javaTutorial > 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

王林
Release: 2023-05-14 14:28:12
forward
2118 people have browsed it

    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>
    Copy after login

    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
    Copy after login

    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>
    Copy after login

    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>
    Copy after login

    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>
    Copy after login

    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!

    Related labels:
    source:yisu.com
    Statement of this Website
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
    Popular Tutorials
    More>
    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template