A template for starting a clj tools based project.
Batteries included features:
- Project dirs/file basics
- src and test directory structure.
- .gitignore, build.clj, deps.edn, LICENSE, README.
- CI/CD: Github Workflow that runs tests and packages.
- Dependencies: Dependency version checks with 'antq'.
- Tests: Clojure 'test-runner' from Cognitect.
- Packaging: Create jars/uberjars with 'clojure.tools.build'.
- Deploy: Publish jars/uberjars to clojars via 'deps-deploy'.
Run the -main function in the namespace/core.clj file:
- Method 1: Implied -main function in the namespace. Args sent as a list.
clj -M:run-m
- Method 2: Explicit namespace+function. Args sent as a key value map.
clj -X:run-x
Check for outdated dependencies:
clj -M:outdated
Upgrade outdated dependencies.
clj -M:outdated :upgrade true
Run tests:
clj -T:build test
Test, write pom, and build a JAR.
clj -T:build jar
Test, write pom, and build a uberJAR.
clj -T:build uberjar
Clean packaging area.
clj -T:build clean
Deploy jars to clojars:
;; env vars for clojars
CLOJARS_USERNAME=username
CLOJARS_PASSWORD=clojars-token
clj -T:build deploy