原来开发的机器,重装系统了,结果使用netbeans调试工程的时候,发现maven一直连不上

于是把mavern组件的目标url扔到浏览器里边,这才看到了报错信息

maven换源https问题Maven dependencies are failing with a 501 error

然后一查才知道是maven换了https,

因为原来开发用的机器早就把需要用到的库存到本地了,所以,没有受到影响

但是,新机器,还是去访问原来的http源,所以就出问题了

找了一下资料,以下是如何修改

 <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>

   <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>

 

相关文章:

  • 2022-12-23
  • 2021-06-03
  • 2021-07-30
  • 2022-12-23
  • 2021-06-21
  • 2021-11-07
  • 2022-12-23
  • 2021-07-26
猜你喜欢
  • 2021-07-05
  • 2021-12-17
  • 2021-06-03
  • 2021-12-20
  • 2022-12-23
  • 2022-12-23
  • 2021-10-24
相关资源
相似解决方案