IntelliJ IDEA
Last updated
Was this helpful?
Last updated
Was this helpful?
Working example project, which results from this tutorial, can be downloaded from .
Grails support in is added through . Make sure it is installed in your IntelliJ IDEA before you start with the tutorial.
Go to and get the latest version of Grails. Unpack the Grails archive on your local computer and start up IntelliJ IDEA.
Open the New Project
window and select Grails
from the list and click on Next
button.
If it is your first Grails project in IDEA, click on Create...
button and then select the root of your unpacked Grails archive. It will add Grails into IDEA.
Fill in the name of the project and choose the latest version of Grails.
Click on Finish
and on the next dialog, choose Run 'create app'
.
Warning: sometimes, IDEA is not able to create Grails project and you end up with weird errors. In that case, try to upgrade IDEA version or run
grails create-app my-app
in console. Then after that open the project in IDEA.
Open file BuildConfig.groovy
and add Vaadin plugin compile ":vaadin:7.6.1"
.
Now we need to tell IDEA to reload dependencies. Run grails compile
or refresh the dependencies as shown on the following picture.
Synchronize Grails setting
should be performed always when you run into issues with dependencies.
Run grails vaadin-quickstart
that will generate sample code to easier project configuration.
The command vaadin-quickstart
will generate MyUI.groovy
and remove URL mapping inside UrlMapping.groovy
.
We have to disable Grails to take control over the URLs, so Vaadin can do it instead. Open UrlMappings.groovy
file and make sure the URL mapping is empty, so the content of the file is the following.
If you see
unable to resolve class com.vaadin.grails.VaadinConfiguration
error during compile, compile the project once more. There an issue with Grails together with IntelliJ IDEA and it is not possible to compile the project in the first run. Note that everything will work properly and you can ingnore that error.
We are ready to run the application. Click on the little green triangle in toolbar.
You can also press
Alt+Cmd+G
on Mac OS orCtrl+Alt+G
on Windows and typerun-app
in order to run the application.
The latest version of the plugin is always available on
Run the application again and a Vaadin application with a single Home label will be available on in your browser.