为了账号安全,请及时绑定邮箱和手机立即绑定

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>

然后不知道该怎么做了。

正在回答

3 回答

https://vk.com/@712781708-92176
https://vk.com/@712782082-143960
https://vk.com/@712782483-50736
https://vk.com/@712781332-147925
https://vk.com/@712772904-98734
https://vk.com/@712774205-94098
https://vk.com/@712534118-37910
https://vk.com/@712782889-121702
https://vk.com/@712781708-92177
https://vk.com/@712782082-143961
https://vk.com/@712782483-50737
https://vk.com/@712781332-147926
https://vk.com/@712772904-98738
https://vk.com/@712774205-94099
https://vk.com/@712534118-37912
https://vk.com/@712782889-121703
https://vk.com/@712781708-92178
https://vk.com/@712782082-143962
https://vk.com/@712782483-50738
https://vk.com/@712781332-147927
https://vk.com/@712772904-98832
https://vk.com/@712774205-94100
https://vk.com/@712534118-37913
https://vk.com/@712782889-121704
https://vk.com/@712781708-92179
https://vk.com/@712782082-143966
https://vk.com/@712782483-50739
https://vk.com/@712781332-147928
https://vk.com/@712772904-98847
https://vk.com/@712774205-94101
https://vk.com/@712534118-37914
https://vk.com/@712782889-121705
https://vk.com/@712781708-92181
https://vk.com/@712782082-143967
https://vk.com/@712782483-50740
https://vk.com/@712781332-147929
https://vk.com/@712772904-98848
https://vk.com/@712774205-94102
https://vk.com/@712534118-37915
https://vk.com/@712782889-121707
https://vk.com/@712781708-92182
https://vk.com/@712782082-143973
https://vk.com/@712782483-50741
https://vk.com/@712781332-147930
https://vk.com/@712772904-98849
https://vk.com/@712774205-94104
https://vk.com/@712534118-37916
https://vk.com/@712782889-121709
https://vk.com/@712781708-92183
https://vk.com/@712782082-143974
https://vk.com/@712782483-50742
https://vk.com/@712781332-147931
https://vk.com/@712774205-94105
https://vk.com/@712534118-37917
https://vk.com/@712782889-121710
https://vk.com/@712781708-92184
https://vk.com/@712782082-143976
https://vk.com/@712782483-50744
https://vk.com/@712781332-147940
https://vk.com/@712772904-98851
https://vk.com/@712774205-94106
https://vk.com/@712534118-37918
https://vk.com/@712782889-121711
https://vk.com/@712781708-92185
https://vk.com/@712782082-143979
https://vk.com/@712782483-50745
https://vk.com/@712781332-147941
https://vk.com/@712772904-98852
https://vk.com/@712774205-94107
https://vk.com/@712534118-37919
https://vk.com/@712782889-121712
https://vk.com/@712781708-92186
https://vk.com/@712782082-143982
https://vk.com/@712782483-50746
https://vk.com/@712781332-147943
https://vk.com/@712772904-98854
https://vk.com/@712774205-94108
https://vk.com/@712534118-37920
https://vk.com/@712782889-121713
https://vk.com/@712781708-92187
https://vk.com/@712782082-143984
https://vk.com/@712782483-50747
https://vk.com/@712781332-147945
https://vk.com/@712772904-98856
https://vk.com/@712774205-94109
https://vk.com/@712534118-37921
https://vk.com/@712782889-121718
https://vk.com/@712781708-92188
https://vk.com/@712782082-143985
https://vk.com/@712782483-50748
https://vk.com/@712781332-147947
https://vk.com/@712772904-98897
https://vk.com/@712774205-94110
https://vk.com/@712534118-37922
https://vk.com/@712782889-121720
https://vk.com/@712781708-92189
https://vk.com/@712782082-143987
https://vk.com/@712782483-50749
https://vk.com/@712781332-147948
https://vk.com/@712772904-98971
https://vk.com/@712774205-94111
https://vk.com/@712534118-37923
https://vk.com/@712782889-121721
https://vk.com/@712781708-92190
https://vk.com/@712782082-143988
https://vk.com/@712782483-50750
https://vk.com/@712781332-147949
https://vk.com/@712772904-98999
https://vk.com/@712774205-94112
https://vk.com/@712534118-37924
https://vk.com/@712782889-121722
https://vk.com/@712781708-92191
https://vk.com/@712782082-143990
https://vk.com/@712782483-50751
https://vk.com/@712781332-147956
https://vk.com/@712772904-99000
https://vk.com/@712774205-94113
https://vk.com/@712534118-37925
https://vk.com/@712781708-92193
https://vk.com/@712782082-143993
https://vk.com/@712782483-50752
https://vk.com/@712781332-147957
https://vk.com/@712772904-99001
https://vk.com/@712774205-94114
https://vk.com/@712534118-37926
https://vk.com/@712782889-121724
https://vk.com/@712781708-92194
https://vk.com/@712782082-143996
https://vk.com/@712782483-50753
https://vk.com/@712781332-147958
https://vk.com/@712772904-99002
https://vk.com/@712774205-94115
https://vk.com/@712534118-37927
https://vk.com/@712782889-121725
https://vk.com/@712781708-92195
https://vk.com/@712782082-143997
https://vk.com/@712782483-50754
https://vk.com/@712781332-147960
https://vk.com/@712772904-99003
https://vk.com/@712774205-94116
https://vk.com/@712534118-37928
https://vk.com/@712782889-121728
https://vk.com/@712781708-92196
https://vk.com/@712782082-143998
https://vk.com/@712782483-50757
https://vk.com/@712781332-147961
https://vk.com/@712772904-99004
https://vk.com/@712774205-94117
https://vk.com/@712534118-37929
https://vk.com/@712782889-121729
https://vk.com/@712781708-92197
https://vk.com/@712782082-143999
https://vk.com/@712782483-50791
https://vk.com/@712781332-147962
https://vk.com/@712772904-99005
https://vk.com/@712774205-94118
https://vk.com/@712534118-37930
https://vk.com/@712782889-121730
https://vk.com/@712781708-92198
https://vk.com/@712782082-144000
https://vk.com/@712782483-50839
https://vk.com/@712781332-147963
https://vk.com/@712772904-99006
https://vk.com/@712774205-94119
https://vk.com/@712534118-37931
https://vk.com/@712782889-121731
https://vk.com/@712781708-92199
https://vk.com/@712782082-144001
https://vk.com/@712782483-50840
https://vk.com/@712781332-147964
https://vk.com/@712772904-99007
https://vk.com/@712774205-94120
https://vk.com/@712534118-37932
https://vk.com/@712782889-121732
https://vk.com/@712781708-92200
https://vk.com/@712782082-144002
https://vk.com/@712782483-50841
https://vk.com/@712781332-147965
https://vk.com/@712772904-99064
https://vk.com/@712774205-94121
https://vk.com/@712534118-37933
https://vk.com/@712782889-121733
https://vk.com/@712781708-92203
https://vk.com/@712782082-144003
https://vk.com/@712782483-50842
https://vk.com/@712781332-147966
https://vk.com/@712772904-99109
https://vk.com/@712774205-94122
https://vk.com/@712534118-37934
https://vk.com/@712782889-121734
https://vk.com/@712781708-92204
https://vk.com/@712782082-144004
https://vk.com/@712782483-50844
https://vk.com/@712781332-147967
https://vk.com/@712772904-99110
https://vk.com/@712774205-94123
https://vk.com/@712534118-37935
https://vk.com/@712782889-121735
https://vk.com/@712781708-92205
https://vk.com/@712782082-144007


0 回复 有任何疑惑可以回复我~
  <mirrors>
    <!-- 阿里云仓库 -->
        <mirror>
            <id>alimaven</id>
            <mirrorOf>central</mirrorOf>
            <name>aliyun maven</name>
            <url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
        </mirror>
    
        <!-- 中央仓库1 -->
        <mirror>
            <id>repo1</id>
            <mirrorOf>central</mirrorOf>
            <name>Human Readable Name for this Mirror.</name>
            <url>http://repo1.maven.org/maven2/</url>
        </mirror>
    
        <!-- 中央仓库2 -->
        <mirror>
            <id>repo2</id>
            <mirrorOf>central</mirrorOf>
            <name>Human Readable Name for this Mirror.</name>
            <url>http://repo2.maven.org/maven2/</url>
        </mirror>
  </mirrors>


1 回复 有任何疑惑可以回复我~

我也遇到了和你一样的问题,请问你解决了吗?

0 回复 有任何疑惑可以回复我~
#1

modify 提问者

解决了,将中央仓库地址修改为阿里云仓库即可:即修改settings.xml,在<mirrors></mirrors>标签下注销原<mirror></mirror>标签,加入如下阿里云仓库的中央仓库地址,修改后的<mirrors></mirrors>标签见下方回复。
2020-02-24 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
项目管理利器——maven
  • 参与学习       173088    人
  • 解答问题       742    个

使用maven来构建和管理Java项目,从环境配置,到maven核心知识

进入课程

mvn compile报错:Return code is: 501 , ReasonPhrase:HTTPS Required.

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信