Maven - Transitive dependencies are not resolved for artifact deployed on Artifactory

前端 未结 1 651
慢半拍i
慢半拍i 2021-01-12 04:28

I have two projects - A and B, where A is dependent on B. I package B as jar and deploy it on a maven server (artifactory), and then include that jar as a normal dependency

相关标签:
1条回答
  • 2021-01-12 05:00

    To successfully resolve transitive dependencies, project B's jar and pom.xml must be accessible in the Maven repository. When deploying artifacts to a remote repository, be sure both the jar and pom.xml are deployed and available for download.

    With the requisite files deployed to the remote repository, use the command line to build project A. Specify a build Maven target to trigger the downloading of all dependencies into the local Maven repository. Something like mvn compile or mvn package will trigger the downloads and successfully build project A.

    Once, project B's jar and pom.xml are in the local Maven repository, update the Maven projects in Eclipse and they will rebuild and resolve the dependencies correctly.

    0 讨论(0)
提交回复
热议问题