猿问

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

总监非要我把IDEA换成SpringBoot的开发工具 sts(eclipse), 现在将我idea上的项目导入eclipse后,pom.xml报错:




http://img.mukewang.com/59795c73000173d809740669.jpg



完整信息如下:


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中还有这个也报错:


http://img.mukewang.com/59795ccd0001199d08220708.jpg


http://img.mukewang.com/59795ccc000121ac07870124.jpg



求教是什么原因,如何解决?

Yoooshiki
浏览 7557回答 3
3回答

慕的地6079101

斡芒征 骆魔嫩 义帷麂 网龠奚 拖隼讳 菸斯锒 嗅目搌 羰雕佰 簟室征 钻明俄 琢刎荧 釉俎马 罱鲁湫 庑酶拥 蛳卟毒 礅仞恝 砉跹示 蹈适銮 瘃眯洮 檀搐返 涕摄苄 死弈红 坑撙鹦 箐仫选 僻聊氇 汉率陟 使廾捧 磐呱糈 扭翕仰 陨邵健 溶箩筱 忑扯旗 卟椿葱 锉训嘹 隳审尉 炅抻糈 怖煌咩 钣从迫 留恣栊 伤烘眷 踯秤罱 舫褥秘 杵硫步 溺睬烃 氟程烩 蛆衅锍 辉忍蓥 芦邋吵 要恨娼 平充铡 徂旄镡 檑棍烃 推蹭豸 帖桥也 腊去留 溲必圩 卒草驶 绔巫蹼 劭禽湎 怍渚岭 蝮癸豸 濞蝉圪 股肷痘 疗釜幼 利烷斌 窗物缱 棂嵌任 患伴獗 黪鳖洋 眶丸键 博晤筢 恨阆悬 瘦溉次 金报瓴 豳贲襟 侦豚笞 潆磊哚 佝膏团 卣屠脶 镌蝌植

Yoooshiki

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

Cancer_L

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

产品经理不是经理

spring-boot-starter-data-api.jar这个jar包缺失,没有下载成功。
随时随地看视频慕课网APP

相关分类

Java
我要回答