maven项目出现“'dependencies.dependency.version' for xxx:jar is missing. @ line xx, colu”

出现这样的问题就是jar包版本问题,每个人的解决方式都不一样。

问题如下:

[ERROR]   The project XXX (/home/×××/pom.xml) has 1 error
[ERROR]     'dependencies.dependency.version' for xxx:jar is missing. @ line xx, column xx
		<dependencies>
			<dependency>
				<groupId>com.taotao</groupId>
				<artifactId>taotao-mapper</artifactId>
				<version>0.0.1-SNAPSHOT</version>
			</dependency>
			<!-- Spring -->
			<dependency>
				<groupId>org.springframework</groupId>
				<artifactId>spring-context</artifactId>
			</dependency>
			<dependency>
				<groupId>org.springframework</groupId>
				<artifactId>spring-beans</artifactId>
			</dependency>
			<dependency>
				<groupId>org.springframework</groupId>
				<artifactId>spring-webmvc</artifactId>
			</dependency>
			<dependency>
				<groupId>org.springframework</groupId>
				<artifactId>spring-jdbc</artifactId>
			</dependency>
			<dependency>
				<groupId>org.springframework</groupId>
				<artifactId>spring-aspects</artifactId>
			</dependency>
			<dependency>
				<groupId>javax.servlet</groupId>
				<artifactId>servlet-api</artifactId>
				<scope>provided</scope>
			</dependency>
			<dependency>
				<groupId>javax.servlet</groupId>
				<artifactId>jsp-api</artifactId>
				<scope>provided</scope>
			</dependency>
			<!-- solr客户端 -->
			<dependency>
				<groupId>org.apache.solr</groupId>
				<artifactId>solr-solrj</artifactId>
			</dependency>
		</dependencies>

尝试多次,子项目加载时总是报如上缺少jar包版本信息的错误,

最后想着试试添加上

<dependencyManagement>

<dependencyManagement>

这个标签试试,没想到好了。这个是jar版本控制声明,缺少它还不行。

解决问题~~~

  • 3
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值