We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

Flex giving Exception with maven install

MeenuNagpal
MeenuNagpal asked
on
Medium Priority
1,165 Views
Last Modified: 2012-05-11
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>
Comment
Watch Question

Top Expert 2011

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

Author

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.
Top Expert 2011
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
Ant works fine with maven
Thanks
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.