Interface MinecraftExtension

All Superinterfaces:
MinecraftMappingsContainer
All Known Subinterfaces:
MinecraftExtensionForProject

public interface MinecraftExtension extends MinecraftMappingsContainer

The main extension for ForgeGradle, where the Minecraft dependency resolution takes place.

Restrictions

  • When declaring Minecraft dependencies, only module dependencies are supported.
    • The resulting Minecraft dependency is created by the Minecraft Mavenizer. It is not merely a dependency transformation, which means that it cannot use file and project dependencies to generate the Minecraft artifacts.
    • Attempting to provide a non-module dependency to MinecraftExtensionForProject.dependency(Object), will cause the build to fail.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The name for this extension in Gradle.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.gradle.api.Action<org.gradle.api.artifacts.repositories.MavenArtifactRepository>
    Deprecated.
    Use mavenizer(RepositoryHandler) instead, as it has special handling to avoid pitfalls when including the mavenizer output in your repositories.
    default org.gradle.api.artifacts.repositories.MavenArtifactRepository
    mavenizer(org.gradle.api.artifacts.dsl.RepositoryHandler repositories)
    Adds the generated Minecraft maven to the given repository handler.

    Methods inherited from interface MinecraftMappingsContainer

    getMappings, mappings, mappings
  • Field Details

  • Method Details

    • getMavenizer

      @Deprecated(since="7.0") org.gradle.api.Action<org.gradle.api.artifacts.repositories.MavenArtifactRepository> getMavenizer()
      Deprecated.
      Use mavenizer(RepositoryHandler) instead, as it has special handling to avoid pitfalls when including the mavenizer output in your repositories.
      A closure for the Minecraft Mavenizer's output to be passed into RepositoryHandler.maven(Closure).

      Declaring this in your buildscript is required for the Minecraft dependencies to resolve properly.

      repositories {
          maven minecraft.maven
      }
      
      Returns:
      The closure
      See Also:
    • mavenizer

      default org.gradle.api.artifacts.repositories.MavenArtifactRepository mavenizer(org.gradle.api.artifacts.dsl.RepositoryHandler repositories)
      Adds the generated Minecraft maven to the given repository handler.
      minecraft.maven(repositories)
      
      Parameters:
      repositories - The repository handler to add the maven to
      Returns:
      The Minecraft maven
      See Also:
      API Note:
      This version includes special logic to avoid pitfalls when adding the Mavenizer output as a repository when using ForgeGradle in a subproject, for example, if all projects need to use the Forge maven.