The Codename One SDK is published as a Maven multi-module project. Building the
aggregator in the /maven directory compiles every module, installs the
artifacts into your local Maven repository, and lets you depend on the exact
snapshot you cloned from GitHub.
Codename One uses multiple JDKs and Maven profiles during the build. Make sure
your development machine includes the following tooling (see
BUILDING.md for platform-specific installation tips):
-
JDK 8 (required for the core build and Maven invocations)
-
JDK 17 (required when compiling the Android port)
-
Apache Maven 3.6 or newer
-
macOS with Xcode (only if you plan to build or test the iOS port)
Clone the repository and run the Maven aggregator from inside the maven
subdirectory. This installs the complete SDK (core runtime, simulator, and
ports) into your local Maven cache:
$ git clone https://github.com/codenameone/CodenameOne
$ cd CodenameOne/maven
$ mvn installThe default build runs every module and its unit tests. Append -DskipTests
if you want to skip the test phases to speed up local builds.
The version printed by Maven will usually end with -SNAPSHOT when you build
from the master branch. Release builds from Maven Central omit the suffix.
Codename One ships its project archetypes in a companion repository. Install
them once so that mvn archetype:generate (and the Codename One Initializr)
can reference your locally built SDK artifacts:
$ git clone https://github.com/shannah/cn1-maven-archetypes
$ cd cn1-maven-archetypes
$ mvn installThe Maven aggregator exposes modules for the different automated test suites.
Run any of these from the CodenameOne/maven directory:
-
Core unit tests:
$ mvn -pl core-unittests test -
Integration tests (simulator and build client):
$ mvn -pl tests -am verify
Refer to the READMEs in maven/core-unittests and maven/tests for additional
configuration flags, platform requirements, and environment variables.
After running the mvn install commands above, the Codename One artifacts are
available in your local Maven repository. To consume that build in an
application generated from the Codename One Initializr (or any other Maven
project), adjust the pom.xml properties to reference your snapshot version:
<properties>
<!-- Replace with the snapshot printed during mvn install -->
<cn1.version>{cn1-snapshot-version}</cn1.version>
<cn1.plugin.version>{cn1-snapshot-version}</cn1.plugin.version>
</properties>Open the project in your IDE and build or run it. Maven will resolve the local snapshot instead of downloading the latest release from Maven Central.
Building the SDK yourself gives you:
-
Immediate access to fixes and features before they reach Maven Central.
-
The ability to inspect, debug, and modify the framework when you need custom behavior.
-
A path to contribute improvements back to the Codename One core.
Once you are comfortable with the baseline build, continue with the scripts in
scripts/ or the BUILDING.md guide to compile specific ports (Android or
iOS) or to automate CI workflows.