为了账号安全,请及时绑定邮箱和手机立即绑定

IDEA创建的SpringBoot项目,pom.xml在Eclipse上报错

IDEA创建的SpringBoot项目,pom.xml在Eclipse上报错

Yoooshiki 2017-07-27 11:25:23
总监非要我把IDEA换成SpringBoot的开发工具 sts(eclipse), 现在将我idea上的项目导入eclipse后,pom.xml报错:完整信息如下:For artifact {org.springframework.boot:spring-boot-starter-data-api:null:jar}: The version cannot be empty. (org.apache.maven.plugins:maven-resources-plugin:2.6:testResources:default-testResources:process-test-resources)org.apache.maven.artifact.InvalidArtifactRTException: For artifact {org.springframework.boot:spring-boot-starter-data-api:null:jar}: The version cannot be empty.at org.apache.maven.artifact.DefaultArtifact.validateIdentity(DefaultArtifact.java:148)at org.apache.maven.artifact.DefaultArtifact.(DefaultArtifact.java:123)at org.apache.maven.artifact.factory.DefaultArtifactFactory.createArtifact(DefaultArtifactFactory.java:157)at org.apache.maven.artifact.factory.DefaultArtifactFactory.createDependencyArtifact(DefaultArtifactFactory.java:57)at org.apache.maven.project.artifact.MavenMetadataSource.createDependencyArtifact(MavenMetadataSource.java:328)at org.apache.maven.project.artifact.MavenMetadataSource.createArtifacts(MavenMetadataSource.java:503)at org.apache.maven.lifecycle.internal.DefaultProjectArtifactFactory.createArtifacts(DefaultProjectArtifactFactory.java:50)at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies(LifecycleDependencyResolver.java:119)at org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved(MojoExecutor.java:245)at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:330)at org.eclipse.m2e.core.internal.embedder.MavenImpl$11.call(MavenImpl.java:1362)at org.eclipse.m2e.core.internal.embedder.MavenImpl$11.call(MavenImpl.java:1)at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:176)at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:112)at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:1360)at org.eclipse.m2e.core.project.configurator.MojoExecutionBuildParticipant.build(MojoExecutionBuildParticipant.java:52)at org.eclipse.m2e.core.internal.builder.MavenBuilderImpl.build(MavenBuilderImpl.java:137)at org.eclipse.m2e.core.internal.builder.MavenBuilder$1.method(MavenBuilder.java:172)at org.eclipse.m2e.core.internal.builder.MavenBuilder$1.method(MavenBuilder.java:1)at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod$1$1.call(MavenBuilder.java:115)at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:176)at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:112)at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod$1.call(MavenBuilder.java:105)at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:176)at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:151)at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:99)at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod.execute(MavenBuilder.java:86)at org.eclipse.m2e.core.internal.builder.MavenBuilder.build(MavenBuilder.java:200)at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:735)at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:206)at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:246)at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:301)at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:304)at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:360)at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:383)at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:144)at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:235)at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)pom.xml中还有这个也报错:求教是什么原因,如何解决?
查看完整描述

3 回答

?
Yoooshiki

TA贡献3条经验 获得超3个赞

问题解决了,原来不是要加东西,也不是缺少了什么jar,而是要减东西。把spring-boot-starter-data-api组件注释掉就完美解决了,我也很纳闷,要操作数据库,不是应该需要用到这个组件吗?怎么在idea里面没问题,eclipse里面一直报错,注释掉反而正常了?

//img1.sycdn.imooc.com//59798ab20001490e06940132.jpg


查看完整回答
反对 回复 2017-07-27
?
Cancer_L

TA贡献20条经验 获得超7个赞

从报错信息来看 ,是jar包丢失,可以考虑将Spring-boot的jar包  重新再导入一次

查看完整回答
反对 回复 2017-07-27
  • Yoooshiki
    Yoooshiki
    感谢回复,我已经尝试把本地仓库删除然后重新下载,eclipse上依然报错,idea依然没问题
?
产品经理不是经理

TA贡献481条经验 获得超143个赞

spring-boot-starter-data-api.jar这个jar包缺失,没有下载成功。

查看完整回答
反对 回复 2017-07-27
  • Yoooshiki
    Yoooshiki
    感谢回复,我已经尝试把本地仓库删除然后重新下载,eclipse上依然报错,idea依然没问题
  • 产品经理不是经理
    产品经理不是经理
    你到本地仓库看一下,这个jar包到底下载成功没,没有的话,换一个远程仓库重新下载。
  • Yoooshiki
    Yoooshiki
    问题已经解决,请看一下我新加的回答,原来不是要加东西,而是减东西。
  • 3 回答
  • 0 关注
  • 7555 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信