- I am using FlexMojos 4.x
- I do a complete build with FlexMojos to generate required configuration files
- I open the super POM with IntelliJ
- I set the Flex SDK of my first module to the one I really want to use (IntelliJ does not pickup the right version for some reason)
- I build the project, which seems to work only with built-in compiler and not compc/mxmlc or FCSH option
Now the problem arises. For some reason IntelliJ seems to delete configuration files that are created by Maven. Specifically maven creates ../target/classes/configuration/*.xml and all those files are deleted. However they are referenced by the .../target/${artifactId}-${version}-config.xml file as namespace manifests.
To fix this one has to recompile everything again with Maven to generated the configuration files. The only problem is that IntelliJ will delete them again and it seems quite random.
Building the project using any of 3 compilers should be performed in the same way, so it is rather strange if only one of 3 works. What are error messages with compc/mxmlc or fcsh?
If IntelliJ does not pickup the right version of Flex SDK - it is a bug that needs to be fixed. Please provide details about how Flex SDK is set in pom and what IDEA actually imports.
About deletion of ./target/classes/configuration/**.** files - first of all make sure that File | Settings | Compiler | Clear output directory on rebuild is switched off.
By the way: What exactly is FlexMojos doing wrong? Maybe something that can be fixed quite easy since it is an open source project and more convenient than waiting for you to write a special IntelliJ goal.
And different behavior of different compilers. We need to know if the issue is really present :)
And incorrect Flexmojos SDK version import. We used Flexmojos 4 a bit but haven't seen this issue.
Flexmojos is doing -configs.xml file wrong because it uses standard option -dump-config of Adobe's Flex compiler. It is rather buggy and doesn't dump some options or does it incorrectly. Actually we have already written an ultra-fast goal to generate correct config file. But we can't integrate it in IDEA currently because IDEA doesn't support Maven 3 fully. This will be done in 10.0.1 I hope.
already :) flexmojos 4 has extension point and new mojo — configurator.
Due to "IDEA doesn't support Maven 3 fully", you can use standard maven way (require flexmojos 4.0-SNAPSHOT, after https://github.com/Flexmojos/flexmojos/commit/81c3cd45bf5e4226946ae09f717be81cc1a56d6f ):
Add dependency to flexmojos-maven-plugin dependencies:
And param to configuration:
Example:
<plugin> <groupId>org.sonatype.flexmojos</groupId> <artifactId>flexmojos-maven-plugin</artifactId> <version>4.0-SNAPSHOT</version> <extensions>true</extensions> <dependencies> <dependency> <groupId>com.adobe.flex</groupId> <artifactId>compiler</artifactId> <version>${flex.sdk.version}</version> <type>pom</type> </dependency> <dependency> <groupId>com.intellij.flex.maven</groupId> <artifactId>flexmojos-idea-configurator</artifactId> <version>1.0.2</version> </dependency> </dependencies> <configuration> <configurator>com.intellij.flex.maven.IdeaConfigurator</configurator> </configuration> </plugin>Add repo:
<repositories> <repository> <id>flyti</id> <url>http://repository.flyti.org/</url> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>flyti</id> <url>http://repository.flyti.org/</url> </pluginRepository> </pluginRepositories>Run: mvn flexmojos:configurator (multimodule project is not supported). Specify target/*-config-report.xml as custom compiler configuration file.
What is strange is incorrectly picked version. So you manually fix it but next reimport changes it to incorrect again, right? Please paste a snippet how compiler version is set. It is probably specified by a property that is managed by profile or whatever...
So you need either ignoreVersionIssues option or explicit plugin dependency or Flexmojos version that has 4.1.0.16076 version of compiler by default. The latest SNAPSHOT by default has 4.5.0.18623