Skip to content

Create Royale project with Maven

Carlos Rovira edited this page Sep 6, 2020 · 3 revisions

With Maven you can create a Royale Project using Maven Archetypes. The following steps-by-step guide are for Mac users, but similar steps can be followed by Windows users.

Create Royale project

  1. Open Terminal Window and go to the folder where you want to create your new Royale Project (i.e: cd ~/Desktop, to create the project directly in Desktop).
  2. The following instruction is an example to create a project:
mvn archetype:generate -DarchetypeGroupId=org.apache.royale.framework -DarchetypeArtifactId=royale-simple-application-archetype -DarchetypeVersion=0.9.8-SNAPSHOT
  1. Maven will start to create the new project from scratch and will ask you some questions (the following are the questions and an example of possible responses):
Define value for property 'groupId': : org.apache.royale.examples
Define value for property 'artifactId': : ASimpleRoyaleTestApp
Define value for property 'version':  1.0-SNAPSHOT: : 
Define value for property 'package':  org.apache.royale.examples: : 
Confirm properties configuration:
groupId: org.apache.royale.examples
artifactId: ASimpleFlexJSTestApp
version: 1.0-SNAPSHOT
package: org.apache.royale.examples
Y: : Y

Created application

In this example, you should get a project folder called ASimpleRoyaleTestApp in the folder you have located in 1. Inside the project you will have a basic Application, located in /src/main/flex folder with the following code created.

<js:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                xmlns:js="library://ns.apache.org/royale/basic" >
  <js:valuesImpl>
     <js:SimpleCSSValuesImpl />
  </js:valuesImpl>
  <js:initialView>
     <js:View>
       <js:Label text="Hello World!" />
    </js:View>
  </js:initialView>
</js:Application>

Build Royale project

In order to build created project, go to the root folder where Maven pom.xml file is located and type:

mvn clean install

Note: you can add "-P option-with-swf" to build SWF and "-DskipTests" to avoid tests

Clone this wiki locally