Maven with Adobe Flex

Getting following Errors

\toolbars\Toolbar.as:[62,3] unable to resolve '/../assets/zoomIn.png' for transcoding

and C:\OpenDetectorView.mxml:[18,-1] Could not resolve <mx:Label> to a component implementation.

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>ProSpectMain</artifactId>
      <version>1.0</version>
      <packaging>swc</packaging>
      <name>ProSpectMain</name>
      <build>
            <sourceDirectory>src</sourceDirectory>
            <testSourceDirectory>src/test/flex</testSourceDirectory>
            <plugins>
                  <plugin>
                        <groupId>org.sonatype.flexmojos</groupId>
                        <artifactId>flexmojos-maven-plugin</artifactId>
                        <version>3.5.0</version>
                        <extensions>true</extensions>
                        <configuration>
                              <main>ProSpectMain.mxml</main>
                              <useNetwork>true</useNetwork>
                        </configuration>
                        <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>
                  <scope>compile</scope>
            </dependency>
            <dependency>
                  <groupId>com.adobe.Docker</groupId>
                  <artifactId>Docker</artifactId>
                  <version>1.0</version>
                  <type>swc</type>
                  <scope>compile</scope>
            </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>

</project>
MeenuNagpalAsked:
Who is Participating?
 
ChristoferDutzCommented:
Hi there ;-)

First of all, why do you specify the path to your assets with a path "/../assets"? The directory structure of my projects usually looks this way:

/src
    /main
        /flex
        /resources
            /assets
        /locales
            /de_DE
            /en_US

It uses the defaults that flexmojos uses. This way you should be able to reference a resource without the "/.."prefix. I had similar problems when using Maven 3.0.3 together with flexmojos4 and the solution was to explicitly reference the flexmojos-threadlocaltoolkit-wrapper before the compiler. I documented this in my wiki in the chapter "Things I reccomend to change" ... mabe this helps solving your problem: http://dev.c-ware.de/confluence/display/PUBLIC/Configuring+your+poms

Chris
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.