0

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.sonatype.org/display/FLEXMOJOS/Copy+Flex+Resources

Worker
  • 2,411
  • 6
  • 29
  • 55

3 Answers3

0

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>
Michael Bushe
  • 1,503
  • 16
  • 16
0

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> 
Benoit Courtine
  • 7,014
  • 31
  • 42
  • Hi Benoit, thank you for your reply. What about the case when I have several swfs from several sub-projects that I have to copy into different folders in my web-app? Can I do it too somehow? – Worker Sep 16 '10 at 13:49
  • I don't think you can. Maybe you can ask for a new feature. – Benoit Courtine Sep 16 '10 at 19:25
0

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>
user273895
  • 654
  • 5
  • 16