mvn compile報錯:Return code is: 501 , ReasonPhrase:HTTPS Required.
maven version:Apache Maven 3.0.5
Java version: 1.7.0_80
-----------------------------------------------
按老師的操作執行到mnv compile時報錯:
[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]
------------------------------------------------
百度了一下,修改了settings.xml,增加:
<mirror> ??????<id>repo1</id> ??????<mirrorOf>central</mirrorOf> ??????<name>Maven?Repository?Switchboard</name> ??????<url>https://repo1.maven.org/maven2/</url>???? </mirror> ???? <mirror>?????? ??????<id>repo2</id>?????? ??????<mirrorOf>central</mirrorOf>?????? ??????<name>Human?Readable?Name?for?this?Mirror.</name>?????? ??????<url>https://repo2.maven.org/maven2/</url>???? </mirror>
---------------------------------------------------------------
繼續mvn compile,繼續報錯:
[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 repo1 (https://repo1.maven.org/maven2/): peer not authenticated -> [Help 1]
----------------------------------------------------------------
在本地包里找不到maven-resources-plugin:2.5,按百度到的方法修改pom.xml,加入:
<dependency> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-resources-plugin</artifactId> <version>2.5</version> </dependency>
然后不知道該怎么做了。
2022-03-29
2020-02-24
2020-02-23
我也遇到了和你一樣的問題,請問你解決了嗎?