Search code examples
javagradlejmonkeyengine

How do you include the JMonkey test data jar on a Gradle project?


I've followed the instructions to creating a Gradle project using JMonkey but I have been unable to get any of the assets to load as stated in the tutorial: http://wiki.jmonkeyengine.org/doku.php/jme3:beginner:hello_asset

My build.gradle looks like this:

apply plugin: 'java'
apply plugin: 'eclipse'

sourceCompatibility = 1.8
version = '1.0'
jar {
    manifest {
        attributes 'Implementation-Title': 'Gradle Quickstart', 'Implementation-Version': version
    }
}

repositories {
    mavenCentral()
    maven {
        url 'http://updates.jmonkeyengine.org/maven'
    }
}

dependencies {
    compile 'com.jme3:jme3-core:3.0.+'
    compile 'com.jme3:jme3-effects:3.0.+'
    compile 'com.jme3:jme3-networking:3.0.+'
    compile 'com.jme3:jme3-plugins:3.0.+'
    compile 'com.jme3:jme3-jogg:3.0.+'
    compile 'com.jme3:jme3-terrain:3.0.+'
    compile 'com.jme3:jme3-blender:3.0.+'
    compile 'com.jme3:jme3-jbullet:3.0.+'
    compile 'com.jme3:jme3-niftygui:3.0.+'
    compile 'com.jme3:jme3-desktop:3.0.+'
    compile 'com.jme3:jme3-lwjgl:3.0.+'
}

The sample was created from the wiki: http://wiki.jmonkeyengine.org/doku.php/jme3:maven

However the wiki makes no references to assets or how to build them.


Solution

  • After looking through the internet I found that the jar that I'm looking for is the jME3-testdata.jar. According to this conversation: http://hub.jmonkeyengine.org/t/official-maven-repo-for-jme3-0-stable-available-please-test/30571

    It was a deliberate decision not to include the test data jar. Because of this, I went ahead and manually downloaded the missing jar and added it to my classpath.