program story

Maven- 현재 프로젝트 및 플러그인 그룹에서 접두사 'spring-boot'에 대한 플러그인을 찾을 수 없습니다.

inputbox 2021. 1. 9. 09:52
반응형

Maven- 현재 프로젝트 및 플러그인 그룹에서 접두사 'spring-boot'에 대한 플러그인을 찾을 수 없습니다.


Spring Tools Suite로 빌드 한 springboot 프로젝트를 빌드하려고합니다. 실행할 때 다음 오류가 발생합니다.$mvn spring-boot:run

Downloading: https://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadata.xml
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-metadata.xml
Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-metadata.xml (13 KB at 14.0 KB/sec)
Downloaded: https://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadata.xml (20 KB at 21.8 KB/sec)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.032 s
[INFO] Finished at: 2015-06-15T17:46:50-04:00
[INFO] Final Memory: 11M/123M
[INFO] ------------------------------------------------------------------------
[ERROR] No plugin found for prefix 'spring-boot' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (/Users/admin/.m2/repository), central (https://repo.maven.apache.org/maven2)] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1]     http://cwiki.apache.org/confluence/display/MAVEN/NoPluginFoundForPrefixException`

여기 내 pom.xml 플러그인

    <build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <configuration>
                <arguments>
                    <argument>--spring.profiles.active=dev</argument>
                </arguments>
            </configuration>
        </plugin>
    </plugins>
</build>

위의 jhipster 플러그인을 시도했지만 오류가 변경되지 않았습니다.


응용 프로그램에 Spring Boot를 사용하는 경우 추가하는 것을 잊었습니다.

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

이 문제가 발생할 수 있으며 이러한 줄이 누락 될 수 있습니다.

<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>

실행중인 경우

mvn spring-boot:run

명령 줄에서 pom.xml 파일 이 포함 된 디렉터리에 있는지 확인 합니다. 그렇지 않으면 현재 프로젝트 및 플러그인 그룹 오류 에서 접두사 'spring-boot'에 대한 플러그인을 찾을 수 없습니다 .


pom에 다음을 추가하고 컴파일을 시도 할 수 있습니다.

   <repositories>
        <repository>
            <id>spring-snapshots</id>
            <url>http://repo.spring.io/libs-snapshot</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>spring-snapshots</id>
            <url>http://repo.spring.io/libs-snapshot</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>

사용하고 싶지 않은 경우

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

부모 POM으로 사용할 수 있습니다.

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

command instead.


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


In my case I was getting same error and the cause was I had a typo in the command I was using. Was using mvn springboot:run instead of the spring-boot. Using the right command resolved it for me.


Adding spring-boot-maven-plugin in the build resolved it in my case

<build>
    <finalName>mysample-web</finalName>
    <plugins>
    <plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
        <dependencies>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>springloaded</artifactId>
                <version>1.2.1.RELEASE</version>
            </dependency>
        </dependencies>
    </plugin>
    </plugins>
</build>  

Make sure pom.xml exist in the directory, when using the mvn spring-boot:run command. No need to add any thing in the pom.xml file.


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

Tnx.

ReferenceURL : https://stackoverflow.com/questions/30855864/maven-no-plugin-found-for-prefix-spring-boot-in-the-current-project-and-in-th

반응형