[SOLVED] (GRADLE) Having trouble with zml's configuration API

Hello Sponge Community,

I can’t seem to get my IDE (IntelliJ) to download zml’s configuration API that is described in the Sponge documentation. I’m unsure as to why the configuration API wasn’t included in Sponge itself, but that is beside the point.

Here is my build.gradle file:

apply plugin: ‘java’

sourceCompatibility = 1.5
version = ‘1.0’

repositories {
mavenCentral()
maven {
name ‘Sponge maven repo’
url ‘http://repo.spongepowered.org/maven
}
}

dependencies {
testCompile group: ‘junit’, name: ‘junit’, version: ‘4.11’
compile ‘ninja.leaping.configurate:configurate-hocon:0.1’
compile “org.spongepowered:spongeapi:1.1-SNAPSHOT”
}

Any ideas?

You need to add the sonatype nexus repository. See this commit as an example.

Also, you don’t need to explicitly specify your dependency on the configurate library, but you can if you wish.

1 Like

The library should be included with the SpongeAPI. Btw, Sponge uses the newest SNAPSHOT version of configurate.

First, remove the dependency from your build.gradle and force Gradle to redownload all dependencies.

If it still does not work, modify your build.gradle like this:

repositories {
    mavenCentral()
    maven {
        name 'sonatypeSnapshot'
        url 'https://oss.sonatype.org/content/repositories/snapshots/'
    }
    maven { 
        name 'Sponge maven repo'
        url 'http://repo.spongepowered.org/maven' 
    }
}
// Project dependencies
dependencies {
    testCompile group: 'junit', name: 'junit', version: '4.11'
    compile "org.spongepowered:spongeapi:1.1-SNAPSHOT"
    compile 'ninja.leaping.configurate:configurate-hocon:1.0-SNAPSHOT'
}
1 Like

Thank you so much @gratimax and @boformer! It worked flawlessly!

Did it work without the dependency?

I kept the dependency, but I would assume that it would work without it.