It would be really nice if you share your tips with other users by add this info on flexmojos wiki https://docs.sonatype.org/display/FLEXMOJOS/Running+unit+tests#Runningunittests-linux
It is public editable. VELO On Wed, Aug 18, 2010 at 11:28 PM, Eric Fetzer <[email protected]> wrote: > Ok, I figured it out. Here are the steps I had to take to get this going > in > RedHat: > > 1. Install FlashPlayer10 > 2. Add FlashPLayer to your path > 3. Install Xvfb by entering: >up2date -i xorg-x11-Xvfb > 4. Get xvfb-run.sh from: > > http://www.flexthinker.com/2009/09/building-a-flex-project-with-maven-using-hudson-on-centos/xvfb-run-sh/ > and > copy it to /usr/local/bin (remove the .sh extension) > 5. chmod 755 /usr/local/bin/xvfb > 6. Edit /etc/ld.so.conf.d/flashplayer10-i386.conf to add: > /usr/evolution28/lib > 7. Run >ldconfig > 8. Add the following to your profile: > MAVEN_OPTS="-Djava.awt.headless=true" > 9. cd to the directory containing your pom file > 10. >mvn install > > I hope this saves someone the pain I've gone through in the past few days. > > Thanks, > Eric > > > > > ________________________________ > From: Eric Fetzer <[email protected]> > To: [email protected] > Sent: Wed, August 18, 2010 7:39:16 PM > Subject: Build Flex in a Headless Environment > > Hi! I'm very new to Maven and trying to build a flex client in a headless > environment. As long as I export my display, I get no issues. However, I > need > to be able to do this headless so that it can be done in an automated > fasion. > I'm running: > > [r...@newark rossPrototype-client]# mvn -version > Apache Maven 2.2.1 (r801777; 2009-08-06 13:16:01-0600) > Java version: 1.6.0_20 > Java home: /usr/java/jdk1.6.0_20/jre > Default locale: en_US, platform encoding: UTF-8 > OS name: "linux" version: "2.6.9-89.el" arch: "i386" Family: "unix" > > With Flex 3 and flashplayer 10. I've tried setting MAVEN_OPTS: > -Djava.awt.headless=true > I've tried adding to my pom file: > > <testRunner> > <launcher> > <allowHeadlessMode>true</allowHeadlessMode> > </launcher> > </testRunner> > > Neither of these things changed anything. Here is the error I'm getting > without > > my display exported based on the command > >MAVEN_OPTS="-Djava.awt.headless=true" > mvn install -X: > > > ____________________________________________________________________________________________________________ > > > > [WARNING] [LAUNCHER] Using xvfb-run to launch headless tests > [INFO] > ------------------------------------------------------------------------ > [ERROR] BUILD ERROR > [INFO] > ------------------------------------------------------------------------ > [INFO] Failed to launch Flash Player. Probably java was not able to find > flashplayer. > Make sure flashplayer is available on PATH > or use -DflashPlayer.command=${flashplayer executable} > Read more at: > https://docs.sonatype.org/display/FLEXMOJOS/Running+unit+tests > Embedded error: Failed to launch Flash Player in headless environment. > java.io.IOException: error=2, No such file or directory > [INFO] > ------------------------------------------------------------------------ > [DEBUG] Trace > org.apache.maven.lifecycle.LifecycleExecutionException: Failed to launch > Flash > Player. Probably java was not able to find flashplayer. > Make sure flashplayer is available on PATH > or use -DflashPlayer.command=${flashplayer executable} > Read more at: > https://docs.sonatype.org/display/FLEXMOJOS/Running+unit+tests > at > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719) > > > at > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556) > > > at > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535) > > > at > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387) > > > at > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348) > > > at > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180) > > > at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328) > at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138) > at org.apache.maven.cli.MavenCli.main(MavenCli.java:362) > at > org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > > at java.lang.reflect.Method.invoke(Method.java:597) > at > org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) > at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) > at > org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) > at org.codehaus.classworlds.Launcher.main(Launcher.java:375) > Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to launch > Flash Player. Probably java was not able to find flashplayer. > Make sure flashplayer is available on PATH > or use -DflashPlayer.command=${flashplayer executable} > Read more at: > https://docs.sonatype.org/display/FLEXMOJOS/Running+unit+tests > at > org.sonatype.flexmojos.test.FlexUnitMojo.run(FlexUnitMojo.java:274) > at > org.sonatype.flexmojos.test.FlexUnitMojo.execute(FlexUnitMojo.java:156) > at > > org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490) > > > at > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694) > > > ... 17 more > Caused by: org.sonatype.flexmojos.test.launcher.LaunchFlashPlayerException: > Failed to launch Flash Player in headless environment. > at > > org.sonatype.flexmojos.test.launcher.AsVmLauncher.runFlashplayerHeadless(AsVmLauncher.java:149) > > > at > > org.sonatype.flexmojos.test.launcher.AsVmLauncher.start(AsVmLauncher.java:77) > at > > org.sonatype.flexmojos.test.DefaultTestRunner.run(DefaultTestRunner.java:53) > at > org.sonatype.flexmojos.test.FlexUnitMojo.run(FlexUnitMojo.java:262) > ... 20 more > Caused by: java.io.IOException: Cannot run program "xvfb-run": > java.io.IOException: error=2, No such file or directory > at java.lang.ProcessBuilder.start(ProcessBuilder.java:460) > at java.lang.Runtime.exec(Runtime.java:593) > at java.lang.Runtime.exec(Runtime.java:466) > at > > org.sonatype.flexmojos.test.launcher.AsVmLauncher.runFlashplayerHeadless(AsVmLauncher.java:142) > > > ... 23 more > Caused by: java.io.IOException: java.io.IOException: error=2, No such file > or > directory > at java.lang.UNIXProcess.<init>(UNIXProcess.java:148) > at java.lang.ProcessImpl.start(ProcessImpl.java:65) > at java.lang.ProcessBuilder.start(ProcessBuilder.java:453) > ... 26 more > [INFO] > ------------------------------------------------------------------------ > [INFO] Total time: 1 minute 20 seconds > [INFO] Finished at: Wed Aug 18 19:37:03 MDT 2010 > [INFO] Final Memory: 43M/223M > [INFO] > ------------------------------------------------------------------------ > > > >
