Integrated Flex and Java Web application build
rherrick — Tue, 02/09/2010 - 09:40
Update: Apologies to Marvin Froeder, as I'd initially misspelled his first name. Velo's easier!
Update 2: A little bleg for some help on learning Maven.
I've been doing a lot of Maven work lately, especially working on building Flex clients and Spring-based Java Web applications. It's pretty painstaking work, as I don't really know Maven very well and the means for compiling Flex apps (using FlexMojos) is not exactly thoroughly documented and tight as a drum quality-wise (don't get me wrong, I think Marvin Froeder, the lead developer, is doing an awesome job, but he's pretty much the development team!).
I finally managed to get one of our Flex clients to compile under Maven, which took a bit of doing. The main obstacle there was getting the various dependencies hooked up. Specifically we used the Adobe data visualization and iLog Elixir control. These needed to be installed into the local Maven repository (I think the long-term solution is a local enterprise repositorywith those installed, but baby steps!). I also needed to install some JAR files from the Flex SDK and do some stuff to switch to the Adobe font manager.
The next step is to integrate a SWF build with the Web application build. There's an example available on the FlexMojos wiki, but I had to make a number of changes to make this work:
- The property references are made with %{property}. I've not seen that before. I changed these to ${property}.
- I defined the flexmojos.version property in the parent pom.xml.
- I added a bunch of stuff to change the compiler version and support the fontkit.
- The version of swf-project created in the swf pom (2) didn't match the version referred to by the war pom (1). I changed references to this to:
<groupId>sandbox</groupId> <artifactId>swf-project</artifactId> <version>2</version>
Once I made these changes, I was able to build with a simple mvn clean install. I dropped the generated war file into Tomcat and it worked like a charm! You can find the code as it worked for me on my site. Hopefully this helps someone else out! If anyone finds any issues with it or needs to make any further changes, a comment here or on the FlexMojos Html Wrapper Mojos page would be much appreciated.
- rherrick's blog
- Login or register to post comments
- Delicious
- Digg
- Yahoo
- Technorati