I meant to add a couple of things:

I'm running this all from a higher-level pom.xml that just references
the modules:

<modules>
    <module>projects/flex/frmwrk</module>
    <module>projects/flex/pingClient</module>
</modules>

That may explain why I'm getting the generated target version of the
swc instead of the repo version.

I'm using these versions of flex and flexmojos:

<flexmojos.version>3.5.0</flexmojos.version>
<flex.sdk.version>3.5.0.12683</flex.sdk.version>

Here's the version info from Maven:

Apache Maven 2.2.1 (r801777; 2009-08-06 14:16:01-0500)
Java version: 1.6.0_18
Java home: c:\Program Files\Java\jdk1.6.0_18\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7" version: "6.1" arch: "amd64" Family: "windows"

On Mar 30, 11:41 am, Rick Herrick <[email protected]> wrote:
> I have a swc that I compile as a module and install into the local
> repository.  This builds fine.  Then I'm trying to build swfs that use
> that swc as a library to build on.  This does NOT work fine.  So the
> top of my swc pom.xml looks like this:
>
> <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.0http://maven.apache.org/maven-v4_0_0.xsd";>
>     <parent>
>         <groupId>com.mycompany</groupId>
>         <artifactId>${myapp.artifactid}</artifactId>
>         <version>${myapp.version}</version>
>     </parent>
>     <modelVersion>4.0.0</modelVersion>
>     <name>Our Flex Framework SWC</name>
>     <groupId>com.mycompany</groupId>
>     <artifactId>myapp-flex-framework</artifactId>
>     <version>${myapp.version}</version>
>     <packaging>swc</packaging>
>     <build>...</build>
>     <dependencies>...</dependencies>
> </project>
>
> Then I reference that swc in my swf projects.  I put the dependency in
> both the flexmojos <plugin> element under <dependencies> and in the
> stand-alone <dependencies> element within the project (I've included
> that pom at the end of this post).  But when I run my "mvn clean
> install", I get this:
>
> [ERROR] C:\SVN\projects\flex\pingClient\src\main\flex\pingClient.mxml:
> [38,-1] Access of undefined property FlexUtils.
>
> I ran with -e and got this exception:
>
> Caused by: org.apache.maven.plugin.MojoExecutionException: Error
> compiling!
>         at
> org.sonatype.flexmojos.compiler.AbstractFlexCompilerMojo.build(AbstractFlex 
> CompilerMojo.java:
> 2450)
>         at
> org.sonatype.flexmojos.compiler.AbstractFlexCompilerMojo.run(AbstractFlexCo 
> mpilerMojo.java:
> 1275)
>         at
> org.sonatype.flexmojos.AbstractIrvinMojo.execute(AbstractIrvinMojo.java:
> 176)
>         at
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManag 
> er.java:
> 490)
>         at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLif 
> ecycleExecutor.java:
> 694)
>         ... 17 more
>
> Which I don't think really means anything other than what the initial
> error message really conveys, i.e. it's not finding FlexUtils.
> FlexUtils is a valid class, exists within the dependency, and works
> properly when referenced from within Flex Builder 3.
>
> Now what's really odd about this is that I'm referring to the swc only
> by its groupId/artifactId/version in the dependency reference.  But in
> the -compiler.library-path, I get a lot of references like this:
>
>  c:\Users\rherrick\.m2\repository\com\adobe\...\something.swc
>
> That makes sense: I'm referencing these dependencies in the local
> Maven repo directly and indirectly from my pom.xml.  But for my OWN
> swc reference, I actually get the path to the swc generated in the
> project folder, not the Maven repo version:
>
>  C:\SVN\projects\flex\frmwrk\myapp-flex-framework.swc
>
> That is a valid file, it's the same swc that's in the local repo (same
> size, timestamp, etc.). So I'm very confused:
>
> * Why isn't my dependency getting picked up and used as a build
> dependency for my projects that rely on that code?
> * Why is it using a local path version of this dependency instead of
> the Maven local repo version?
>
> Lastly, I've added <configurationReport>true</configurationReport> to
> the pom.xml and generated configs and seen pretty much what I expect
> to see based on all this: the swc is in the library path.
>
> Any ideas?
>
> pom.xml that fails to build:
>
> <?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.0http://maven.apache.org/maven-v4_0_0.xsd";>
>     <parent>
>         <groupId>com.mycompany</groupId>
>         <artifactId>${myapp.artifactid}</artifactId>
>         <version>${myapp.version}</version>
>     </parent>
>     <modelVersion>4.0.0</modelVersion>
>     <name>Ping Client</name>
>     <groupId>com.mycompany</groupId>
>     <artifactId>pingclient</artifactId>
>     <version>${myapp.version}</version>
>     <packaging>swf</packaging>
>     <build>
>         <finalName>pingClient</finalName>
>         <sourceDirectory>src/main/flex</sourceDirectory>
>         <resources>
>             <resource>
>                 <directory>${basedir}/src/main/resources</directory>
>             </resource>
>             <resource>
>                 <directory>${basedir}/target/generated-resources</
> directory>
>             </resource>
>         </resources>
>         <plugins>
>             <plugin>
>                 <!-- Flex (SWC and SWF) compilation -->
>                 <groupId>org.sonatype.flexmojos</groupId>
>                 <artifactId>flexmojos-maven-plugin</artifactId>
>                 <version>${flexmojos.version}</version>
>                 <!-- These dependencies necessary for updated compiler
> and AFEFontManager-->
>                 <configuration>
>                     <compiledLocales>
>                         <locale>en_US</locale>
>                     </compiledLocales>
>                     <parameters>
>                         <swf>${build.finalName}</swf>
>                         <width>100%</width>
>                         <height>100%</height>
>                     </parameters>
>                 </configuration>
>                 <dependencies>
>                     <dependency>
>                         <groupId>com.adobe.flex</groupId>
>                         <artifactId>compiler</artifactId>
>                         <version>${flex.sdk.version}</version>
>                         <type>pom</type>
>                     </dependency>
>                     <dependency>
>                         <groupId>com.mycompany</groupId>
>                         <artifactId>myapp-flex-framework</artifactId>
>                         <version>${myapp.version}</version>
>                         <type>swc</type>
>                     </dependency>
>                 </dependencies>
>                 <extensions>true</extensions>
>                 <executions>
>                     <execution>
>                         <goals>
>                             <goal>compile-swf</goal>
>                         </goals>
>                     </execution>
>                 </executions>
>             </plugin>
>             <plugin>
>                 <artifactId>maven-assembly-plugin</artifactId>
>                 <configuration>
>                     <descriptors>
>                         <descriptor>maven-assembly-descriptor.xml</
> descriptor>
>                     </descriptors>
>                 </configuration>
>                 <executions>
>                     <execution>
>                         <id>make-assembly</id>
>                         <phase>package</phase>
>                         <goals>
>                             <goal>attached</goal>
>                         </goals>
>                     </execution>
>                 </executions>
>             </plugin>
>         </plugins>
>     </build>
>     <dependencies>
>         <dependency>
>             <groupId>com.adobe.flex</groupId>
>             <artifactId>compiler</artifactId>
>             <version>${flex.sdk.version}</version>
>             <type>pom</type>
>         </dependency>
>         <dependency>
>             <groupId>com.adobe.flex.framework</groupId>
>             <artifactId>flex-framework</artifactId>
>             <version>${flex.sdk.version}</version>
>             <type>pom</type>
>         </dependency>
>         <dependency>
>             <groupId>com.adobe.flex.framework</groupId>
>             <artifactId>datavisualization</artifactId>
>             <version>${flex.sdk.version}</version>
>             <type>swc</type>
>         </dependency>
>         <dependency>
>             <groupId>com.ibm.ilog</groupId>
>             <artifactId>elixir</artifactId>
>             <version>${ilog.elixir.version}</version>
>             <type>swc</type>
>         </dependency>
>         <dependency>
>             <groupId>com.mycompany</groupId>
>             <artifactId>myapp-flex-framework</artifactId>
>             <version>1.0.0.0</version>
>             <type>swc</type>
>         </dependency>
>     </dependencies>
> </project>

-- 
You received this message because you are subscribed to the Google
Groups "Flex Mojos" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/flex-mojos

http://flexmojos.sonatype.org/

To unsubscribe from this group, send email to 
flex-mojos+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.

Reply via email to