Github库之间的库(jar)依赖关系 [英] Library (jar) dependencies between github repositories

查看:417
本文介绍了Github库之间的库(jar)依赖关系的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我找不到一个合适的方式来构建git存储库来处理git存储库之间的库依赖关系。
我有许多Java项目依赖于另一个频繁更新的项目,这些项目包含在.jar库中。我现在希望将它们全部迁移到github上。

我可以在github中设置项目,以便每当我推送项目A时,所有其他项目都可以提取新版本projectA.jar的自动生成?他们不依赖任何源文件,他们只需要最新的libraray jar。目前,它是通过一个ant脚本完成的,该脚本试图在每个构建中从其他项目复制最新的jar。 解决方案

更改项目对Maven来说可能是一个很大的帮助; .jar文件将不再存储在版本控制中。



您需要打开项目A,运行'mvn install'在您的PC上生成库文件,然后那么你可以使用项目B中的项目A的库。



另一种方法是运行你自己的Maven构件服务器,比如Artifactory,Nexus等等。查看工件服务器以查看项目A的文件是否可用。


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.

解决方案

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.

这篇关于Github库之间的库(jar)依赖关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆