Chapter 5. Packaging projects
This chapter covers:
We can now compile and test our diary classes, using Ant, <javac>, and <junit>. This code can be turned into a JAR library. It can be used inside our application, or it can be redistributed for other people to use.
This brings us and our build file to the next problem: packaging a program for reuse and redistribution. We want to take the compiled classes and create a JAR file that can itself be bundled into some source and binary redistribution packages���such as Zip and tar files���for different platforms. We will then be able to execute the JAR file and upload the Zip and tar files to servers. We are effectively releasing our diary as a library, on the basis that having passed its tests, it���s ready for use.
What else does a project need to do before releasing a Java program?
- Create the documentation.
- Write any platform-specific bootstrap scripts, batch files, or programs.
- Write any installer configuration files, such as Java Web Start files.
- Build the application and package it into a JAR file.
- Pass the test suite.
- Bundle the JAR, the documentation, and any other files into redistributable packages (usually Zip and tar files).