Liking cljdoc? Tell your friends :D

license clojars

Application template

Intro

This Application template helps you to quick start new application project using clojure deps cli and clj-new.

This Application template provides:

  • project control using babashka tasks (v0.3.7+);

  • environment variables control and project configuration using project-config.edn file;

  • secrets & passwords control using project-secrets.edn file;

  • editor configuration via .editorconfig file;

  • configured clj-kondo linter;

  • configured cljstyle formatter;

  • run tests using kaocha.

This template will give you the following basic project workflow:

mike@mbp02 bb tasks
The following tasks are available:

clean        Clean target folder
build        Build application for this project (standalone uberjar file)
install      Install application uberjar file locally (requires the pom.xml file)
deploy       Deploy this application
run          Run application
repl         Run Clojure repl
outdated     Check for outdated dependencies
bump         Bump version artifact in `project-version` file, level may be one of: major, minor, patch, alpha, beta, rc, release.
test         Run tests
format       Format source code
lint         Lint source code
javac        Compile java sources (if any)
jar          Build thin jar file for this application
standalone   Create a standalone application with bundled JDK (using jlink, JDK 9+)
requirements Install project requirements

See also:

Using Application template

New Application project

Before creating a project from this template, please install prerequisites (see below). To create a project from this template just run:

    clojure -X:new :template org.rssys.apptemplate :name com.example/app01
    cd app01

where :new is alias in ~/.clojure/deps.edn file (see prerequisites below).

Please, see README.adoc in a root folder of created project to install other tools once.

Install prerequisites

All these tools you need to install only once.

  1. Install clojure deps cli tools

    1. MacOS

      brew install clojure/tools/clojure
    2. Linux

      Ensure that the following dependencies are installed in OS: bash, curl, rlwrap, and Java.

      curl -O https://download.clojure.org/install/linux-install-1.10.3.822.sh
      chmod +x linux-install-1.10.3.822.sh
      sudo ./linux-install-1.10.3.822.sh
  2. Install latest clj-new library to a file ~/.clojure/deps.edn

    {
     :aliases {
               :new     {:extra-deps {seancorfield/clj-new {:mvn/version "1.1.297"}}
                         :exec-fn    clj-new/create}
              }
    
     }
  3. Install babashka v0.3.7+

    1. MacOS

      brew install borkdude/brew/babashka
    2. Linux

      sudo bash < <(curl -s https://raw.githubusercontent.com/babashka/babashka/master/install)

License

Copyright © 2021 Mike Ananev
Distributed under the Eclipse Public License 2.0 or (at your option) any later version.

Can you improve this documentation?Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close