I have maven project with some flex facets. When I try to compile it in Idea I get error message:
Information:c:\java\jdk1.6\jre/bin/java.exe -Dapplication.home=C:/flex/FlexBuilderPlugin/sdks/3.2.0 -Xmx384m -Dsun.io.useCanonCaches=false -classpath C:\java\Idea8/plugins/flex/lib/idea-fcsh-fix.jar;C:/flex/FlexBuilderPlugin/sdks/3.2.0/lib/fcsh.jar flex2.tools.SimpleShell
Information:Adobe Flex Compiler SHell (fcsh)
Information:Version 3.2.0 build 3958
Information:Copyright (c) 2004-2007 Adobe Systems, Inc. All rights reserved.
Information:compc -load-config+=AirewsGuiLib_temp_flex_config.xml +configname=air
Information:Loading configuration file C:\flex\FlexBuilderPlugin\sdks\3.2.0\frameworks\air-config.xml
Information:Loading configuration file E:\NextGen\trunk\Idea\Maven\AirewsGuiLib_temp_flex_config.xml
Information:mxmlc -load-config+=AircrewsGuiLauncher_temp_flex_config.xml +configname=air
Information:Loading configuration file E:\NextGen\trunk\Idea\Maven\AircrewsGuiLauncher_temp_flex_config.xml
Information:mxmlc -load-config+=TestRunner_temp_flex_config.xml +configname=air
Information:Loading configuration file E:\NextGen\trunk\Idea\Maven\TestRunner_temp_flex_config.xml
Information:Compilation completed with 1 error and 0 warnings
Information:1 error
Information:0 warnings
Error:unable to load SWC airframework-3.2.0.3958.rb.swc: could not find catalog.xml within the SWC.
Issue was resolved
Any ideas why doesn't airframework-3.2.0.3958.rb.swc file contain catalog.xml? Every correct SWC file has ZIP-file format and contains catalog.xml file in the archive root.
When we use IDE Flex compilation then there's nothing maven specific (So maybe you shouldn't use IDE compilation at all? - then switch off "USE IDE builder" checkbox).
Well, if we want IDE builder to compile successfully there following thoughts:
1. Why is airframework-3.2.0.3958.rb.swc included to compilation? Check <facet_name>_temp_flex.config.xml file, I guess it contains entry like
<library-path append="true"><path-element>path/to/airframework-3.2.0.3958.rb.swc</path-element></library-path>
Most probable answer is that you've configured airframework-3.2.0.3958.rb.swc as Dependency in Module settings.
2.Next question is do we need airframework-3.2.0.3958.rb.swc for compilation? May be just removing it from Dependencies would resolve the problem?
General consideration about the issue is that the error "could not find catalog.xml within the SWC..." is not generated by IDEA. It's what Flex compiler(fcsh) says. IDEA generates parameters for fcsh (in <facet_name>_temp_flex.config.xml file) basing on IDEA Project configuration. So possible compilation failure reasons are:
2. It is maven project - all dependencies - including Flex SDK - should be taken from maven.
I don't know where problem is. All I know, that this project is successfully compiled by maven.
All configurations (project/module) were generated by idea while importing maven project. I only added Flex facet with +configname=air in Additional compiler parameters.
BTW. If i uncheck Use IDE builder only way to compile is to use mvn package?
We should probably file a bug with flex-mojos to make sure their placeholder swcs are at least valid swcs, and then figure out a way to handle setting the localization, or have a more obvious way of switching to a maven-only build instead of using fcsh.
Information:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/bin/java -Dapplication.home=/Applications/Adobe Flex Builder 3/sdks/3.3.0 -Xmx384m -Dsun.io.useCanonCaches=false -Duser.language=en -Duser.region=en -classpath /Applications/Diana-9821.app/plugins/flex/lib/idea-fcsh-fix.jar:/Applications/Adobe Flex Builder 3/sdks/3.3.0/lib/fcsh.jar com.intellij.flex.FcshLauncher
Information:Adobe Flex Compiler SHell (fcsh)
Information:Version 3.3.0 build 4852
Information:Copyright (c) 2004-2007 Adobe Systems, Inc. All rights reserved.
Information:compc -load-config+=pl-console-flex-shell-core_Flex_temp_flex_config.xml
Information:Loading configuration file /Applications/Adobe Flex Builder 3/sdks/3.3.0/frameworks/flex-config.xml
Information:Loading configuration file /Users/blonac/Source/depot/Service/ui/java/projects/Tsunami/main/pl-console-flex-shell-core_Flex_temp_flex_config.xml
Information:Compilation completed with 1 error and 0 warnings
Information:1 error
Information:0 warnings
Error:unable to load SWC rpc-3.2.0.3958.rb.swc: could not find catalog.xml within the SWC.
If you don't use custom config file then you should make sure that neither Flex SDK nor libraries ('Dependencies' tab of the module) contain invalid maven swc placeholders.
SWC files have zip format and valid SWC must have catalog.xml file in its root.
see http://www.jetbrains.net/jira/browse/IDEADEV-32647#action_355257, flexmojos supports IDEA — https://issues.sonatype.org/browse/FLEXMOJOS-41.
My use case is one that I think would be pretty standard. We have a flex project that uses maven (and the flexmojos) for its primary build. We use a custom compiler configuration file. I ran into this issue when I tried to run a FlexUnit test via the IDEA unit test runner (which uses Make). I want to use IDEA to quickly run a selected test or two during the development process. Using IDEA's make has several advantages in this scenario. I would think this is a pretty standard usage pattern.
I was using:
<dependency> <groupId>com.adobe.flex.framework</groupId> <artifactId>air-framework</artifactId> <version>3.3.0.4852</version> <type>pom</type> </dependency>Then looked into my local maven repository and found out that that dependency doesn't have a .swc at all.
Switch to :
<dependency> <groupId>com.adobe.flex.framework</groupId> <artifactId>airframework</artifactId> <version>3.3.0.4852</version> <type>pom</type> </dependency>Spotted the difference? air-framework -> airframework ;)
Then to be sure you can remove all the libraries from the project settings, remove the generated compiler settings, re-import the maven libraries and do a project rebuild. All should work then. :)
Thanks for the input. The reason the air-framework dependency does not have a .swc file is because its type (i.e. its packaging) is 'pom'. It is simply a POM file that lists other dependencies. This is a way of aggregating a number of dependencies into a single "entry" so you only have to list one dependency in your project. If you look at the air-framework POM, you will see that one of those dependencies is the airframework artifact with a type of 'swc'. In theory, you should also have had to change the type to swc in your maven settings. It's interesting that this works OK for you since you would not be getting the other 7 or 8 dependencies listed in the air-framework POM.
Also, some of us are using the Flex framework and not Air, so we need to use the flex-framework dependency.
Now I see it too :) My bad, must have been a 'glitch in the matrix' that it worked. Now I had the same problems again and indeed saw in the underlying pom that the classifiers are missing for the rb.swc's and therefore results in empty maven dependencies.
For the time being I just copy the dependencies from the pom and fill in the classifier myself.