Maven- No plugin found for prefix 'spring-boot' in the current project and in the plugin groups

后端 未结 11 1998
心在旅途
心在旅途 2020-12-02 14:56

I am trying to build a springboot project I built with Spring Tools Suite. I get the following error when I execute $mvn spring-boot:run

Downlo         


        
相关标签:
11条回答
  • 2020-12-02 15:30

    If you don't want to use

    <parent>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-parent</artifactId>
      <version>(...)</version>
    </parent>
    

    as a parent POM, you may use the

    mvn org.springframework.boot:spring-boot-maven-plugin:run
    

    command instead.

    0 讨论(0)
  • 2020-12-02 15:30

    Typos are a possible reason for this error.

    Be sure to check you wrote spring-boot and not e.g. springboot or sprint-boot or springbok or whatever.

    Also check the ordering : use spring-boot:run and not run:spring-boot.

    0 讨论(0)
  • 2020-12-02 15:32

    You should run the $ mvn spring-boot:run from the folder where your pom.xml file is located and refer to this answer https://stackoverflow.com/a/33602837/4918021

    0 讨论(0)
  • 2020-12-02 15:33

    In my case, my maven variable environment was M2_HOME, so I've changed to MAVEN_HOME and worked.

    0 讨论(0)
  • 2020-12-02 15:34

    If you are using Spring Boot for application, forgetting to add

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.2.7.RELEASE</version>
     </parent>
    

    can cause this issue, as well as missing these lines

    <repositories>
        <repository>
            <id>spring-releases</id>
            <url>https://repo.spring.io/libs-release</url>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>spring-releases</id>
            <url>https://repo.spring.io/libs-release</url>
        </pluginRepository>
    </pluginRepositories>
    
    0 讨论(0)
  • 2020-12-02 15:37

    If you are running the

    mvn spring-boot:run
    

    from the command line, make sure you are in the directory that contains the pom.xml file. Otherwise, you will run into the No plugin found for prefix 'spring-boot' in the current project and in the plugin groups error.

    0 讨论(0)
提交回复
热议问题