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>
然后不知道该怎么做了。