I'm developing a web application in Java and I'm using several third party JAR files in my lib
folder. I also have Subversion as my version control tool.
My question is, while checking in my project files, should I check-in the JAR files also or is it not needed to version the JAR files as I'm not modifying them anyway?
A Java Archive, or JAR file, contains all of the various components that make up a self-contained, executable Java application, deployable Java applet or, most commonly, a Java library to which any Java Runtime Environment can link.
The jar tool combines multiple files into a single JAR archive file. jar is a general-purpose archiving and compression tool, based on ZIP and the ZLIB compression format. However, jar was designed mainly to facilitate the packaging of java applets or applications into a single archive.
The JAR File format provides the following benefits. By providing a digital signature in our JAR File, we enhance the security of Java files; as the authorized user who recognize our signature can access the files. It is easy to handle, create, maintain, update, etcetera. so the JAR tool is used to compress the size.
This is a pretty subjective question...I typically apply the following rule of thumb: if I have the code to build a binary, check in the code, and never the binary; if a binary is required to run my code and it comes from an external source, check in the binary.
Note that you'll want to conform to whatever legal conditions might come along with checking in some third party binary to your repository..
I would recommend that wherever possible, you should use Maven. Then you wouldn't need to check third-party JARs into your repository to share them amongst your development team (most of the time).
If you're not already aware, Maven performs two major tasks: build automation and dependency management. Each project has a descriptor file that configures, among other things, which JARs you use as dependencies. The nice thing about that is that Maven will automatically resolve for you the dependencies of those JARs, and their dependencies, and so on.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With