Liking cljdoc? Tell your friends :D

MonkeyCI Maven Plugin

This is a MonkeyCI plugin that provides Maven functionality to build scripts. You could of course also declare your own container jobs, but why should you, if you can just use this very simple plugin?

Usage

Include it in your .monkeyci/deps.edn:

{:deps {com.monkeyci/plugin-mvn {:mvn/version "<VERSION>"}}}

And require it in your build.clj:

(ns build
  (:require [monkey.ci.plugin.mvn :as mvn]))

The core function is simply called mvn and it allows you to declare a job that runs any Maven command in a container. For example:

;; This runs `mvn verify` in a container
(mvn/mvn {:job-id "verify" :cmd "verify"})

Simple as that! Note that it also declares a cache for the dependency repository, which speeds up the process significantly. But since a some of the Maven commands are used very frequently, I've added them as separate functions: test, verify, install, deploy,... Read on for more!

You can also specify multiple goals and options in a more structured manner to the mvn function:

(mvn/mvn {:job-id "verify"
          :goals ["verify"]
	  :opts ["--threads=10"]
	  :m2-cache "my-cache"})

The above will construct a command line that looks like this:

$ mvn --threads=10 -Dmaven.repo.local=my-cache verify

Available Jobs

A number of functions have been defined that make it easier to run some common scenarios. Some declare a single job, others multiple jobs, even with conditions. Since most of these jobs are simply thin wrappers around the mvn function, they don't take many options. If you need differing behaviour, it's better to just call mvn directly.

FunctionMaven commandOptions
verifymvn verifyid, defaults to mvn-verify
testmvn testid, defaults to mvn-test
deploymvn deploy:deployverify-job-id, job-id
libmvn verify && mvn deploy:deploySame as deploy

More will be added later.

Examples

;; Verify job
(mvn/verify)

;; Test job with custom id
(mvn/test "my-test-job")

;; Deploy job, depends on test
(mvn/deploy {:verify-job-id "my-test-job"})

License

Copyright (c) 2025 by Monkey Projects

MIT License

Can you improve this documentation?Edit on GitHub

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close