当前位置:   article > 正文

Maven配置文件忘记更新阿里云的Mavne镜像的最新地址

Maven配置文件忘记更新阿里云的Mavne镜像的最新地址

最近更新最新版的IDEA,打开旧的工作空间,发现以前Spring相关项目全部报错并无法运行。

单元测试发现无法识别XML配置文件路径,同时提示各种异常

异常一

org.springframework.beans.factory.BeanDefinitionStoreException:
IOException parsing XML document from class path resource [spring-beans.xml]; nested exception is
java.io.FileNotFoundException: class path resource
[spring-beans.xml] cannot be opened because it does  not exist
  • 1
  • 2
  • 3
  • 4

异常二

Could not get the value for parameter encoding for plugin execution default-resources
Plugin org.apache.maven.plugins:maven-resources-plugin:3.3.1 or one of its dependencies could not be resolved: The following artifacts could not be resolved: 
commons-io:commons-io:jar:2.11.0 (present, but unavailable): 
commons-io:commons-io:jar:2.11.0 failed to transfer from 
https://repo.maven.apache.org/maven2 during a previous attempt. 
This failure was cached in the local repository and resolution is not reattempted until the update interval of central has elapsed or updates are forced. Original error: 
Could not transfer artifact commons-io:commons-io:jar:2.11.0 from/to central (https://repo.maven.apache.org/maven2): 
Connect to repo.maven.apache.org:443 [repo.maven.apache.org/151.101.108.215] failed: Connect timed out
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8

由于阿里云的Mavne镜像已经做了https升级和仓库细化,以前的配置方式已失效,

<!-- 资源在国外 下载慢  配置  阿里云 maven 镜像,同时排除 jeecg 私服 -->
    <mirror>
      <id>nexus-aliyun</id>
      <mirrorOf>*</mirrorOf>
      <name>Nexus aliyun</name>
      <url>http://maven.aliyun.com/nexus/content/groups/public</url>
    </mirror>
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

下面是最新的,可以全部复制以下mirrors节点。

<!--拷贝mirrors节点下的全部内容-->
  <mirrors>
	<mirror>
		<id>aliyun-public</id>
		<mirrorOf>*</mirrorOf>
		<name>aliyun public</name>
		<url>https://maven.aliyun.com/repository/public</url>
	</mirror>

	<mirror>
		<id>aliyun-central</id>
		<mirrorOf>*</mirrorOf>
		<name>aliyun central</name>
		<url>https://maven.aliyun.com/repository/central</url>
	</mirror>

	<mirror>
		<id>aliyun-spring</id>
		<mirrorOf>*</mirrorOf>
		<name>aliyun spring</name>
		<url>https://maven.aliyun.com/repository/spring</url>
	</mirror>

	<mirror>
		<id>aliyun-spring-plugin</id>
		<mirrorOf>*</mirrorOf>
		<name>aliyun spring-plugin</name>
		<url>https://maven.aliyun.com/repository/spring-plugin</url>
	</mirror>

	<mirror>
		<id>aliyun-apache-snapshots</id>
		<mirrorOf>*</mirrorOf>
		<name>aliyun apache-snapshots</name>
		<url>https://maven.aliyun.com/repository/apache-snapshots</url>
	</mirror>

	<mirror>
		<id>aliyun-google</id>
		<mirrorOf>*</mirrorOf>
		<name>aliyun google</name>
		<url>https://maven.aliyun.com/repository/google</url>
	</mirror>

	<mirror>
		<id>aliyun-gradle-plugin</id>
		<mirrorOf>*</mirrorOf>
		<name>aliyun gradle-plugin</name>
		<url>https://maven.aliyun.com/repository/gradle-plugin</url>
	</mirror>

	<mirror>
		<id>aliyun-jcenter</id>
		<mirrorOf>*</mirrorOf>
		<name>aliyun jcenter</name>
		<url>https://maven.aliyun.com/repository/jcenter</url>
	</mirror>

	<mirror>
		<id>aliyun-releases</id>
		<mirrorOf>*</mirrorOf>
		<name>aliyun releases</name>
		<url>https://maven.aliyun.com/repository/releases</url>
	</mirror>

	<mirror>
		<id>aliyun-snapshots</id>
		<mirrorOf>*</mirrorOf>
		<name>aliyun snapshots</name>
		<url>https://maven.aliyun.com/repository/snapshots</url>
	</mirror>

	<mirror>
		<id>aliyun-grails-core</id>
		<mirrorOf>*</mirrorOf>
		<name>aliyun grails-core</name>
		<url>https://maven.aliyun.com/repository/grails-core</url>
	</mirror>

	<mirror>
		<id>aliyun-mapr-public</id>
		<mirrorOf>*</mirrorOf>
		<name>aliyun mapr-public</name>
		<url>https://maven.aliyun.com/repository/mapr-public</url>
	</mirror>
  </mirrors>
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86

更新阿里云镜像后成功运行

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/盐析白兔/article/detail/159277
推荐阅读
相关标签