Skip to content
vic

kierendavies/mill-explicit-deps

null

kierendavies/mill-explicit-deps.json
{
"createdAt": "2022-02-19T17:27:41Z",
"defaultBranch": "main",
"description": null,
"fullName": "kierendavies/mill-explicit-deps",
"homepage": null,
"language": "Scala",
"name": "mill-explicit-deps",
"pushedAt": "2024-08-05T20:14:47Z",
"stargazersCount": 9,
"topics": [],
"updatedAt": "2023-06-13T22:48:46Z",
"url": "https://github.com/kierendavies/mill-explicit-deps"
}

A Mill plugin for enforcing explicit dependencies. Inspired by sbt-explicit-dependencies.

It allows you to check that ivyDeps and ivyCompileDeps accurately reflect the direct dependencies of your source code.

Import the plugin in your build.sc:

import $ivy.`io.github.kierendavies::mill-explicit-deps::0.2.0`
import io.github.kierendavies.mill.explicitdeps.ExplicitDepsModule

Use the mixin:

object foo extends ScalaModule with ExplicitDepsModule {
// ...
}

Then you can run the command mill -k __.checkExplicitDeps. It will fail if it finds any transitive dependencies which are either

  • imported by a source file but not declared (in ivyDeps or compileIvyDeps), or
  • declared but not imported by any source files.

This plugin requires Mill 0.10.

It has been tested with Scala 2.13.10 and 3.2.1.