Manage the Project

Web Development with Clojure, Third Edition — by Dmitri Sotnikov, Scot Brown (21 / 107)

The Pragmatic Programmers
The Pragmatic Programmers

--

👈 Chapter 3 Luminus Architecture | TOC | Think in Terms of Application Components 👉

As we already saw working on the guestbook application, the project is managed using the configuration specified in the project.clj file.

Leiningen uses the concept of profiles to identify different build scenarios for the project. The dev and the test profiles are used for development and testing, respectively.

The UberJar profile is used to package the application for deployment. When the production build happens, the compiled bytecode is emitted into the resulting JAR. This results in a self-contained application that can be run using the standard Java Runtime Environment (JRE).

Profile-Specific Resources

Profiles can contain any configuration options that can be specified in the global scope. For example, we can add specific dependencies or plugins that are only necessary for development. Since we wouldn’t want to package those for production, we don’t specify them at the top level.

Each profile also specifies its own paths for source files and resources. The :dev profile has the :resource-paths [“env/dev/resources”] resource path. This path is used in addition to the global resources. This allows us to provide environment-specific settings for the app.

--

--

The Pragmatic Programmers
The Pragmatic Programmers

We create timely, practical books and learning resources on classic and cutting-edge topics to help you practice your craft and accelerate your career.