java - Best practice to store .jar files in VCS (SVN, Git, ...) -


i know, in time of maven not recommended store libraries in vcs, makes sense, though.

my question how best store them - compressed or uncompressed? uncompressed larger, if replaced couple of times newer ones, maybe stored difference between 2 uncompressed .jar files might smaller difference of compressed ones. did make tests?

best practice store .jar files in vcs (svn, git, …): don't.

it make sense in cvcs (centralized vcs) svn, can handle millions of files whatever size is.

it doesn't in dvcs, 1 git (and its limits):

  • binary files don't fit vcs.
  • by default, cloning dvcs repo all of history, jar versions.
    slow , take lot of disk space, not matter how jar compressed.
    try play shallow cloning, that's highly unpractical.

use second repository, nexus, storing jars, , reference txt file (or pom.xml file maven project) in order fetch right jar versions.
artifact repo more adapted distribution , release management purpose.


all being said, if must store jar in git repo, have recommend store them in compressed format (which default format jar: see creating jar file)
both compressed , uncompressed format treated binary git, @ least, in compressed format, clone , checkout take less time.

however, many threads mentions possibility store jar in uncompressed format:

i'm using repos regular 50mb tarballs checked them.
convinced them not compress tarballs, , git decent job of doing delta compression between them (although needs quite bit of ram so).

you have more on deltified object on git here:

  • it not make difference if dealing binary or text;
  • the delta not against same path in previous revision, new file added history can stored in delitified form;
  • when object stored in deltified representation used, incur more cost using same object in compressed base representation. deltification mechanism makes trade-off taking cost account, space efficiency.

so, if clones , checkouts not common operations have perform every 5 minutes, storing jar in uncompressed format in git make more sense because:

  • git compressed/compute delta files
  • you end uncompressed jar in working directory, jars potentially loaded more quickly.

recommendation: uncompressed.


Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -