Search code examples
javamavenjmonkeyengine

jMonkeyEngine 3 with Maven


I've got a problem. I am trying to use jme3 with eclipse and Maven. I am using the m2e plugin (with eclipse Oxygen).

Now, I want to add the jme3 dependencies to my pom.xml. I copied the dependency tags from the maven central, from the bintray repository and even from some custom repos (I also added the repositories to the pom). It won't work.

I worked through the first 2 Google search result pages (actually every link on the first two pages) and consulted the maven pom documentation.

I just cannot get this thing to work.

<dependency>
    <groupId>org.jmonkeyengine</groupId>
    <artifactId>jme3-desktop</artifactId>
    <version>3.1.0-stable</version>
</dependency>

This is what my pom looks like now (I resetted it, cuz nothing will work). How do I add this (https://mvnrepository.com/repos/jmonkeyengine) repository to the pom (I must not change anything outside my project directory), so that maven can find the dependency?

I'm sure for some of you this is just a job of a few minutes, but I'm working on this for like 2h now, without any results.

A huge thanks in advance

EDIT: Checked out this solution: JMonkeyEngine in Intellij IDEA

Won't work for (e.g.)

<dependency>
    <groupId>org.jmonkeyengine</groupId>
    <artifactId>jme3-lwjgl-natives</artifactId>
    <version>3.1.0-stable</version>
</dependency>

And many others...


Solution

  • According this page of JMonkey docs, there is the most common Maven pom setting for working with JMonkey Engine:

    <properties>
        <!-- JMonkey stats -->
        <jme3_g>org.jmonkeyengine</jme3_g>
        <!-- Check the last version -->
        <jme3_v>3.2.0-stable</jme3_v>
    </properties>
    
    <repositories>
        <!-- Repository for JMonkey Engine dependences -->
        <repository>
            <id>jcenter</id>
            <url>https://jcenter.bintray.com/</url>
        </repository>
    </repositories>
    
    <dependencies>
        <!-- JMonkey Engine dependences  -->
        <dependency>
            <groupId>${jme3_g}</groupId>
            <artifactId>jme3-core</artifactId>
            <version>${jme3_v}</version>
        </dependency>
        <dependency>
            <groupId>${jme3_g}</groupId>
            <artifactId>jme3-desktop</artifactId>
            <version>${jme3_v}</version>
        </dependency>
        <dependency>
            <groupId>${jme3_g}</groupId>
            <artifactId>jme3-lwjgl</artifactId>
            <version>${jme3_v}</version>
        </dependency>
    </dependencies>
    

    P.S.

    • For working with terrain in JMonkeyEngine(for example, if you want to access to com.jme3.terrain package inside your project) you must add the next dependency

      <dependency>
          <groupId>${jme3_g}</groupId>
          <artifactId>jme3-terrain</artifactId>
          <version>${jme3_v}</version>
      </dependency>
      
    • For working with jme3-test-data sources and accessing appropriate paths from your project(like "Textures/Terrain/splat/grass.jpg"), you can add the next dependency:

      <!-- Test data -->
      <dependency>
          <groupId>net.sf.sociaal</groupId>
          <artifactId>jME3-testdata</artifactId>
          <version>3.0.0.20130526</version>
      </dependency>
      

    You can find all JMonkey Dependencies from the previous link