How to modify Gradle dependencies (Java)

am currently trying to compile a version of Extra Utilities 2, version 1.9.9 for Minecraft 1.10.2, that I personally modified using Gradle. The problem is when I try to compile it, I run into some issue with a dependency that is trying to access old URLs. I have new URLs, but I don’t know how to access the dependencies through their class path in order to implement them. I have attached the compiling error below, and a screenshot from my build.gradle file. Thank you for your help.

P.S, I am completely new to this, so please explain in the most basic terms, thanks a lot for your help.

Seems to be a problem when loading dependencies. Can you see the full dependency in the list of you external libraries?
Do you have to go through a proxy?

from the maven repository https://mvnrepository.com/artifact/net.minecraftforge.gradle/ForgeGradle

there no version 2-2-snapshot available there as the oldest version there is version 3

so if you share your build script maybe we could help

also not sure if we used version 3 or above would make any other issue or not but give a try

hope that help and have a nice day :slight_smile:

Thanks for helping! I have attached the build script below (Sorry that I can’t just attach the file this website won’t let me). If I understand correctly, the problem I am having is that many of the registries that this project uses have since been shut down or don’t have my files. So all I need to do is look for a new registry with my files and update the gradle.build file, right? Once I do find the right registry, do I update just the classpath or the URL and name parameters as well? Also, is it possible for me to just download the file and skip a registry entirely? I think I found forgeGradle [here]. If so how would I switch from a registry to local file? Finally trying to update the version of forgeGradle using the link you provided leads to a bunch of different rogue dependencies. Does this mean forgeGradle itself is asking for bad dependencies or is the build script just moving on to the next bad dependency?

Thank you so much for all of your help in this I appreciate it.

buildscript {
    repositories {
        jcenter()
        maven { url = "http://files.minecraftforge.net/maven" }
        maven {
            name = "sonatype"
            url = "https://oss.sonatype.org/content/repositories/snapshots/"
        }
    }
    dependencies {
        classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT'
    }
}
plugins {
    id 'com.matthewprenger.cursegradle' version '1.0.9'

}

apply plugin: 'net.minecraftforge.gradle.forge'

ext.priv = parseConfig(file('../1.10.2/private.properties'))
ext.version_config = parseConfig(file('../1.10.2/version.properties'))

version = ext.version_config.version_no

group= "com.rwtema.extrautils2" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "extrautils2-1.10.2"



def parseConfig(File config) {
    config.withReader {
        def prop = new Properties()
        prop.load(it)
        return (new ConfigSlurper().parse(prop))
    }
}


minecraft {
    version = "1.10.2-12.18.3.2511"
    runDir = "run"
    mappings = "snapshot_20170624"
    makeObfSourceJar = false
}

repositories {
  maven {
    url "http://dvs1.progwml6.com/files/maven"
  }
}

minecraft {
  useDepAts = true
}

dependencies {
    deobfCompile "mezz.jei:jei_1.10.2:3.13.3.380"

    deobfCompile "slimeknights.mantle:Mantle:1.10.2-1.1.3.199"
    deobfCompile "slimeknights:TConstruct:1.10.2-2.6.1.464"
}


processResources
{
    // this will ensure that this task is redone when the versions change.
    inputs.property "version", project.version
    inputs.property "mcversion", project.minecraft.version

    // replace stuff in mcmod.info, nothing else
    from(sourceSets.main.resources.srcDirs) {
        include 'mcmod.info'
                
        // replace version and mcversion
        expand 'version':project.version, 'mcversion':project.minecraft.version
    }
        
    // copy everything else, thats not the mcmod.info
    from(sourceSets.main.resources.srcDirs) {
        exclude 'mcmod.info'
    }
}

jar {
    manifest {
        attributes "FMLAT": "extrautils2_at.cfg"
//        attributes "FMLCorePlugin": "com.rwtema.extrautils2.asm.CoreXU2"
//	    attributes "FMLCorePluginContainsFMLMod": "true"
    }
}


// Create deobf dev jars
task deobfJar(type: Jar) {
    from sourceSets.main.output
    classifier = 'deobf'
    manifest {
        attributes "FMLAT": "extrautils2_at.cfg"
//        attributes "FMLCorePlugin": "com.rwtema.extrautils2.asm.CoreXU2"
//        attributes "FMLCorePluginContainsFMLMod": "true"
    }
}

task sourcesJar(type: Jar) {
    from sourceSets.main.allJava
    classifier = 'sources'
    manifest {
        attributes "FMLAT": "extrautils2_at.cfg"
    }
}

artifacts {
    archives deobfJar
    archives sourcesJar
}

sourceCompatibility = '1.8'
targetCompatibility = '1.8'

idea {

}


sourceSets {
    main {
        java {
            srcDir 'src/main/java'
            srcDir 'src/compat/java'
            srcDir 'src/compat111/java'
        }
        resources {
            srcDir 'src/main/resources'
            srcDir 'src/compat/resources'
        }
    }
    api{
        java {
            srcDir 'src/api/java'
        }
    }
}


curseforge {
    apiKey = priv.cfkey
    project {
        id = "225561"
        changelog = file('../1.10.2/src/changelog.txt')
        releaseType = "release"
        addGameVersion "1.10.2"
        mainArtifact (jar) {
            displayName = "Extra Utilities 2 - 1.10.2 - ${version_config.version_no}"
        }
    }
}

Hi Alwin, thanks for helping. I don’t think I have a complete list of external libraries, I only have the source code from a GitHub download [here] (Or I might just have not found it, both are equal possibilities). I am certain that there is no proxy, unless windows firewall on the default settings count. Thanks again for your help.

Solved it! Just had to delete my .gradle folder under the user profile and then compile the project using gradle build instead of gradlew build. Thank you all for your help.

1 Like