@Scaladoc(value = "/**\n * Miscellaneous machinery around traversing & querying the build hierarchy,\n * that should not be needed by normal users of Mill\n */")
@Scaladoc(value = "/**\n * Optional custom Java Home for the JvmWorker to use\n *\n * If this value is None, then the JvmWorker uses the same Java used to run\n * the current mill instance.\n */")
@Scaladoc(value = "/**\n * The repositories used to resolve dependencies\n *\n * Unlike [[repositoriesTask]], this includes the Mill internal repositories,\n * which allow to resolve Mill internal modules (usually brought in via\n * `JavaModule#coursierDependency`).\n *\n * Beware that this needs to evaluate `JavaModule#coursierProject` of all\n * module dependencies of the current module, which itself evaluates `JavaModule#mvnDeps`\n * and related tasks. You shouldn\'t depend on this task from implementations of `mvnDeps`,\n * which would introduce cycles between Mill tasks.\n */")
Unlike repositoriesTask, this includes the Mill internal repositories, which allow to resolve Mill internal modules (usually brought in via JavaModule#coursierDependency).
Beware that this needs to evaluate JavaModule#coursierProject of all module dependencies of the current module, which itself evaluates JavaModule#mvnDeps and related tasks. You shouldn't depend on this task from implementations of mvnDeps, which would introduce cycles between Mill tasks.
@Scaladoc(value = "/**\n * Bind a dependency ([[Dep]]) to the actual module context (e.g. the scala version and the platform suffix)\n * @return The [[BoundDep]]\n */")
@Scaladoc(value = "/**\n * Customize the coursier file cache.\n *\n * This is rarely needed to be changed, but sometimes e.g. you want to load a coursier plugin.\n * Doing so requires adding to coursier\'s classpath. To do this you could use the following:\n * {{{\n * override def coursierCacheCustomizer = Task.Anon {\n * Some( (fc: coursier.cache.FileCache[Task]) =>\n * fc.withClassLoaders(Seq(classOf[coursier.cache.protocol.S3Handler].getClassLoader))\n * )\n * }\n * }}}\n * @return\n */")
This is rarely needed to be changed, but sometimes e.g. you want to load a coursier plugin. Doing so requires adding to coursier's classpath. To do this you could use the following:
@Scaladoc(value = "/**\n * A `CoursierModule.Resolver` to resolve dependencies.\n *\n * Can be used to resolve external dependencies, if you need to download an external\n * tool from Maven or Ivy repositories, by calling `CoursierModule.Resolver#classpath`.\n *\n * @return `CoursierModule.Resolver` instance\n */")
A CoursierModule.Resolver to resolve dependencies.
A CoursierModule.Resolver to resolve dependencies.
Can be used to resolve external dependencies, if you need to download an external tool from Maven or Ivy repositories, by calling CoursierModule.Resolver#classpath.
@Scaladoc(value = "/**\n * The repositories used to resolve dependencies with [[classpath()]]. This\n * takes Coursier repository strings as input which are defined here:\n *\n * - https://github.com/coursier/coursier/blob/main/docs/pages/reference-repositories.md\n *\n * For example:\n *\n * - https://repo1.maven.org/maven2\n * Maven Central which is the most commonly used Maven repository\n *\n * - file:///Users/alex/test-repo\n * A local repository cache on disk\n *\n * - file://${ivy.home-${user.home}/.ivy2}/local/[defaultPattern]\n * The local Ivy2 repository where Mill, Scala CLI,\n * or sbt publish to when asked to publish locally\n *\n * - file://${user.home}/.m2/repository\n * the local Maven repository. Use of this is not recommended for reasons explained in the link above\n *\n * - https://maven.google.com\n * Google-managed repository that distributes some Android artifacts in particular\n */")
@Scaladoc(value = "/**\n * A more flexible version of [[repositories]], that allows custom repositories\n * that are not definable by Coursier repository strings. This is a relatively\n * advanced feature, and for most situations overriding [[repositories]] should\n * be sufficient\n *\n * See [[allRepositories]] if you need to resolve Mill internal modules.\n */")
A more flexible version of repositories, that allows custom repositories that are not definable by Coursier repository strings. This is a relatively advanced feature, and for most situations overriding repositories should be sufficient
A more flexible version of repositories, that allows custom repositories that are not definable by Coursier repository strings. This is a relatively advanced feature, and for most situations overriding repositories should be sufficient
See allRepositories if you need to resolve Mill internal modules.
@Scaladoc(value = "/**\n * Customize the coursier resolution process.\n * This is rarely needed to changed, as the default try to provide a\n * highly reproducible resolution process. But sometime, you need\n * more control, e.g. you want to add some OS or JDK specific resolution properties\n * which are sometimes used by Maven and therefore found in dependency artifact metadata.\n * For example, the JavaFX artifacts are known to use OS specific properties.\n * To fix resolution for JavaFX, you could override this task like the following:\n * {{{\n * override def resolutionCustomizer = Task.Anon {\n * Some( (r: coursier.core.Resolution) =>\n * r.withOsInfo(coursier.core.Activation.Os.fromProperties(sys.props.toMap))\n * )\n * }\n * }}}\n * @return\n */")
Customize the coursier resolution process. This is rarely needed to changed, as the default try to provide a highly reproducible resolution process. But sometime, you need more control, e.g. you want to add some OS or JDK specific resolution properties which are sometimes used by Maven and therefore found in dependency artifact metadata. For example, the JavaFX artifacts are known to use OS specific properties. To fix resolution for JavaFX, you could override this task like the following:
Customize the coursier resolution process. This is rarely needed to changed, as the default try to provide a highly reproducible resolution process. But sometime, you need more control, e.g. you want to add some OS or JDK specific resolution properties which are sometimes used by Maven and therefore found in dependency artifact metadata. For example, the JavaFX artifacts are known to use OS specific properties. To fix resolution for JavaFX, you could override this task like the following:
@Scaladoc(value = "/**\n * Resolution parameters, allowing to customize resolution internals\n *\n * This rarely needs to be changed. This allows to disable the new way coursier handles\n * BOMs since coursier 2.1.17 (used in Mill since 0.12.3) for example, with:\n * {{{\n * def resolutionParams = super.resolutionParams()\n * .withEnableDependencyOverrides(Some(false))\n * }}}\n *\n * Note that versions forced with `Dep#forceVersion()` take over forced versions manually\n * set in `resolutionParams`. The former should be favored to force versions in dependency\n * resolution.\n *\n * The Scala version set via `ScalaModule#scalaVersion` also takes over any Scala version\n * provided via `ResolutionParams#scalaVersionOpt`.\n *\n * The default configuration set in `ResolutionParams#defaultConfiguration` is ignored when\n * Mill fetches dependencies to be passed to the compiler (equivalent to Maven \"compile scope\").\n * In that case, it forces the default configuration to be \"compile\". On the other hand, when\n * fetching dependencies for runtime (equivalent to Maven \"runtime scope\"), the value in\n * `ResolutionParams#defaultConfiguration` is used.\n */")
Resolution parameters, allowing to customize resolution internals
Resolution parameters, allowing to customize resolution internals
This rarely needs to be changed. This allows to disable the new way coursier handles BOMs since coursier 2.1.17 (used in Mill since 0.12.3) for example, with:
Note that versions forced with Dep#forceVersion() take over forced versions manually set in resolutionParams. The former should be favored to force versions in dependency resolution.
The Scala version set via ScalaModule#scalaVersion also takes over any Scala version provided via ResolutionParams#scalaVersionOpt.
The default configuration set in ResolutionParams#defaultConfiguration is ignored when Mill fetches dependencies to be passed to the compiler (equivalent to Maven "compile scope"). In that case, it forces the default configuration to be "compile". On the other hand, when fetching dependencies for runtime (equivalent to Maven "runtime scope"), the value in ResolutionParams#defaultConfiguration is used.