How to debug Flex application under maven

2019-05-23 05:00发布

问题:

I develop Flex-Java applications which is running under Apache Tomcat. I use Flex Builder plug-in for Eclipse as my IDE. My application consists of several libraries and modules. I manage all of them as a small maven (flex-mojos) projects.

Does anybody can share some ideas how to setup robust debuging enviroment?

回答1:

I use Maven & Flexmojos from the command line and the Flash builder 4 plugin inside of Eclipse. In my project I also have a Java/BlazeDS backend I like to debug at the same time as the Flex client on occasion.

Here's what I do:

1) I used cargo to startup an instance of my Java backend that DOES NOT have the SWF or HTML wrapper in it.

2) I've created a "Web Application" debug launch configuration where the launch URL just points to a file (e.g. "/path/to/my/flash-builder/bin/myapp-wrapper.html").

3) When I launch this debug configuration from within Eclipse the Flex debugger Just Works. As soon as a stop point it opened the Flex Debugger perspective automatically opens.

By launching a debug configuration directly from Eclipse I don't have to rebuild and redeploy a WAR file after each change made to the Flex app. In fact, after I shut down the Flex client I just leave the Java server running and reconnect with the next debugging launch.

In order debug the Java side, I start the application server with the JVM debugger command line arguments and launch a Remote Java Debugger debug launch configuration. Eclipse has no problem running both debuggers at the same time.

The only problem with this setup happens when I need to run the Flex web app from an http:// URL (for example to get flashvars to retrieve URL query parameters). In this case it is a long round-trip to get maven to created the WAR and deploy it, then to launch the debugger...after every Flex client source edit. I posted a question on how to make that case better (http://stackoverflow.com/questions/4426053/quickly-debug-flex-java-web-application-from-eclipse).

This is an area of interest to me so let me know what you are looking for and I can probably help more.