Chapter 12. Distributing your projects

 

This chapter covers

  • Common methods of deploying JVM applications
  • Publishing common libraries/artifacts into a company repository
  • Generating a zip-based distribution
  • Creating a Linux distribution

One of the most important and often overlooked aspects of software development is deployment. No project is useful in pure code form: it must be given to others. The best way to distribute your code generally depends on several factors, including what the code is intended to do. Is the code a library? Does it define a service? Is it meant to be run in a cluster? In addition, the tools available for running programs can alter whether a given deployment option is a good idea.

The key rule of any build administrator is to ensure the requirements of all the stakeholders of a build are met. Builds are generally a key bridge between three things: the developer, the machine, and the system administrator. This chapter focuses on the handoff between the developers and the system administrators.

In this chapter we’ll cover two types of projects and a few deployment options for libraries and services. Figure 12.1 shows a simple decision tree for determining how to deploy libraries and services. sbt’s default build is optimized for the right side of the decision tree: publishing private and public libraries. First we’ll look at the hooks to do this for library code you’d like to share between projects.

Figure 12.1. Distribution decision tree

12.1. Publishing a library

12.2. Publishing locally

12.3. Publishing a simple server

12.4. Generating a distribution

12.5. Creating a Linux distribution

12.6. Summary