Please understand that this tutorial gives you access to the latest development release of the engine. Whilst i and many others use this release to work with, it is by definition still being developed. Expect bleeding edge implementations to need work. If you don’t want that kind of hassle, please use the stable releases.
That’s it for configuring our environment. Now we just need to get the engine and build it. The files below can all be placed in the same directory and run without admin privileges. For example, I put all of these files into D:\programming - and they will download/update files in the ./jmonkeyengine/ sub-directory.
Download the Engine: download.bat
This file downloads the engine into a dir called “jmonkey” using the git client.
Update the Engine: update.bat
This file downloads any changed files from github using the git client.
Build the Engine: build.bat
This file builds the engine using the gradle wrapper and places them in your local repository. Note that this is USER-SPECIFIC. My files are stored in C:\Users\James\.m2\repository
Add the maven plugin to your build script, and put the mavenLocal() repository in your list of repositories. Then just reference the dependencies as you would normally. Note that we are now using version 3.2.+ of the engine.
You’re invoking the gradlew.bat file inside the jmonkeyengine repo – that’s the gradle wrapper. So you don’t actually need to install gradle as its already included in the GIT repo.
I wanted to try dealing with some of the issues I saw on github. I have 3.2 and cannot recreate an issue so am trying to test with the latest master. Bearing in mind I have never used github, maven or built anything before, could anyone please expand on step 4?
Using the built engine in your game
Add the maven plugin to your build script, and put the mavenLocal() repository in your list of repositories. Then just reference the dependencies as you would normally. Note that we are now using version 3.2.+ of the engine.
I have installed git-client, run download update and build, and have this large file structure ‘jmonkeyengine’ with all the relevant folders and source files. Not sure what I do next.
Please give me an hour when I start work tomorrow and I’ll upload the GUI app I made that makes all of this irrelevant. I’ve been meaning to for a few days now.
But to answer your question you just need to reference version 3.2+ now just like you would reference it in your build.gradle and it will detect and use the latest version of your local maven copy. By adding mavenlocal you add your local builds to the list of available repositories. Your local copy will be the latest.
mkdir jmonkeyengine
cd jmonkeyengine
// if you have a rsa key configured
git clone git@github.com:jMonkeyEngine/jmonkeyengine.git
// or
// if you don't, but you'll be asked credential after the next command
git clone https://github.com/jMonkeyEngine/jmonkeyengine.git
//can take a while
// build the engine and install it in your local maven repo.
./gradlew install
Then you can use bootmonkey to create a new project. or clone this:
or this
In the build.gradle file make sure you have maven local in your repositories
Important note: If you are pulling the engine to make a pull request, it’s gonna be easier to directly work in the jme3-example project. Copy one of the existing example and do your test case with it.
You won’t have to gradlew install each time you change something in the engine.
Two things worth noting:
The first two commands are unnecessary since it git clone already creates a directory for you, however here it would be named jmonkeyengine.git probably (but at least for the https clone you can also leave the .git out, not sure about the ssh command).
But the more important thing:
If you are working on a pull request and hence work on a separate branch (e.g. fix-issue-xyz), then your jME Version will change. The engine will print out a “POM VERSION” during the install command. Note it down and use it as ext.jmeVersion. (You only need this when you’ve installed more than one engine build).
I’m not sure if this is required or if gradle always picks the latest build but that way you can ensure that you are really using the real engine version.
I use netbeans with git so I need to clarify a few things with regards to command line cloning templates.
When I clone the Nehon/base-jme with netbeans it creates a subproject with the assets folders for me and a blue cube example file under Source Packages.
Will the same thing happen with shell command line clone or will they need to execute task commands?
The clone is basically a download of the files in the repo. It just copies files in place it doesn’t do any post treatment.
So yes, the project will have the same structure.