Maven archetype for Flex-Mojos

12 06 2008

As I was going through and creating the sample project for the book I’m working on (http://manning.com/allmon), I realized that there wasn’t a Maven archetype for creating Flex projects using Flex-Mojos.  The closest I found was an archetype that someone has created for using the israfil maven plugin, but I wasn’t satisfied with using that plugin and changing the pom to use the Flex-Mojos plugin…so I created a Maven archetype for generating projects to be used by Flex-Mojos.

To use this new archetype all you need to do is type the following at the command prompt:


mvn archetype:create -DgroupId=<your groupId> \
  -DartifactId=<your artifactId> \
  -DarchetypeGroupId=com.codeadept \
  -DarchetypeArtifactId=flex-mojos-archetype \
  -DarchetypeVersion=1.0-SNAPSHOT \
  -DremoteRepositories=http://flexonjava.googlecode.com/svn/repository

Once the plugin is finished executing, you should see a standard maven project. In the src/main/flex folder, you’ll find not only a “Hello World!” Flex application named Main.mxml, but also an ActionScript class in the package you specified for your groupId called App.as.  You’ll also find the FlexUnit test for this class in the src/test/flex folder under the same package called TestApp.as.  Now you should be able to run mvn install and you should see a message stating that it ran 1 test and had 0 failures.

You’re now all set to develop your Flex application in a Test First fashion…


Actions

Information

6 responses to “Maven archetype for Flex-Mojos”

12 06 2008
VELO (16:29:18) :

Hi,

Great work.

You is required to specify the version.
-DarchetypeVersion=1.0-SNAPSHOT

VELO

12 06 2008
Flex-Mojos » Maven archetype for Flex-Mojos (16:36:16) :

[...] Read more here. [...]

12 06 2008
Jeremy Anderson (16:39:11) :

@Velo

Thanks, I edited the post to add the archetype version.

13 06 2008
François (16:09:47) :

It’s great to see such an activity around flex, java and maven.
I’m looking forward to reading your book.

I created a flex java multi module archetype as well:
A blazeDS Xdoclet Spring Hibernate Maven Archetype
see : http://www.jroller.com/francoisledroff/entry/a_blazeds_xdoclet_spring_hibernate

Cheers !

18 06 2008
Rajan Mahadevan (02:16:14) :

Thanks for the artifact. When I create the artifact all the swc dependencies have the version numbers broken. Instead of 3.0.0.477, the following is generated 3.0.0.3.0.0.477. I manually fixed this to make it work in my pom. Look forward to your book.

Cheers!

18 06 2008
Jeremy Anderson (02:21:38) :

Thanks Rajan, I just fixed the archetype and uploaded it to my repository.

Leave a comment

You can use these tags : <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>