Library (jar) dependencies between github repositories

眉间皱痕 提交于 2020-01-02 23:58:29

问题


I can't figure out an appropriate way to structure git repositories to handle library dependencies between git repositiories. I have a number of Java projects that rely on another, frequently updated project that's included in them as a .jar library. I now want to migrate them all to github.

Can I set up the projects in github so that whenever I push project A, then all other projects can pull the new version of projectA.jar automagically? They don't rely on any source files, they just need the latest libraray jar. Currently it's done by an ant script that tries to copy the latest jar from the other project at each build.


回答1:


Changing your project over to Maven may be a big help; .jar files would no longer be stored in version control.

You would need to open project A, run 'mvn install' to produce the library files on your PC, and then you could use project A's libraries from project B.

Another alternative is to run your own Maven artifacts server, such as Artifactory, Nexus, etc... Project B would look at the artifacts server to see if project A's files are available.



来源:https://stackoverflow.com/questions/10551280/library-jar-dependencies-between-github-repositories

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!