lefou / mill-spring-boot   0.0.1

Apache License 2.0 GitHub

Support packaging Spring Boot Applications with Mill

Scala versions: 2.13
Mill plugins: 0.11 0.10

mill-spring-boot - Packaging Spring Boot Applications with Mill

Build Status (GitHub Actions) Test Coverage (Codecov.io)

Mill plugin to support packing of Spring Boot Applications.


Mill version 0.10.0 or newer is required.

import $ivy.`de.tototec::de.tobiasroeser.mill.spring.boot::0.0.1`

import mill._
import mill.scalalib._
import de.tobiasroeser.mill.spring.boot.SpringBootModule

object app extends JavaModule with SpringBootModule {
  override def springBootToolsVersion = "2.7.14"
# Run the Spring-Boot Application
$ mill app.run

# Package as executable Spring-Boot Application
$ mill app.springBootAssembly

Targets and Configuration

Your module needs to extend the de.tobiasroeser.mill.spring.boot.SpringBootModule trait. The following targets are available:

def springBootToolsVersion: T[String]

Required. Override it to specify the version of the Spring Boot tools.

def springBootAssembly: T[PathRef]

Package an (executable) JAR.

You can run the application with java -jar out/app/springBootAssembly.dest/out.jar.

def springBootPrependScript: T[String]

A script prepended to the resulting springBootAssembly to make it executable. This uses the same prepend script logic as Mill JavaModule#prependScript does, so it supports most Linux/Unix shells (probably not fish) as well as Windows cmd shell (the file needs a .bat or .cmd extension in that case). Set it to "" if you don’t want an executable JAR.

def springBootMainClass: T[String]

The main class holding the Spring Boot Application entrypoint. By default, the value of JavaModule.mainClass is used, when defined, otherwise Spring Boot will try to auto-detect it.


You can download binary releases from Maven Central.

Please make sure to use the correct mill platform suffix matching your used mill version.


This project is published under the terms of the Apache License, version 2



Mill is a Scala-based open source build tool. In my opinion the best build tool for the JVM. It is fast, reliable and easy to understand.


I am Tobias Roeser, a professional software developer who loves to create and use open source tools. I’m actively developing and maintaining mill as well as several mill plugins.

If you like my work, please star it on GitHub. You can also support me via GitHub Sponsors.


If you found a bug or have a feature request, please open a new issue on GitHub. I also accept pull requests on GitHub.


0.0.1 - 2023-07-21

  • Initial public release