I've got an EAR assembled for deployment on JBoss 5.1

Using Indigo J2EE, m2e, Maven 3.0.3, and Flexmojos the first challenge was 
migrating the source code from the FlexBuilder directory structure, which I 
outlined previously in this thread, then compiling multiple MXML files in 
the same SWF project, and generating the HTML wrapper.

Here's the configuration for SWF,

flexmojos-maven-plugin:compile-swf

<!-- compile multiple MXML in the same project -->
<modules>
   ...
   <module>
      <sourceFile>main.mxml</sourceFile>
      <finalName>main</finalName>
   </module>
   ...
</modules>

flexmojos-maven-plugin:wrapper

<!-- generate html wrapper -->
<!-- html-template folder is in the root of SWF project -->
<templateURI>folder:/html-template</templateURI>
<!-- outputDirectory property defined in parent POM -->
<!-- defined as a subfolder of the target directory for cleanup -->
<outputDirectory>${swf.wrapper.target}</outputDirectory>
<htmlName>main</htmlName>
<wrapperArtifact>
   <groupId>org.my.app</groupId>
   <artifactId>swf</artifactId>
   <type>swf</type>
   <version>${swf.dependency}</version>
   <classifier>main</classifier>
</wrapperArtifact>

and the WAR configuration,

flexmojos-maven-plugin:copy-flex-resources

<!-- copy-flex-resources configuration -->
<stripModuleArtifactInfo>true</stripModuleArtifactInfo>

add dependencies,

<!-- SWF modules -->
<dependency>
   <groupId>org.my.app</groupId>
   <artifactId>swf</artifactId>
   <version>${swf.dependency}</version>
   <type>swf</type>
   <classifier>main</classifier>
</dependency>
...

copy the generated HTML wrapper,

maven-war-plugin:war configuration

<webResources>
   <resource>
      <!-- get the html-template wrapper -->
      <directory>../${swf.projectName}/${swf.wrapper.target}</directory>
   </resource>            
</webResources>

The main points are,

1) install the compiled SWF into the repository using maven:install
2) generate the HTML wrapper in a subdirectory of the target folder so that 
it gets cleaned up on maven:clean
3) flexmojos-maven-plugin:copy-flex-resources picks up the declared swf 
dependencies from the m2 repository
4) maven-war-plugin:war is configured to get the external webResources from 
the sibling SWF project defined when the HTML wrapper is generated

The purpose for posting this is to help anyone else migrating from 
FlexBuilder, and to solicit feedback on using this approach.

-- 
You received this message because you are subscribed to the Google
Groups "Flex Mojos" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/flex-mojos

http://flexmojos.sonatype.org/

Reply via email to