Hi Vaibhav,

your first compilation (the one you are defining in the first plugin definition)
also has an implicit execution id. You should be able to see it in the console 
when the first compilation is done.

So you should be able to use just one plugin definition with 4 executions as 
long as the id of the fourth execution matches the default.
"default-compile-swf"

Then it should work with only one plugin definition.

However I can't explain, why it didn't work with the modules. But I also have 
to admit that I never really used that feature as it's a maven habit
Of having only one artifact per module, which doesn't fit well with the modules 
concept.

Chris


´╗┐Am 08.02.18, 11:56 schrieb "Vaibhav Shah" <vaibhav.s...@barclays.com>:

    Hello Christopher,
    
    I have found a solution, rather a hack, to the problem mentioned in last
    post.
    
    Solution: you need to specify the flexmojos-maven-plugin twice in the
    pom.xml. In first instance, you specify any of the main application mxml as
    sourceFile. In the second instance, you specify all the main application
    mxmls as sourceFile in respective <execution> tags. This makes it work
    somehow, and I now get all 3 swf files generated successfully from their
    respective mxml files. Here is the complete working pom.xml for reference:
    
    <?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>com.test</groupId> 
        <artifactId>TA_UI_Test2</artifactId> 
        <version>1.0-SNAPSHOT</version> 
        <packaging>swf</packaging> 
        <name>TA_UI_Test2 Flex</name> 
    
        <dependencies> 
            <dependency> 
                <groupId>com.adobe.flex.framework</groupId> 
                <artifactId>playerglobal</artifactId> 
                <version>10-3.3.0.4852</version> 
                <type>swc</type> 
            </dependency> 
            <dependency> 
                <groupId>com.adobe.flex.framework</groupId> 
                <artifactId>rpc</artifactId> 
                <version>4.5.1.21328</version> 
                <type>swc</type> 
            </dependency> 
            <dependency> 
                <groupId>com.adobe.flex.framework</groupId> 
                <artifactId>framework</artifactId> 
                <version>3.2.0.3958</version> 
                <type>swc</type> 
            </dependency> 
            <dependency> 
                <groupId>com.adobe.flex.framework</groupId> 
                <artifactId>mx</artifactId> 
                <version>4.5.0.19786</version> 
                <type>pom</type> 
            </dependency> 
        </dependencies> 
    
        <build>
            <sourceDirectory>src</sourceDirectory>
    
            <plugins>
                
                <plugin>
                    <groupId>org.sonatype.flexmojos</groupId>
                    <artifactId>flexmojos-maven-plugin</artifactId>
                    <version>3.8</version>
                    <extensions>true</extensions>
                    <configuration>
                        <sourceFile>File1.mxml</sourceFile>
                        <debug>true</debug>
                        <storepass></storepass>
                        <output>${basedir}/target/File1.swf</output>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>com.adobe.flex</groupId>
                            <artifactId>compiler</artifactId>
                            <version>3.2.0.3958</version>
                            <type>pom</type>
                        </dependency>
                    </dependencies>
                </plugin>
                        
                
    
                <plugin>
                    <groupId>org.sonatype.flexmojos</groupId>
                    <artifactId>flexmojos-maven-plugin</artifactId>
                    <version>3.8</version>
                    <extensions>true</extensions>
                    <configuration>
                        <storepass></storepass>
                    </configuration>
                    <executions>
                        <execution>
                            <id>Build1</id>
                            <configuration>
                                <sourceFile>File1.mxml</sourceFile>
                                <debug>true</debug>
                                <output>${basedir}/target/File1.swf</output>
                            </configuration>
                            <goals>
                                <goal>compile-swf</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>Build2</id>
                            <configuration>
                                <sourceFile>File2.mxml</sourceFile>
                                <debug>true</debug>
                                <output>${basedir}/target/File2.swf</output>
                            </configuration>
                            <goals>
                                <goal>compile-swf</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>Build3</id>
                            <configuration>
                                <sourceFile>File3.mxml</sourceFile>
                                <debug>true</debug>
                                <output>${basedir}/target/File3.swf</output>
                            </configuration>
                            <goals>
                                <goal>compile-swf</goal>
                            </goals>
                        </execution>
                    </executions>
                    <dependencies>
                        <dependency>
                            <groupId>com.adobe.flex</groupId>
                            <artifactId>compiler</artifactId>
                            <version>3.2.0.3958</version>
                            <type>pom</type>
                        </dependency>
                    </dependencies>
                </plugin>
            </plugins>
    
        </build>
    
    </project> 
    
    I still don't understand how come above hack works, and it doesn't work
    without the dummy plugin definition. However, it serves my purpose as of
    now. :)
    
    Thanks again for prompt response. Appreciate your time and inputs. Hope
    above helps someone.
    
    Cheers.. :)
    
    
    
    --
    Sent from: http://apache-flex-development.2333347.n4.nabble.com/
    

Reply via email to