Should jar dependencies be used for general repo or only for source files?

We have a Scala project with several source files (in Scala and Java) and quite some dependencies in various binary formats (jar and DLL). I am wondering what should be done in our shared git repository. Only the source files (developers have to download or somehow resolve the dependencies themselves), or both the source files and the dependencies? I can add that addictions are third parties and are available for free download.

+4
source share
4 answers

I would recommend not including jar and dll in the Git repository: it will make the specified repo pretty large quickly, and the future git clone will not be as easy to do as with a simple source repository (as in β€œno binary files”).

I would install Nexus repo and manage your dependencies via sbt .

+5
source

We prefer to store .jar files in the same repository, because

  • they are updated very rarely, so there is not much overhead for older libraries.
  • we prefer standalone packages and do not want to configure our own Maven server
+7
source

Downloading dependencies from another place can be problematic: I think you can’t assure that the downloaded version is still the version your project needs. If further development of dependencies, their interfaces can change, and you will have problems with this.

So, I would recommend putting dependencies in git repo to make sure you are working with a consistent version of the dependencies. They will not change every week (they should not), so the repo will not grow so fast. And disk space is cheap. So this is not such a big problem.

If you want to save disk space, you can archive the dependencies in one file (which will not have such a big effect, since banks are already archived).

+4
source

There are two questions here:

  • Development dependency management
  • User Dependency Distribution

If all developers have serial access to the Internet and are not behind a proxy server, which makes it almost impossible for anything other than Internet Explorer (or another official IT-configured application) to escape, then when possible, I would they are automatically downloaded using sbt or Maven and do not include them in the source repository. For dependencies that cannot be managed automatically, I would include them in the source repository. If something other than Internet Explorer passes the proxy server, this exercise is useless; I would put everything in the repository. I work for a large company, and recently sbt and Maven managed to skip the proxy, but I think that in the past Maven has failed, and there are many tools that are almost impossible to overcome.

As for the distribution, I would create a build target that fastens everything I need, including dependencies, and I would be very tempted to check it for a repo so that it doesn't get lost.

+1
source

Source: https://habr.com/ru/post/1333381/


All Articles