Super dev mode from Intellij (new)
Latest Intellij seems to support debugging client side Vaadin. Tested on Intellij 15 and Vaadin 7.4.7.
- Make sure GWT and Vaadin Support are added to Intellij. Not sure whether the Vaadin one is needed (?).
- At the same time - check that the legacy third party Vaadin plugin is not installed since it will prevent automatic recognition of Vaadin as a carrier of GWT SDK. If it is installed - remove it:
- Add magnolia-vaadin-widgetset module and create a new debug profile.
- Increase the memory and tweak the dev mode parameters
- VM options:
- Dev mode parameters:
-nostartServer -logLevel DEBUG -noincremental -style DETAILED
-nostartServercurrently seem to be blocking the configuration - even when removed, the configuration works, so you can remove it.
- VM options:
Note: The log level is a quirk to work-around an issue with mgwt hick-up.
- Create the GWT facet. Point it to the vaadin-client library inside your local m2-repository: /Users/you/.m2/repository/com/vaadin/vaadin-client/<reasonable version>
- If that does not work, IDEa offers to download GWT and get it from there - that worked.
- And add it to your widgetset-module:
- Run it in debug mode. Don't forget to also start the application server.
- The console will point you to the code-servers port where you can proceed as in the old procedure by creating the bookmarks.
- If you run into javax.servlet.http.HttpSessionIdListener or java.lang.NullPointerException when starting gwt debug, include dependencies below in widgetset's pom.xml:
Debugging with Intellij using source maps
- Google Chrome browser
- Install JetBrains Chrome plugin
- Make sure you have UI project imported in your Intellij.
- Fill name
- Point URL to admincentral (http://localhost:8080/magnoliaAuthor/.magnolia/admincentral)
- Set Browser to Chrome
- Navigate in the tree below to magnolia-ui-vaadin-common-widgets/src/main/java/info/magnolia/ui/vaadin/gwt/client and set Remote URL to
Put breakpoint in some client code and hit debug button. Chrome browser will start and debugging should now happen in Intellij.
In case debugging is not working, make sure you are running gwt in super dev mode, and that widgetset is compiled (use bookmars from gwt code server).
Super dev mode from vaadin code-server (old)
$ cd /path/to/magnolia_widgetset
$ mvn clean install -U
$ mvn vaadin:compile
$ mvn vaadin:run-codeserver
[INFO] The code server is ready.
[INFO] Next, visit: http://localhost:9876/
I have the following projects open in IDE (used for server side Java debugging):
Start up Magnolia (tomcat) from your IDE. Go to e.g. http://localhost:8080/.magnolia/admincentral
Hit the super-dev-mode-bookmark. Open chrome/firefox debugger. Enable source mapping (default):
Note: There is a plugin for eclipse, which will allow debugging the source maps in eclipse. Intellij should allow it per default. But did not get it running.
Eclipse launch configuration
Below is a launch configuration for eclipse. After importing, you will have to update the GWT libs on the classpath in "Debug Configurations..." (pointing to my maven repo by default).
Note that it does not enable debugging in the IDE.
Opening apps from the app-launcher is not working, due to mgwt. As a workaround use the browser location to get into your app: http://localhost:8080/.magnolia/admincentral#apps:pages
IntelliJ shows (compilation) errors related to language level
It seems that in some cases, the GWT compiler seems to default to Java 7, ignoring all other configuration. This shows as error messages in the editor like
Lambda expressions are not supported at this language level. GWT facet of your module is configured with language level 1.7.
To force it using a certain language level, open your widgetset module's GWT facet settings (see above) and add the following under "Compiler parameters":