Re: Configure multiple source mxml files to generate multiple swf files
Hello Christopher, Thanks a lot for response and the valuable information about 'default-compile-swf' ID. I have tried the same, and it works like a charm! As long as any one of the executions have the ID as 'default-compile-swf', all the executions are processed correctly (without the dummy plugin declaration) by maven and I get their output as well. I never would have thought that the ID of the execution would make such a difference! Just out of curiosity: is it the flexmojos-maven-plugin specific behavior defined such that it executes correctly for specific ID? Or is it a generic behavior of all maven plugins? Regarding the modules, I agree with you. Ideally the apps should have been in different modules, but don't know who developed this years ago and why they didn't think about it :D -- Sent from: http://apache-flex-development.247.n4.nabble.com/
Re: Configure multiple source mxml files to generate multiple swf files
I was able to implement this by creating multiple blocks like [compile, rename] mapped to the different Maven phases On Thu, Feb 8, 2018 at 8:42 PM, Christofer Dutzwrote: > Hi Vaibhav, > > your first compilation (the one you are defining in the first plugin > definition) > also has an implicit execution id. You should be able to see it in the > console when the first compilation is done. > > So you should be able to use just one plugin definition with 4 executions > as long as the id of the fourth execution matches the default. > "default-compile-swf" > > Then it should work with only one plugin definition. > > However I can't explain, why it didn't work with the modules. But I also > have to admit that I never really used that feature as it's a maven habit > Of having only one artifact per module, which doesn't fit well with the > modules concept. > > Chris > > > Am 08.02.18, 11:56 schrieb "Vaibhav Shah" : > > Hello Christopher, > > I have found a solution, rather a hack, to the problem mentioned in > last > post. > > Solution: you need to specify the flexmojos-maven-plugin twice in the > pom.xml. In first instance, you specify any of the main application > mxml as > sourceFile. In the second instance, you specify all the main > application > mxmls as sourceFile in respective tags. This makes it work > somehow, and I now get all 3 swf files generated successfully from > their > respective mxml files. Here is the complete working pom.xml for > reference: > > > 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;> > 4.0.0 > > com.test > TA_UI_Test2 > 1.0-SNAPSHOT > swf > TA_UI_Test2 Flex > > > > com.adobe.flex.framework > playerglobal > 10-3.3.0.4852 > swc > > > com.adobe.flex.framework > rpc > 4.5.1.21328 > swc > > > com.adobe.flex.framework > framework > 3.2.0.3958 > swc > > > com.adobe.flex.framework > mx > 4.5.0.19786 > pom > > > > > src > > > > > org.sonatype.flexmojos > flexmojos-maven-plugin > 3.8 > true > > File1.mxml > true > > ${basedir}/target/File1.swf > > > > com.adobe.flex > compiler > 3.2.0.3958 > pom > > > > > > > > org.sonatype.flexmojos > flexmojos-maven-plugin > 3.8 > true > > > > > > Build1 > > File1.mxml > true > ${basedir}/target/ > File1.swf > > > compile-swf > > > > Build2 > > File2.mxml > true > ${basedir}/target/ > File2.swf > > > compile-swf > > > > Build3 > > File3.mxml > true > ${basedir}/target/ > File3.swf > > > compile-swf > > > > > > com.adobe.flex > compiler > 3.2.0.3958 > pom > >
Re: Configure multiple source mxml files to generate multiple swf files
Hi Vaibhav, your first compilation (the one you are defining in the first plugin definition) also has an implicit execution id. You should be able to see it in the console when the first compilation is done. So you should be able to use just one plugin definition with 4 executions as long as the id of the fourth execution matches the default. "default-compile-swf" Then it should work with only one plugin definition. However I can't explain, why it didn't work with the modules. But I also have to admit that I never really used that feature as it's a maven habit Of having only one artifact per module, which doesn't fit well with the modules concept. Chris Am 08.02.18, 11:56 schrieb "Vaibhav Shah": Hello Christopher, I have found a solution, rather a hack, to the problem mentioned in last post. Solution: you need to specify the flexmojos-maven-plugin twice in the pom.xml. In first instance, you specify any of the main application mxml as sourceFile. In the second instance, you specify all the main application mxmls as sourceFile in respective tags. This makes it work somehow, and I now get all 3 swf files generated successfully from their respective mxml files. Here is the complete working pom.xml for reference: 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;> 4.0.0 com.test TA_UI_Test2 1.0-SNAPSHOT swf TA_UI_Test2 Flex com.adobe.flex.framework playerglobal 10-3.3.0.4852 swc com.adobe.flex.framework rpc 4.5.1.21328 swc com.adobe.flex.framework framework 3.2.0.3958 swc com.adobe.flex.framework mx 4.5.0.19786 pom src org.sonatype.flexmojos flexmojos-maven-plugin 3.8 true File1.mxml true ${basedir}/target/File1.swf com.adobe.flex compiler 3.2.0.3958 pom org.sonatype.flexmojos flexmojos-maven-plugin 3.8 true Build1 File1.mxml true ${basedir}/target/File1.swf compile-swf Build2 File2.mxml true ${basedir}/target/File2.swf compile-swf Build3 File3.mxml true ${basedir}/target/File3.swf compile-swf com.adobe.flex compiler 3.2.0.3958 pom I still don't understand how come above hack works, and it doesn't work without the dummy plugin definition. However, it serves my purpose as of now. :) Thanks again for prompt response. Appreciate your time and inputs. Hope above helps someone. Cheers.. :)
Re: Configure multiple source mxml files to generate multiple swf files
Hello Christopher, I have found a solution, rather a hack, to the problem mentioned in last post. Solution: you need to specify the flexmojos-maven-plugin twice in the pom.xml. In first instance, you specify any of the main application mxml as sourceFile. In the second instance, you specify all the main application mxmls as sourceFile in respective tags. This makes it work somehow, and I now get all 3 swf files generated successfully from their respective mxml files. Here is the complete working pom.xml for reference: 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;> 4.0.0 com.test TA_UI_Test2 1.0-SNAPSHOT swf TA_UI_Test2 Flex com.adobe.flex.framework playerglobal 10-3.3.0.4852 swc com.adobe.flex.framework rpc 4.5.1.21328 swc com.adobe.flex.framework framework 3.2.0.3958 swc com.adobe.flex.framework mx 4.5.0.19786 pom src org.sonatype.flexmojos flexmojos-maven-plugin 3.8 true File1.mxml true ${basedir}/target/File1.swf com.adobe.flex compiler 3.2.0.3958 pom org.sonatype.flexmojos flexmojos-maven-plugin 3.8 true Build1 File1.mxml true ${basedir}/target/File1.swf compile-swf Build2 File2.mxml true ${basedir}/target/File2.swf compile-swf Build3 File3.mxml true ${basedir}/target/File3.swf compile-swf com.adobe.flex compiler 3.2.0.3958 pom I still don't understand how come above hack works, and it doesn't work without the dummy plugin definition. However, it serves my purpose as of now. :) Thanks again for prompt response. Appreciate your time and inputs. Hope above helps someone. Cheers.. :) -- Sent from: http://apache-flex-development.247.n4.nabble.com/
Re: Configure multiple source mxml files to generate multiple swf files
Hello Christopher, I realized that I need to use the in order to specify multiple executions of the same plugin. So I have updated the flexmojos-maven-plugin this way now, where each execution should compile a different sourceFile (so I can compile 3 sourceFiles with 3 executions): org.sonatype.flexmojos flexmojos-maven-plugin 3.8 true Build1 File1.mxml true File1.swf compile-swf Build2 File2.mxml true File2.swf compile-swf Build3 File3.mxml true File3.swf compile-swf com.adobe.flex compiler 3.2.0.3958 pom However, while running the maven build with above in my pom, it gives following error: /[ERROR] Failed to execute goal org.sonatype.flexmojos:flexmojos-maven-plugin:3.8:compile-swf (default-compile-swf) on project TA_UI_Test2: Source file not expecified and no default found! -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.sonatype.flexmojos:flexmojos-maven-plugin:3.8:compile-swf (default-compile-swf) on project TA_UI_Test2: Source file not expecified and no default found! at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216) at org.apache.maven.cli.MavenCli.main(MavenCli.java:160) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) at org.codehaus.classworlds.Launcher.main(Launcher.java:47) Caused by: org.apache.maven.plugin.MojoExecutionException: Source file not expecified and no default found! at org.sonatype.flexmojos.compiler.SwfMojo.setUp(SwfMojo.java:310) at org.sonatype.flexmojos.AbstractIrvinMojo.execute(AbstractIrvinMojo.java:154) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208) ... 20 more/ Why does above error appear even if the sourceFile is specified for each execution? -- Sent from: http://apache-flex-development.247.n4.nabble.com/
Re: Configure multiple source mxml files to generate multiple swf files
Hello Christopher, Thanks for prompt and detailed response. Actually I am given some existing legacy Flex project to migrate it to Maven. So I have just completed that migration using the pom.xml mentioned in my original post. However, I see in the code that there are total 3 mxml files under 'src' directory, which have '...' defined. That means, all 3 of them are individual flex applications (I am assuming this based on syntax because I am a java person, and new to flex - just working on this for migration to maven part only). Also, when I open the same project in Flex Builder and compile it, then there are total 3 swf files generated, one for each of the mxml file having tag. I want the same effect in the flex-maven project too, i.e. when I build flex project using the flexmojos-maven-plugin, there should be 3 SWF files created, one for each mxml file having tag. Is that anyhow possible? P.S. As mentioned in the original post, I tried duplicating the same plugin configuration with different 'mxml' names in sourceFile tags. I expected 3 different SWF files to be generated that way. On the contrary, maven just executed the last instance of the flexmojos-maven-plugin specified in pom, not all 3 of them. -- Sent from: http://apache-flex-development.247.n4.nabble.com/