• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1073
  • Last Modified:

Flex giving Exception with maven install

While maven install it gives following Exception
Unable to locate specified base class 'spark.components.WindowedApplication' for component class 'ProSpectAIR'
My ProSpectAIR.mxml is very simple and using <s:WindowedApplication> tag.

Following is my pom file

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
      <modelVersion>4.0.0</modelVersion>

      <groupId>com.canberra</groupId>
      <artifactId>ProSpectAIR</artifactId>
      <version>1.0</version>
      <packaging>swf</packaging>
      <name>ProSpectWeb Flex</name>
      <build>
            <sourceDirectory>src/main/flex</sourceDirectory>
            <plugins>
                  <plugin>
                        <groupId>org.sonatype.flexmojos</groupId>
                        <artifactId>flexmojos-maven-plugin</artifactId>
                        <version>3.7.1</version>
                        <extensions>true</extensions>
                        <dependencies>
                              <dependency>
                                    <groupId>com.adobe.flex</groupId>
                                    <artifactId>compiler</artifactId>
                                    <version>4.0.0.10193</version>
                                    <type>pom</type>
                                    
                              </dependency>
                        </dependencies>
                  </plugin>
            </plugins>
      </build>
      <dependencies>
            <dependency>
                  <groupId>com.adobe.flex.framework</groupId>
                  <artifactId>flex-framework</artifactId>
                  <version>4.0.0.10193</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>
            <dependency>
                  <groupId>com.canberra</groupId>
                  <artifactId>ProSpectMain</artifactId>
                  <version>1.0</version>
                  <type>swc</type>
            </dependency>
      </dependencies>
      <repositories>
            <repository>
                  <id>flexmojos</id>
                  <url>http://repository.sonatype.org/content/groups/flexgroup/</url>
            </repository>
            <repository>
                  <id>glassfish</id>
                  <url>http://maven.glassfish.org/content/groups/public</url>
            </repository>
      </repositories>

      <profiles>
            <profile>
                  <id>m2e</id>
                  <activation>
                        <property>
                              <name>m2e.version</name>
                        </property>
                  </activation>
                  <build>
                        <plugins>
                              <plugin>
                                    <groupId>org.maven.ide.eclipse</groupId>
                                    <artifactId>lifecycle-mapping</artifactId>
                                    <version>0.9.9-SNAPSHOT</version>
                                    <configuration>
                                          <mappingId>customizable</mappingId>
                                          <configurators>
                                                <configurator
                                                      id='org.maven.ide.eclipse.configuration.flex.configurator' />
                                          </configurators>
                                          <mojoExecutions>
                                                <mojoExecution>org.apache.maven.plugins:maven-resources-plugin::</mojoExecution>
                                          </mojoExecutions>
                                    </configuration>
                              </plugin>
                        </plugins>
                        <pluginManagement>
                              <plugins>
                                    <plugin>
                                          <groupId>org.apache.maven.plugins</groupId>
                                          <artifactId>maven-resources-plugin</artifactId>
                                          <version>2.4</version>
                                    </plugin>
                              </plugins>
                        </pluginManagement>
                  </build>
            </profile>
      </profiles>
</project>
0
MeenuNagpal
Asked:
MeenuNagpal
  • 2
  • 2
1 Solution
 
dgofmanCommented:
I will high recommend compile Flex code using ANT
You can execute ANT from MAVEN and pass parameters

<plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <executions>
                        <execution>
                              <id>compile-flex</id>
                              <phase>compile</phase>
                              <goals>
                                    <goal>run</goal>
                              </goals>
                              <configuration>
                                    <tasks>
                                          <ant antfile='${basedir}/build.xml'>                              <property name='maven_asdoc_skip' value='${maven.asdoc.skip}'/>
                                          </ant>
                                    </tasks>
                              </configuration>
                        </execution>                                                                        </executions>
                  </plugin>
0
 
MeenuNagpalAuthor Commented:
Ant build is also giving the same exception. I guess there is some issue with the Flex SDK. I have unzipped the swc file of spark and its missing many *.as files. Like for <s:WindowedApplication> the spark.swc doesn't contain class spark.components.WindowedApplication.as

I need to install the SDK in my local repository. Following i sthe way to install SDK to local repository:
mvn info.flex-mojos:install-mojo:2.0M7:install-sdk -Dflex.sdk.folder="${C:\Program Files\Adobe\Adobe Flash Builder 4\sdks\4.0.0}" -Dversion=4.0.0

But the info.flex-mojo:installmojo:2.0M7 is not avaliable in any repository. Let me know if you know any solution to this.
0
 
dgofmanCommented:
If you will use ANT you have use the same Flex SDK version in mojo

<property name="FLEX_HOME" value="../flex-sdk-4.1.0"/>

<target name="compile-mxml"">
            <taskdef resource="flexTasks.tasks" classpath="${FLEX_HOME}/ant/lib/flexTasks.jar"/>

<sequential>
                  <mxmlc file="${src.flex.dir}/${file.name}.mxml"
                        output="${target.flex.dir}/${out.file}.swf"
                        locale="en_US"
                        allow-source-path-overlap="true"
                        show-unused-type-selector-warnings="true"
                        keep-generated-actionscript="false"
                        target-player="10.0.0"
                        warnings="true"
                        fork="true"
                        maxmemory="512m">

                                <load-config filename="${FLEX_HOME}/frameworks/flex-config.xml"/>
                        <source-path path-element="${FLEX_HOME}/frameworks"/>
                      </mxmlc>
            </sequential>
      </target>
0
 
MeenuNagpalAuthor Commented:
Ant works fine with maven
Thanks
0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now