actionscript-3 - 如何在没有任何 *.mxml 文件的情况下编译 maven/flex 项目?

标签 actionscript-3 maven-2 flex4

有什么方法可以编译不包含任何 *.mxml 的 maven/flex 项目吗?
flex 项目仅包含 ActionScript 类(即“src/flex”目录仅包含 *.as 文件)。我的 pom.xml 在这里:

<groupId>com.test</groupId>
<artifactId>test</artifactId>
<version>1.0-SNAPSHOT</version>
<name>test</name>
<packaging>swf</packaging>
<build>
    <sourceDirectory>src/main/flex</sourceDirectory>
    <testSourceDirectory>src/test/flex</testSourceDirectory>
    <plugins>
        <plugin>
            <groupId>org.sonatype.flexmojos</groupId>
            <artifactId>flexmojos-maven-plugin</artifactId>
            <version>3.8</version>
            <extensions>true</extensions>
            <dependencies>
                <dependency>
                    <groupId>com.adobe.flex</groupId>
                    <artifactId>compiler</artifactId>
                    <version>4.5.0.18623</version>
                    <type>pom</type>
                </dependency>
            </dependencies>
        </plugin>
    </plugins>
</build>
<dependencies>
    <dependency>
        <groupId>com.adobe.flex.framework</groupId>
        <artifactId>flex-framework</artifactId>
        <version>4.5.0.18623</version>
        <type>pom</type>
    </dependency>
    <dependency>
        <groupId>com.adobe.flexunit</groupId>
        <artifactId>flexunit</artifactId>
        <version>0.85</version>
        <type>swc</type>
        <scope>test</scope>
    </dependency>
</dependencies>

“mvn package -e”抛出这个错误:
[ERROR] Failed to execute goal org.sonatype.flexmojos:flexmojos-maven-plugin:3.8:compile-swf (default-compile-swf) on project test: Source file not expecified and no default found! -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.sonatype.flexmojos:flexmojos-maven-plugin:3.8:compile-swf (default-compile-swf) on project q-integra-scorecard-ldservice: Source file not expecified and no default found!

最佳答案

尝试将其添加到 中,其中“Main.as”是您的类:

<configuration>
    <sourceFile>Main.as</sourceFile>
</configuration>

关于actionscript-3 - 如何在没有任何 *.mxml 文件的情况下编译 maven/flex 项目?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4430922/

相关文章:

actionscript-3 - Flashdevelop 调试器 - System.BadImageFormatException

apache-flex - AdvancedDataGrid:如何判断当前可见的行数?

apache-flex - actionscript addChild 首先需要一个显示对象吗

actionscript-3 - Actionscript 3.0 打开 Windows 资源管理器

php - 当有人关闭浏览器窗口时是否可以运行 php 函数?

actionscript-3 - 检查用户的 Flash 播放器是否具有音频功能。 (功能.hasAudio)

java - 如何使用带有 eclipse 的 maven2 添加 apache 公共(public)日志记录?

eclipse - 如何从 Eclipse 在 Tomcat 中运行 Maven 项目

java - 如何在构建时使用 maven-minify-plugin 和 YUI 压缩器压缩 java 中的 JS 和 css

flash - 为灰度图像着色 as3