CI_CD/maven

[maven] 메이븐 빌드 에러#1(maven-clean-plugin:2.4.1 )

홍또~ 2020. 6. 23. 11:29

Jenkins로 빌드중 아래와 같은 maven 빌드에러가 나타났다.

[ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:2.4.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.4.1: Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.4.1 from/to central (http://repo.maven.apache.org/maven2): Failed to transfer file: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.4.1/maven-clean-plugin-2.4.1.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 
Build step 'Invoke top-level Maven targets' marked build as failure

pom.xml에

<repository>
<releases>
<enabled>true</enabled>
</releases>
<id>central</id>
<url>https://repo.maven.apache.org/maven2</url>
</repository>

<pluginRepositories>
<pluginRepository>
<releases>
<enabled>true</enabled>
</releases>
<id>central</id>
<url>https://repo.maven.apache.org/maven2</url>
</pluginRepository>
</pluginRepositories>

이렇게 두가지를 추가해 주고나서 에러가 해결 되었다.

만약 추가해도 해결이 되지않는다면 다음을 확인해본다

1.maven빌드를 돌리는 서버의 인터넷 연결가능여부

2.maven빌드를 돌리는 서버의 네임서버가 정상인지 확인