欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

maven更新失败问题解决

程序员文章站 2022-05-03 12:00:44
...

Maven无法更新私服jar包问题

在通过maven setting文件配置私服信息

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
  <localRepository>D:\maven_repository</localRepository>
  <pluginGroups></pluginGroups>
  <proxies></proxies>
  <servers>
    <server>
      <id>maven-releases</id>
      <username>xxx</username>
      <password>xxx</password>
    </server>
	<server>
	 <id>maven-snapshots</id>
	 <username>xxx</username>
	 <password>xxx</password>
	</server>
  </servers>
  <mirrors>	
	<mirror>
	<id>nexus</id>
  	<mirrorOf>*</mirrorOf>
  	<name>nexus</name>
  	<url>http://xx.xx.xx.xx:xxxx/repository/maven-public/</url>
  </mirror>
  </mirrors>
  <profiles></profiles>
</settings>

再该处配置完后仍然访问不到,则可以在引用的pom文件加入如下配置:

<repositories>
    <repository>
	    <id>Snapshots</id>
	    <url>http://xx.xx.xx.xx:xxxx/repository/maven-public/</url>
	    <snapshots>
		    <enabled>true</enabled>
		    <updatePolicy>always</updatePolicy>
	    </snapshots>
    </repository>
</repositories>
相关标签: Maven maven