简体   繁体   中英

How to pass additional compiler arguments in flexmojos-maven-plugin 3.8?

What we know:

When I build the flex project with the Flex Builder (ie without maven build), I can use the 'Project Properties > Flex Compiler > Additional Compiler Arguments' to pass some additional arguments, such as referring to services-config.xml file:

在此处输入图片说明

In above screenshot, I am passing these additional arguments, which make my SWF files capable to communicate with respective services: -services "C:\\MyProject\\WebRoot\\WEB-INF\\flex\\services-config.xml" -locale en_US

What we are doing:

We are tasked to convert this flex project to a maven project. I have done that using flexmojos-maven-plugin 3.8. (I can't use any latest versions, long story.) It compiles successfully and generates the SWF files too. However, I don't know how to pass above additional arguments in the configuration of my flexmojos-maven-plugin.

Here is my working configuration in pom.xml:

         <plugin> 
            <groupId>org.sonatype.flexmojos</groupId> 
            <artifactId>flexmojos-maven-plugin</artifactId> 
            <version>3.8</version> 
            <extensions>true</extensions> 
            <configuration> 
                <sourceFile>Abc.mxml</sourceFile> 
                <debug>true</debug> 
                <storepass></storepass> 
                <output>${basedir}/target/Abc.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> 

Question:

Could anyone please suggest how I can pass my above mentioned additional compiler arguments in the plugin configuration above in pom.xml? Without that, the SWF file gets generated, but it cannot communicate with the service.

The flexmojos-maven-plugin provides option to define the services via the configuration node as follows:

            <plugin>
                <groupId>org.sonatype.flexmojos</groupId>
                <artifactId>flexmojos-maven-plugin</artifactId>
                <version>3.8</version>
                <extensions>true</extensions>
                <configuration>
                    <sourceFile>Abc.mxml</sourceFile>
                    <debug>true</debug>
                    <storepass></storepass>
                    <output>${basedir}/target/Abc.swf</output>
                    <services>../MyProject/WebRoot/WEB-INF/flex/services-config.xml</services>
                    <contextRoot>/</contextRoot>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>com.adobe.flex</groupId>
                        <artifactId>compiler</artifactId>
                        <version>3.2.0.3958</version>
                        <type>pom</type>
                    </dependency>
                </dependencies>
            </plugin>

If you specify services, then you have to specify contextRoot as well.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM