【问题标题】:Compiling multiple .as files using Maven使用 Maven 编译多个 .as 文件
【发布时间】:2013-05-15 18:52:17
【问题描述】:

我在让 maven 做一个简单的clean install 时遇到问题我收到以下错误:

Failed to execute goal org.sonatype.flexmojos:flexmojos-maven-plugin:3.8:compile-swf (default-compile-swf) on project flex: Source file not expecified and no default found! -> [Help 1]

我正在关注这个网站上的教程:Adobe Developer Connection - Flex and Maven

我的所有 .as 文件都位于:src/main/flex/,但问题是我没有 Main 类,这些基本上都是接口,所以我不能只选择其中一个作为源文件。

我也安装了 Eclipse,它对 POM 的插件部分大喊大叫,说:

Multiple annotations found at this line:
    - Plugin execution not covered by lifecycle configuration: org.sonatype.flexmojos:flexmojos-maven-plugin:
     3.8:compile-swf (execution: default-compile-swf, phase: compile)
    - Plugin execution not covered by lifecycle configuration: org.sonatype.flexmojos:flexmojos-maven-plugin:
     3.8:test-compile (execution: default-test-compile, phase: test-compile)

所以我不确定这是否相关,但我已尝试逐字复制/粘贴上面链接中的代码,但我仍然收到该错误,并且该人从未提及它,所以也许它只是一个Eclipse中maven插件的bug。

这是我的 POM.xml 文件:

<?xml version="1.0"?>
<project
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
    xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>com.company</groupId>
        <artifactId>parent</artifactId>
        <version>1.0</version>
    </parent>
    <artifactId>flex</artifactId>
    <name>flex</name>
    <packaging>swf</packaging>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>
    <dependencies>
        <dependency>
            <groupId>com.company</groupId>
            <artifactId>common</artifactId>
        </dependency>
        <dependency>
            <groupId>com.adobe.flex.framework</groupId>
            <artifactId>flex-framework</artifactId>
            <version>3.6.0.16995</version>
            <type>pom</type>            
        </dependency>
    </dependencies>
    <build>
        <sourceDirectory>src/main/flex</sourceDirectory>
        <plugins>
            <plugin>
                <groupId>org.sonatype.flexmojos</groupId>
                <artifactId>flexmojos-maven-plugin</artifactId>
                <extensions>true</extensions>
                <dependencies>
                    <dependency>
                        <groupId>com.adobe.flex</groupId>
                        <artifactId>compiler</artifactId>
                        <version>3.6.0.16995</version>
                        <type>pom</type>
                    </dependency>                   
                </dependencies>             
            </plugin>
        </plugins>
    </build>
</project>

我愿意接受任何关于如何编译这些 .as 文件的想法。谢谢!

编辑:好的,我想通了。我将包装从 swf 更改为 swc,它可以工作。好难过。

【问题讨论】:

    标签: apache-flex maven actionscript pom.xml flexmojos


    【解决方案1】:

    我将包从swf 转换为swc,它就像一个冠军。希望这对将来的某人有所帮助。

    【讨论】:

      【解决方案2】:

      您需要配置标签,以便 flexmojos 知道从哪里开始构建。 (默认应用,或主类)

      <plugin>
                  <groupId>org.sonatype.flexmojos</groupId>
                  <artifactId>flexmojos-maven-plugin</artifactId>
                  <extensions>true</extensions>
                  <dependencies>
                      <dependency>
                          <groupId>com.adobe.flex</groupId>
                          <artifactId>compiler</artifactId>
                          <configuration>
                                 <sourceFile>Module.mxml</sourceFile>
                          </configuration>
                          <version>3.6.0.16995</version>
                          <type>pom</type>
                      </dependency>                   
                  </dependencies>             
              </plugin>
      

      【讨论】:

      • 不幸的是我的项目没有任何 .mxml 文件,它只是 .as 文件。但我想通了...谢谢你的回复!
      • 是的,maven 工作时是奇迹,不工作时是诅咒:)
      猜你喜欢
      • 1970-01-01
      • 2011-05-10
      • 1970-01-01
      • 1970-01-01
      • 2019-09-22
      • 2011-02-05
      • 1970-01-01
      • 1970-01-01
      • 2021-11-05
      相关资源
      最近更新 更多