开发者

Coping swf resources with flex-mojos to the custom folder

开发者 https://www.devze.com 2023-01-16 21:31 出处:网络
How I can configure copy-flex-resources goal and swf dependencies to copy swf files to the custom folder in my web-app? By default it copies to the web-app root.

How I can configure copy-flex-resources goal and swf dependencies to copy swf files to the custom folder in my web-app? By default it copies to the web-app root.

More about copy-flex-resources goal here: https://docs.sonat开发者_C百科ype.org/display/FLEXMOJOS/Copy+Flex+Resources


Your can add a "configuration" to that plugin:

<configuration> 
    <webappDirectory>${basedir}/src/main/webapp</webappDirectory> 
    <!-- If RSLs are coming from the WAR uncomment this line 
    <copyRSL>false</copyRSL>--> 
</configuration> 


I use maven-antrun-plugin to copy several swfs from several sub projects (there's probably a better way, but it does the job)

<plugin>
    <artifactId>maven-antrun-plugin</artifactId>
    <executions>
        <execution>             
            <phase>process-resources</phase>
            <goals>
                <goal>run</goal>
            </goals>
            <configuration>
                <tasks>
                    <move file="${project.build.directory}/${project.build.finalName}/mySwf-${project.version}.swf"
                        tofile="${project.build.directory}/${project.build.finalName}/somedir/mySwf.swf" />
                </tasks>
            </configuration>
        </execution>
    </executions>
  </plugin>


For the war project the maven-dependency-plugin is the somewhat better choice. It can copy different resources to different places and keeps in sync with your versions declared in your dependencies.

<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.0</version>
                <executions>
                     <execution>
                        <id>copy-content</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>com.foo.bar</groupId>
                                    <artifactId>barstyles</artifactId>
                                    <type>swf</type>
                                    <outputDirectory>${flashAppDir}/bar</outputDirectory>
                                    <destFileName>barstyles.swf</destFileName>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.graniteds</groupId>
                                    <artifactId>graniteds</artifactId>
                                    <type>swf</type>
                                 <outputDirectory>${flashAppDir}/thirdparty</outputDirectory>
                                    <destFileName>graniteds.swf</destFileName>
                                </artifactItem>
                               </artifactItems>
                        </configuration>
                    </execution>
0

精彩评论

暂无评论...
验证码 换一张
取 消