Add at root of your project file pbuild.edn. Keys :main and :omit-source? are valid for uberjar project only.
Here is an example for this project:
{
;;:java-source-paths "java-src"
;;:javac-options ["-target" "1.8" "-source" "1.8" "-Xlint:-options"]
:warn-on-resource-conflicts? true
:deploy-signed? true
:deploy-repo {:id "clojars" :url "https://clojars.org/repo"}
:deploy-creds :m2-settings ;; :m2-settings or :password-prompt
:target-folder "target"
:group-id "org.rssys"
:artifact-id "pbuilder"
:artifact-version "0.1.0-SNAPSHOT"
:main "org.rssys.pbuilder.core"
:omit-source? true
;;:uberjar-filename "pbuilder.jar"
:description "Project builder – is a build tool for Clojure projects."
:url "https://github.com/redstarssystems/pbuilder.git"
:scm {:url "https://github.com/redstarssystems/pbuilder.git"}
:license {:name "EPL-2.0"
:url "https://www.eclipse.org/legal/epl-2.0/"}
}
Add to :aliases section of deps.edn pbuilder dependency (see latest version):
:pbuilder {:extra-deps {org.rssys/pbuilder {:mvn/version "0.1.0-SNAPSHOT"}}
:jvm-opts []
:main-opts ["--main" "org.rssys.pbuilder.core"]}
Then run clojure -A:pbuilder <command>
.
List of available commands:
-
clean - clear target folder
-
javac - compile java sources
-
compile - compile clojure code
-
jar - build jar file (as library)
-
uberjar - build standalone executable jar file (uberjar)
-
install - install jar file (library) to local .m2
-
deploy - deploy jar file (library) to clojars.org
-
conflicts - show class conflicts (same name class in multiple jar files)
-
standalone - build standalone bundle uberjar + custom JRE using JDK 9+ jlink.
-
release - release artifact.
To release artifact run clojure -A:pbuild release
. Optional parameter for release is one of the following values:
major, minor, patch, alpha, beta, rc, qualifier, release
.
Example: clojure -A:pbuild release minor