Maven配置 - settings.xml

settings.xml

<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
                          https://maven.apache.org/xsd/settings-1.0.0.xsd">
	<!--
	<localRepository>D:\home\java\maven_repository</localRepository>
	-->

	<interactiveMode />
	<usePluginRegistry />
	<offline />
	<pluginGroups />
	<servers />
	<mirrors>
		<mirror>
			<id>nexus</id>
			<name>Tedu Maven</name>
			<mirrorOf>*</mirrorOf>
			<url>http://maven.tedu.cn/nexus/content/groups/public/</url>
		</mirror>

		<!--
		<mirror>
			<id>alimaven</id>
			<name>aliyun maven</name>
			<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
			<mirrorOf>central</mirrorOf>
		</mirror>
		-->
		
	</mirrors>
	<proxies />
	<profile>
		<id>jdk18</id>
		<activation>
			<activeByDefault>true</activeByDefault>
			<jdk>1.8</jdk>
		</activation>
		<properties>
			<maven.compiler.source>1.8</maven.compiler.source>
			<maven.compiler.target>1.8</maven.compiler.target>
			<maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
		</properties>
	</profile>
	<activeProfiles />
</settings>

缺少jar文件

方法一: maven update

  • 在本地仓库目录搜索 “*.lastupdate”
  • 删除所有找到的文件
  • 在eclipse中,右键点击项目–maven–Update Project

方法二: 使用中央仓库

使用的国内镜像仓库可能缺少最新的jar文件

可以把所有镜像仓库注释掉,使用maven的中央仓库

方法三: 复制jar文件

以上方法都没用,那么可以复制别人可用的仓库,复制缺少的jar文件

发布了11 篇原创文章 · 获赞 448 · 访问量 4万+

猜你喜欢

转载自blog.csdn.net/weixin_38305440/article/details/103709712