Jump To Topic
One of the benefits of moving to Maven is improved project hygiene. It is now trivial to build Codename One from source.
In this video, I show you how to build Codename One from source and use this “local” version in your Codename One projects.
TLDW (Too Long Didn’t Watch)
Here’s the gist of what happens in the video.
git clone https://github.com/codenameone/CodenameOne cd CodenameOne/maven mvn install
This will take a few minutes, but at the end of the tunnel you should see “SUCCESS” as shown below:
git clone https://github.com/shannah/cn1-maven-archetypes cd cn1-maven-archetypes mvn install
This will take another minute or so, but at the end of the tunnel you should see “SUCCESS”:
In the video, you can see that the version number is “7.0.21-SNAPSHOT”.
Using the Local Version in Your Application Project
Now that Codename One is installed in your local Maven repo, you can use that version in your application instead of the release version.
I demonstrate this in the video by creating a new project with the Codename One initializr.
I then change these to point to the version that I installed into my local maven repository: 7.0.21-SNAPSHOT.
Why Build From Source?
Because you can, and because it is the first step toward taking control of your own destiny. It gives you early access to features that may not be available on Maven Central, and it also enables you to make your own changes, and potentially contribute them to the Codename One core.
If you haven’t built an app yet, it’s easy to get started. Just go to Codename One initializr and press “Download”. You could be up and running in only a few minutes.
If you want to dig deeper into Codename One’s Maven support, check out the Codename One Maven Developers Guide.