Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ILikePlayingGames/6c65af62e6f8c26dc2f6d5e497202cad to your computer and use it in GitHub Desktop.
Save ILikePlayingGames/6c65af62e6f8c26dc2f6d5e497202cad to your computer and use it in GitHub Desktop.
How to Use Gradle Plugins DSL on Forge MDK 11.15.1.2318

How to Use Gradle Plugins DSL on Forge MDK 11.15.1.2318

  1. Create a new file in the root folder of your project called settings.gradle and add this to it:
pluginManagement {
    repositories {
        gradlePluginPortal()
        maven {
            name 'MinecraftForge Maven'
            url 'https://maven.minecraftforge.net'
        }
    }
    resolutionStrategy {
        eachPlugin {
            if (requested.id.id == 'net.minecraftforge.gradle.forge') {
                useModule group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: requested.version
            }
        }
    }
}
  1. Remove the buildscript block below from build.gradle.
// For those who want the bleeding edge
buildscript {
    repositories {
        jcenter()
        maven {
            name = "forge"
            url = "http://files.minecraftforge.net/maven"
        }
    }
    dependencies {
        classpath 'net.minecraftforge.gradle:ForgeGradle:2.1-SNAPSHOT'
    }
}
apply plugin: 'net.minecraftforge.gradle.forge'
  1. Replace it with this:
plugins {
    id 'net.minecraftforge.gradle.forge' version 'FG_2.1-SNAPSHOT'
}

That's it, you're now using the plugins DSL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment