【问题标题】:Coping swf resources with flex-mojos to the custom folder使用 flex-mojos 将 swf 资源处理到自定义文件夹
【发布时间】:2010-09-16 07:37:55
【问题描述】:

如何配置 copy-flex-resources 目标和 swf 依赖项以将 swf 文件复制到我的网络应用程序中的自定义文件夹?默认情况下,它会复制到 web-app 根目录。

更多关于copy-flex-resources目标的信息在这里: https://docs.sonatype.org/display/FLEXMOJOS/Copy+Flex+Resources

【问题讨论】:

    标签: apache-flex maven-2 flexmojos flex-mojos


    【解决方案1】:

    您可以向该插件添加“配置”:

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

    【讨论】:

    • 您好 Benoit,感谢您的回复。如果我有来自多个子项目的多个 swf,我必须将它们复制到我的 web 应用程序的不同文件夹中,那该怎么办?我也可以这样做吗?
    • 我不认为你可以。也许你可以要求一个新功能。
    【解决方案2】:

    我使用 maven-antrun-plugin 从几个子项目中复制几个 swf (可能有更好的方法,但它确实有效)

    <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>
    

    【讨论】:

      【解决方案3】:

      对于战争项目,maven-dependency-plugin 是更好的选择。它可以将不同的资源复制到不同的地方,并与您在依赖项中声明的版本保持同步。

      <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>
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2023-04-06
        • 1970-01-01
        • 1970-01-01
        • 2010-09-14
        • 1970-01-01
        相关资源
        最近更新 更多