Hello, I am running into an issue with embedding images that are outside of the normal src/main/resources folder. Though it worked in Flex Builder I could not make it work with Flex Mojos. However, I also couldn't make it work with compc either. Then I found SDK-15466 (http://bugs.adobe.com/jira/browse/SDK-15466) which states there is a issue in the command line compiler with how it treats assets being embedded with a leading slash differently than Flex Builder, causing it not to work.
Velo - you have a comment in that ticket (http://bugs.adobe.com/jira/ browse/SDK-15466#action_196267) stating (I think) that you have implemented a fix in Flex Mojos. However, I still cannot make it work so I am just inquiring about it. I have the following test structure: /test/src/main/flex/App.mxml /test/src/main/resources/icons/cancel.png /test/pom.xml File content: App.mxml ------------- <mx:Application layout="absolute" xmlns:mx="http://www.adobe.com/2006/ mxml" > <mx:Button label="Button" icon="@Embed('/icons/cancel.png')" /> </mx:Application -------------- pom.xml (Note the two commented out sections) ------------- <?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>test</groupId> <artifactId>test</artifactId> <packaging>swf</packaging> <version>1.0-SNAPSHOT</version> <build> <sourceDirectory>src/main/flex</sourceDirectory> <plugins> <plugin> <groupId>org.sonatype.flexmojos</groupId> <artifactId>flexmojos-maven-plugin</artifactId> <version>3.2.0</version> <extensions>true</extensions> <!-- <configuration> <sourcePaths> <path>src/main/resources2</path> </sourcePaths> </configuration> --> </plugin> </plugins> <!-- <resources> <resource> <directory>src/main/resources2</directory> </resource> </resources> --> </build> <dependencies> <dependency> <groupId>com.adobe.flex.framework</groupId> <artifactId>flex-framework</artifactId> <version>3.3.0.4852</version> <type>pom</type> </dependency> </dependencies> </project> ----------------------------- Using this exact setup (with the commented out sections in the pom) everything compiles fine. However, if I rename the 'resources' directory to 'resources2' (the whole point of this post is having resources outside the normal src/main/resources folder) then I run into problems. Obviously if I do not modify the pom to tell it about the resources2 directory it does not work. If I uncomment the <resources> section it once again compiles fine. So you might be asking yourself "great! so what is the problem?". The problem is that I am trying to use a common resources directory outside of the project which contains over 170 resources (mostly icons) which are used by our enterprise app which has over 20 project files. If I use the <resources> directive, it will copy these 170 files on every compile in every project. This is not good for the sake of speed. So what I wish I could do is use the <sourcePaths> directive which (I assume) is the same as adding a source directory in Flex Builder which is how I get this to work there. In FB I simply add my resources directory as a source path and it works great. However, I cannot do the same with Flex Mojos. If I re-comment the <resources> directive and uncomment the the <sourcePaths> directive then I get the standard 'unable to resolve for transcoding' error. So my question is should the <sourcePaths> directive not work? Is that related to SDK-15466 or is your comment in reference to something else? Will I have to using <exclude> in the <resources> directive to keep compiles quick? Thanks in advance, Collin --~--~---------~--~----~------------~-------~--~----~ 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?hl=en?hl=en http://blog.flex-mojos.info/ -~----------~----~----~----~------~----~------~--~---
