본문 바로가기

Dev/Spring

spring-Maven 오류

728x90
반응형
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building web Maven Webapp 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.5/maven-resources-plugin-2.5.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.702s
[INFO] Finished at: Tue Jul 21 19:33:10 KST 2020
[INFO] Final Memory: 6M/113M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.5: Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.5 from/to central (http://repo.maven.apache.org/maven2): Failed to transfer file: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.5/maven-resources-plugin-2.5.pom. Return code is: 501 , ReasonPhrase:HTTPS Required. -> [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/PluginResolutionException

기존에 잘 사용하고 있던 pom.xml에서 새로 설치하는 서버에서 오류가 발생하였다.

 

아래는 오류내용을 확인하는 페이지이다.

https://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException

 

PluginResolutionException - Apache Maven - Apache Software Foundation

This error occurs when you employ a plugin that Maven could not download. Possible causes for this error are: You are referring to a non-existing plugin, e.g. by means of a typo in its group id, artifact id or version. You are using a third-party Maven plu

cwiki.apache.org

 

이 오류의 maven의 레포지토리의 문제로 인해 발생이 된다. 

지원받는 라이브러리가 https가 아닌 http로 되어 있는 경우 발생이 된다.

 

아래의 정보를 pom.xml에 추가 하면 된다.

<pluginRepositories>
        <pluginRepository>
            <id>central</id>
            <name>Central Repository</name>
            <url>https://repo.maven.apache.org/maven2</url>
            <layout>default</layout>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <releases>
                <updatePolicy>never</updatePolicy>
            </releases>
        </pluginRepository>
    </pluginRepositories>
    <repositories>
        <repository>
            <id>central</id>
            <name>Central Repository</name>
            <url>https://repo.maven.apache.org/maven2</url>
            <layout>default</layout>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
    </repositories>

 

추가하고 다시  mvn clean install 을 실행한다.

그럼 정상적으로 처리가 될것이다.

728x90
반응형