3

I'm trying to mavenize a Flex project using Flash Builder 4 as IDE. I'm using flexmojos 4.0-beta-7 with flex sdk 4.5.0.19786.

In my pom.xml I have:

<build>
   <sourceDirectory>${basedir}/src/main/flex</sourceDirectory>
   ...
</build>

and I have this directory structure ${basedir}/src/main/flex/assets/icons/**.png.

I have ${basedir}/pom.xml. I followed OpenScales fx samples as a model for my project.

FlashBuilder compiles normally, but invoking $>mvn clean package lots of unable to resolve 'assets/icons/*.png' for transcoding errors are raised.

Does assets folder have to be added explicitly for compiling? How?

Here it is my complete ${basedir}/pom.xml and here the output from $>mvn clean package.

Nightfirecat
  • 11,432
  • 6
  • 35
  • 51
Giorgio Vespucci
  • 1,586
  • 3
  • 18
  • 30
  • Please draw your directory structure more clearly. I mean where are assets are located. – Constantiner Jul 27 '11 at 12:59
  • @Constantiner Done. Hope is more clear now. Plese let me know. – Giorgio Vespucci Jul 27 '11 at 13:15
  • In your error message I can find `'assets/icons/*.png'`. Can't understand where Maven got this string. Is it in your POM? Please publish reference to the `'assets/icons/*.png'` from your POM or your code. Maybe it is better to publish all your POM? – Constantiner Jul 27 '11 at 13:19
  • @Constantiner Pasties for pom.xml and mvn command output added. – Giorgio Vespucci Jul 27 '11 at 13:31
  • Ok. Issue is clear now. Did you tried to use `'/assets/icons/food_fr.gif'` instead of `'assets/icons/food_fr.gif'`? – Constantiner Jul 27 '11 at 13:36
  • @Constantiner What do you mean exactly? I have used explicitly no assets icon path, with or without '/'. I only set my in the pom.xml. I thought this was enough for correct compiling... Do you any magic recipe for me? :) – Giorgio Vespucci Jul 27 '11 at 13:44
  • @Constantiner let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/1877/discussion-between-giorgio-vespucci-and-constantiner) – Giorgio Vespucci Jul 27 '11 at 13:44
  • I had this very error because of a typo in the file name. If you see this error "unable to resolve asset", make sure the pathname is correct. – Florian F Feb 28 '20 at 16:22

1 Answers1

20

I had the same problem a long time ago. And solved it replacing all the paths in Embed directives from 'assets/icons/food_fr.gif' to '/assets/icons/food_fr.gif'.

Constantiner
  • 14,231
  • 4
  • 27
  • 34