Build Systems

jbundle automatically detects your build system and runs the appropriate commands.

Supported Build Systems

Build System
Detection File
Build Command

Clojure (tools.build)

deps.edn

clojure -T:build uber

Leiningen

project.clj

lein uberjar

Maven

pom.xml

mvn package -DskipTests

Gradle

build.gradle(.kts)

gradle build -x test

Clojure (deps.edn)

Requirements

Your deps.edn must have a :build alias with tools.build:

{:deps {...}
 :aliases
 {:build
  {:deps {io.github.clojure/tools.build {:mvn/version "0.10.5"}}
   :ns-default build}}}

And a build.clj with an uber function:

(ns build
  (:require [clojure.tools.build.api :as b]))

(def lib 'com.example/my-app)
(def version "1.0.0")
(def class-dir "target/classes")
(def uber-file (format "target/%s-%s.jar" (name lib) version))

(defn uber [_]
  (b/copy-dir {:src-dirs ["src" "resources"]
               :target-dir class-dir})
  (b/compile-clj {:basis (b/create-basis {:project "deps.edn"})
                  :class-dir class-dir})
  (b/uber {:class-dir class-dir
           :uber-file uber-file
           :basis (b/create-basis {:project "deps.edn"})
           :main 'com.example.main}))

What jbundle Does

Clojure (Leiningen)

Requirements

Your project.clj should specify a :main namespace:

What jbundle Does

Java (Maven)

Requirements

Configure the Maven Shade Plugin for uberjar creation:

What jbundle Does

Java (Gradle)

Requirements

Use the Shadow plugin for uberjar creation:

Or with Groovy DSL:

What jbundle Does

From Pre-built JAR

Skip the build step entirely:

Useful when:

  • You have a custom build process

  • The JAR is built by CI

  • You're testing with an existing artifact

Detection Priority

If multiple build files exist, jbundle uses this priority:

  1. deps.edn (Clojure tools.build)

  2. project.clj (Leiningen)

  3. pom.xml (Maven)

  4. build.gradle or build.gradle.kts (Gradle)

Troubleshooting

"No build system detected"

Ensure one of the supported build files is in the root of --input directory.

"JAR not found after build"

Check that your build produces an uberjar (not just a thin JAR). The JAR must include all dependencies.

"Main class not found"

Ensure your JAR's MANIFEST.MF specifies Main-Class.

Last updated

Was this helpful?