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

1.- Open Terminal Window and go to the folder where you want to create your new FlexJS Project (i.e: cd ~/Desktop, to create the project directly in Desktop).

2.- The following instrucction is an example to create a project:

mvn -s /Users/<YourUser>/<Path-To-You-Flex-Asjs-Repo>/settings-template.xml archetype:generate -DarchetypeGroupId=org.apache.flex.flexjs.framework -DarchetypeArtifactId=flexjs-simple-application-archetype -DarchetypeVersion=0.8.0-SNAPSHOT

3.- As you hit enter, 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.flex.flexjs.examples
Define value for property 'artifactId': : ASimpleFlexJSTestApp
Define value for property 'version':  1.0-SNAPSHOT: : 
Define value for property 'package':  org.apache.flex.flexjs.examples: : 
Confirm properties configuration:
groupId: org.apache.flex.flexjs.examples
artifactId: ASimpleFlexJSTestApp
version: 1.0-SNAPSHOT
package: org.apache.flex.flexjs.examples
 Y: : Y

In this example, you should get a project folder called "ASimpleFlexJSTestApp" in the folder you are located.
Inside the project you will have a basic Application filed located in /src/main/flex folder with the following code already setup foro you:

<?xml version="1.0" encoding="utf-8"?>

<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements.  See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License.  You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<js:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:js="library://ns.apache.org/flexjs/basic" >
    <js:valuesImpl>
        <js:SimpleCSSValuesImpl />
    </js:valuesImpl>
    <js:initialView>
        <js:View>
         <js:Label text="Hello World!" />
        </js:View>
    </js:initialView>
</js:Application>

Inside that you can build it with "mvn clean install", and start modifying as you wish.
There's two more types of FlexJS Maven Archetypes: One to create a Pure-JS Application and the other to create a Pure-SWF Application.

 

 

 

 

 

 

 

  • No labels