1

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.

Peteris
  • 3,281
  • 2
  • 25
  • 40

1 Answers1

0

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.

Jon Onstott
  • 13,499
  • 16
  • 80
  • 133