Thursday, June 9, 2011

Difference in compiled binary between Flex Mojo Build & Eclipse Build

Problem:
I've been working on a Flex Project for sometime and came across this issue after maveniz'ing our project with Flex-Mojos. The issue was, for some reasons, the UI misbehaved with maven build - the Panels were not laid out as intended and the UI seems to have broken in the maven build. However, the same code works perfectly fine when built through Eclipse.

Analysis and Solution:
We first verified whether the SWC dependencies used in both the build methods are just same or not. Once this step was through, as a next step, we wanted to make sure whether the compiler arguments/options are the same. But surprisingly they were not the same.

The sonatype flexmojo-site gave conclusive documentation about adding the various possible maven flex mojo compiler configurations.

Our eclipse flex compiler configuration looks like below:


We later found that adding the following under <configuration> section made our eclipse configs and maven configs looking same and that has resolved the issue.


<keepAllTypeSelectors>true</keepAllTypeSelectors>
<accessible>true</accessible>
<strict>true</strict>

No comments:

Post a Comment