2010-12-13 9 views
5

Czy istnieje sposób kompilacji projektu maven/flex, który nie zawiera żadnego * .mxml? Projekt flex zawiera tylko klasy ActionScript (tzn. Katalog "src/flex" zawiera tylko pliki * .as). Moje pom.xml jest tutaj:Jak skompilować projekt maven/flex bez pliku * .mxml?

<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 pakiet -e" rzuca ten błąd:

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

Odpowiedz

2

Spróbuj dodać ten plugin > wewnątrz <, gdzie "Main.as" jest klasa:

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

W moim przypadku nie ma żadnych plików podstawowe źródło (to był pełen SWC klas interfejsu jak ISessionProxy.as).

Więc musiałem zrobić dwie rzeczy, aby uzyskać tej pracy:

1) Odniesienie mój katalog źródłowy (w tagu kompilacji):

<build> 
    <sourceDirectory>src/main/flex</sourceDirectory> 

2) stosować się do zaleceń znalazłem on this mail group i the FlexMojos Google Group :

"...just remove all dependencies on your pom, because those dependencies are already defined on super pom."

Więc usunięte wszystkie moje zależności i dodaje je, jeden po drugim, aż mam go skompilować. Wszystko, co potrzebne było:

<dependency> 
    <groupId>com.adobe.flex.framework</groupId> 
    <artifactId>flex-framework</artifactId> 
    <version>${flex.sdk.version}</version> 
    <type>pom</type> 
</dependency> 

nawet usunięte wszystkie zależności dla wtyczki FlexMojos:

<plugin> 
    <groupId>org.sonatype.flexmojos</groupId> 
    <artifactId>flexmojos-maven-plugin</artifactId> 
    <version>${flexmojos.version}</version> 
    <configuration> 
      <targetPlayer>${flash.player.version}</targetPlayer> 
    </configuration> 
</plugin> 

ten pracował dla mnie, wytwarzania SWC muszę i mam nadzieję, że pomaga kogoś innego, też!