/maven-migration-tool

App to migrate Legacy Codename One projects to the new Maven project format

Primary LanguageJava

Codename One Maven Migration Tool

This is a desktop GUI application that simplifies the migration of legacy Codename One projects that used the Ant build tool to the new Maven project format.

Essentially this just wraps the generate-app-project and generate-cn1lib-project goals of the Codename One maven plugin to make them easier to use.

Tip
This tool is for migrating existing projects to Maven. To start a new project from scratch, you can use the Codename One initializr online tool.

License

MIT

Downloads

See the releases page.

Usage

Open the Maven Migration Tool App. It will open window that looks like:

migration tool main

You can explicitly specify the plugin version you wish to use for generating the maven project. If you leave this field blank or enter "LATEST", it will automatically use the latest release version in Maven Central. Usually you will want to use the latest version. If you are working with a SNAPSHOT version of Codename One, then you may enter that snapshot version in the field.

Next you should select the source project (i.e. the Codename One project that you wish to convert to Maven) by pressing the Browse…​ button to the right of the "Source Project Path" field.

select source project
Tip
The source project can be either a Codename One Application project, or a Codename One Library project. The Migration tool will automatically perform the correct conversion according to the project type.

Next you should select the destination directory for the Maven project by pressing the Browse…​ button to the right of the Destination Directory text field.

select destination directory
Note
The destination directory must exist. The maven project will be created inside this directory named after the artifactId you choose for the project. E.g. If you select /home/Downloads as the destination directory, and the artifactId is "myapp", then your project will be created at /home/Downloads/myapp.

If this is a library project, you will see two additional fields to fill in, Group ID and Artifact ID. These are the values that will be used for the maven project.

Note
Application projects will use the packageName and mainName values from the codenameone_settings.properties file of the project as the groupId and artifactId fields respectively. Therefore this section of the form will not be visible if you select an Application project.

Once you have filled in the fields, press the Create Project button.

create project button

The maven output will be logged in the console at the bottom of the window.

console output

If the migration completes successfully, you should see dialog stating that the conversion was a success.

Upon disposing this dialog, it will open the project directory in the file system explorer.

converted project

This new project does not depend on the original project at all, so you can archive the old project away, and start working with the new project.

This project structure is based on the bare-bones project template. See the Getting Started tutorial for instructions on working with this new structure.