Compile Flex source(.mxml) to SWF using Maven

Compile Flex source(.mxml) to SWF

1) Create project
mvn archetype:create -DarchetypeArtifactId=maven-archetype-flex -DarchetypeVersion=1.0 -DarchetypeGroupId=dk.jacobve.maven.archetypes  -DgroupId=multiModuleProjectId -DartifactId=multiModuleProjectArtifactIdFlex -DpackageName=com.zero.demo.flex

2) pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>
    <groupId>FlexTest</groupId>
    <artifactId>FlexTest</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <description></description>
    <name>Flex Build Demo</name>
    <packaging>swf</packaging>

    <properties>
        <flex.home>C:/Program Files/Adobe/Flex Builder 3/sdks/3.2.0</flex.home>
    </properties>
        
    <build>
        <sourceDirectory>src/main/flex</sourceDirectory>
        
        <plugins>            
            <plugin>
                <groupId>net.israfil.mojo</groupId>
                <artifactId>maven-flex2-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <flexHome>${flex.home}</flexHome>
                    <useNetwork>true</useNetwork>
                    <main>CompanyScreener.mxml</main>
                </configuration>
            </plugin>
        </plugins>
        
        <defaultGoal>package</defaultGoal>
    </build>    
</project>


3) The test Flex source is CompanyScreener.mxml specified in main tag.

4) Generate SWF using "mvn package"
  

猜你喜欢

转载自louisling.iteye.com/blog/348142