PublishModule

mill.scalalib.PublishModule
object PublishModule extends Alias

Attributes

Source
aliases.scala
Graph
Supertypes
class Alias
class Object
trait Matchable
class Any
Self type

Members list

Value members

Inherited fields

Attributes

Inherited from:
Alias
Source
ExternalModule.scala

Exports

Defined exports

Exported from PublishModule

Attributes

Source
aliases.scala
final type PublishData = PublishData
Exported from PublishModule$

Attributes

Source
aliases.scala
def allRepositories: Task[Seq[Repository]]
Exported from CoursierModule

The repositories used to resolve dependencies

The repositories used to resolve dependencies

Unlike repositoriesTask, this includes the Mill internal repositories, which allow to resolve Mill internal modules (usually brought in via JavaModule#coursierDependencyTask).

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.

Attributes

Source
CoursierModule.scala
Exported from CoursierModule

Bind a dependency (Dep) to the actual module context (e.g. the scala version and the platform suffix)

Bind a dependency (Dep) to the actual module context (e.g. the scala version and the platform suffix)

Attributes

Returns

The BoundDep

Source
CoursierModule.scala
def checkGradleModules: Simple[Boolean]
Exported from CoursierModule

Whether to enable Gradle Module support when fetching dependencies

Whether to enable Gradle Module support when fetching dependencies

Attributes

Source
CoursierModule.scala
def coursierCacheCustomizer: Task[Option[FileCache[Task] => FileCache[Task]]]
Exported from CoursierModule

Customize the coursier file cache.

Customize the coursier file cache.

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:

 override def coursierCacheCustomizer = Task.Anon {
    Some( (fc: coursier.cache.FileCache[Task]) =>
      fc.withClassLoaders(Seq(classOf[coursier.cache.protocol.S3Handler].getClassLoader))
    )
 }

Attributes

Source
CoursierModule.scala
val defaultGpgArgs: Seq[String]
Exported from PublishModule

Attributes

Source
PublishModule.scala
Exported from CoursierModule

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.

Attributes

Returns

CoursierModule.Resolver instance

Source
CoursierModule.scala
def mapDependencies: Task[Dependency => Dependency]
Exported from CoursierModule

Map dependencies before resolving them - use only if you know what you are doing. Override this to customize the set of dependencies.

Map dependencies before resolving them - use only if you know what you are doing. Override this to customize the set of dependencies.

Using this makes it harder to make sense of dependency resolutions and to reproduce those resolutions via the coursier command-line or from other build tools.

Attributes

Source
CoursierModule.scala
Exported from PublishModule

Attributes

Source
PublishModule.scala
Exported from CoursierModule

A CoursierModule.Resolver to resolve dependencies.

A CoursierModule.Resolver to resolve dependencies.

Unlike defaultResolver, this resolver can resolve Mill modules too (obtained via JavaModule.coursierDependencyTask).

Attributes

Returns

CoursierModule.Resolver instance

Source
CoursierModule.scala
Exported from RootModule0

Attributes

Source
RootModule0.scala
def moduleDir: Path
Exported from Module

Attributes

Source
Module.scala
Exported from Module

Attributes

Source
Module.scala
Exported from Module

Attributes

Source
aliases.scala
private[mill] val moduleLinearized: Seq[Class[_]]
Exported from Module

Attributes

Source
Module.scala
override def moduleSegments: Segments
Exported from ExternalModule

Attributes

Source
ExternalModule.scala
def repositories: Simple[Seq[String]]
Exported from CoursierModule

The repositories used to resolve dependencies with classpath(). This takes Coursier repository strings as input which are defined here:

The repositories used to resolve dependencies with classpath(). This takes Coursier repository strings as input which are defined here:

For example:

Attributes

Source
CoursierModule.scala
def repositoriesTask: Task[Seq[Repository]]
Exported from CoursierModule

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.

Attributes

Source
CoursierModule.scala
def resolutionCustomizer: Task[Option[Resolution => Resolution]]
Exported from CoursierModule

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:

   override def resolutionCustomizer = Task.Anon {
     Some( (r: coursier.core.Resolution) =>
       r.withOsInfo(coursier.core.Activation.Os.fromProperties(sys.props.toMap))
     )
   }

Attributes

Source
CoursierModule.scala
def resolutionParams: Task[ResolutionParams]
Exported from CoursierModule

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:

 def resolutionParams = super.resolutionParams()
   .withEnableDependencyOverrides(Some(false))

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.

Attributes

Source
CoursierModule.scala
Exported from PublishModule

Uri for publishing SNAPSHOT artifacts to Sonatype Central.

Uri for publishing SNAPSHOT artifacts to Sonatype Central.

Attributes

Source
PublishModule.scala
Exported from PublishModule

Uri for publishing to the old / legacy Sonatype OSSRH.

Uri for publishing to the old / legacy Sonatype OSSRH.

It's mostly dead but we still keep it around because https://central.sonatype.org/publish/publish-portal-ossrh-staging-api still exists.

Attributes

See also
Source
PublishModule.scala