简体   繁体   English

Maven-如何在SBT项目中获取父Pom文件依赖项

[英]Maven - How to get the parent pom file dependency in sbt project

Not able to resolve the dependencies of maven project in sbt.Here is my issue, 无法解决sbt中Maven项目的依赖关系。这是我的问题,

for example : 例如 :

MyProject => module1(pom.xml) ,module2(pom.xml) , parentPom.xml MyProject => module1(pom.xml),module2(pom.xml),parentPom.xml

After deployment to the artifactory, i have module1.jar,module2.jar and parentPom.pom in the artifactory,when i am trying to add the dependency of module1 in my sbt project i am getting the following error: 部署到工件后,当我试图在我的sbt项目中添加module1的依赖项时,工件中有module1.jar,module2.jar and parentPom.pom ,我得到以下错误:

sbt.ResolveException: unresolved dependency: org.test#module1;5.22.0-SNAPSHOT: local-snapshots: no ivy file nor artifact found for org.test#MyProject;5.22.0-SNAPSHOT.

Can anyone please help me with this!! 谁能帮我这个忙!!

if your module1.jar and module2.jar is a mavne generated jar than go inside jar and fild pom.xml file, it may inside metainf inside jar, search for pom.xml, and look what is the name of pom.xml file inside jar, give the same name in your project pom.xml, if it is not work you can write back to me, can you put your project pom.xml and module1.jar s pom.xml` 如果您的module1.jarmodule2.jar是一个mavne生成的jar,而不是放在jar和fild pom.xml文件中,则它可能在jar的metainf ,搜索pom.xml,并查看其中的pom.xml文件的名称是什么jar,在您的项目pom.xml中使用相同的名称,如果它不起作用,您可以给我回信,可以将您的项目pom.xml和module1.jar s pom.xml放回去吗?

Edited: 编辑:

From the URL you had given in comment is https://github.com/Activiti/Activiti/blob/master/pom.xml After look that pom.xml file you should try to add in your project pom.xml look like this 从注释中给出的URL是https://github.com/Activiti/Activiti/blob/master/pom.xml看了pom.xml文件后,您应该尝试将其添加到项目pom.xml中,如下所示

add dependency 添加依赖

<groupId>org.activiti</groupId>
<artifactId>activiti-root</artifactId>
<modelVersion>4.0.0</modelVersion>

As in above pom.xml it have parent pom so you need that parent pom too in you maven repository. 像上面的pom.xml一样,它具有父pom,因此您在maven存储库中也需要该父pom。

<parent>
    <groupId>org.sonatype.oss</groupId>
    <artifactId>oss-parent</artifactId>
    <version>7</version>
  </parent>

And you should also ready for internal dependency for activity pom.xml. 而且,您还应该准备好活动pom.xml的内部依赖关系。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM