> For the complete documentation index, see [llms.txt](https://ondrej-kvasnovsky-2.gitbook.io/vaadin-on-grails-3/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ondrej-kvasnovsky-2.gitbook.io/vaadin-on-grails-3/chapter1/creating_project/intellij_idea.md).

# IntelliJ IDEA

> Source code for this tutorial is available on [github.com/vaadin-on-grails-3/hello-world](https://github.com/vaadin-on-grails-3/hello-world).

Grails support in [IntelliJ IDEA](http://www.jetbrains.com/idea) is added through [Grails plugin](http://www.jetbrains.com/idea/webhelp/grails.html). Make sure it is installed in your IntelliJ IDEA before you start with the tutorial.

## Step 1

Create new project from IDEA menu. Click on `New..` item in the menu and then on `Project...`.

![](https://3271386179-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M3wXpb66WydUuf48oMu%2F-M3xQTa40MQprcFtZxzB%2F-M3xQUOBRZjbI6YjLvi-%2Fidea-1.png?generation=1585873552383691\&alt=media)

## Step 2

If it is your first Grails project in IDEA, click on `...` next to Grails SDK Home and provide path to your Grails folder. It will add Grails into IDEA. When you are done, click on `Next`.

![](https://3271386179-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M3wXpb66WydUuf48oMu%2F-M3xQTa40MQprcFtZxzB%2F-M3xQUOD8xeI7VxodaJF%2Fidea-2.png?generation=1585873552006250\&alt=media)

## Step 3

Fill in the name of the project and where the project should be created. Then click on `Finish` button.

![](https://3271386179-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M3wXpb66WydUuf48oMu%2F-M3xQTa40MQprcFtZxzB%2F-M3xQUOF2g3Gtg3lIAYK%2Fidea-3.png?generation=1585873551916004\&alt=media)

> 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 open the project in IDEA and follow the next steps.
>
> It takes more time to create new project first time.

## Step 4

When IDEA opens the newly created project, find and open build.gradle file. We need to add build and project dependencies to get the integration with Vaadin working.

Copy paste these lines into buildscript section. Check the print screen for places where to put these lines.

```
maven { url 'https://dl.bintray.com/ondrej-kvasnovsky/plugins/' }

classpath 'com.vaadinongrails:vaadin-gradle-plugin:2.0.2'

apply plugin: 'com.vaadinongrails.vaadin-gradle-plugin'
```

Then add these two lines into project dependency section:

```
maven { url 'https://dl.bintray.com/ondrej-kvasnovsky/plugins' }

compile ('com.vaadinongrails:grails-vaadin-plugin:2.0.3') {
    exclude group: 'com.vaadin', module: 'vaadin-client-compiler'
}
```

> The latest version of the plugin is always available on <https://bintray.com/ondrej-kvasnovsky/plugins>.

![](https://3271386179-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M3wXpb66WydUuf48oMu%2F-M3xQTa40MQprcFtZxzB%2F-M3xQUOHdaPo3EyQbQWJ%2Fidea-4.png?generation=1585873551968042\&alt=media)

## Step 5

Now we have all dependencies available and we can run `vaadin-quick-start` Gradle target to create mandatory files. `vaadin-quickstart` command creates `MyUI.groovy`, `VaadinConfig.groovy` and removes URL mapping inside `UrlMapping.groovy`.

![](https://3271386179-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M3wXpb66WydUuf48oMu%2F-M3xQTa40MQprcFtZxzB%2F-M3xQUOJIE7r1OGUwzXZ%2Fidea-5.png?generation=1585873551767241\&alt=media)

## Step 6

Now we are able to run our application.

![Run application](https://3271386179-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M3wXpb66WydUuf48oMu%2F-M3xQTa40MQprcFtZxzB%2F-M3xQUOLNESKpWgBqopm%2Fidea-7.png?generation=1585873552398801\&alt=media)

Here is how Grails run configuration looks like, in case we need to create it for our project.

![](https://3271386179-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M3wXpb66WydUuf48oMu%2F-M3xQTa40MQprcFtZxzB%2F-M3xQUONqt2Q8SSL1W23%2Fidea-8.png?generation=1585873552283286\&alt=media)

When the application is successfully started, we should see this UI in the browser.

![](https://3271386179-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M3wXpb66WydUuf48oMu%2F-M3xQTa40MQprcFtZxzB%2F-M3xQU-xo_XNFJPeiBz4%2Fidea-10.png?generation=1585873550762926\&alt=media)

## Step 7

In this step, we are going to do change in our Vaadin code and we will observe how changes are reflected in UI without server restart.

First we need to enable `auto recompile` in IDEA. Open IDEA settings and check on `Build project automatically` box.

![](https://3271386179-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M3wXpb66WydUuf48oMu%2F-M3xQTa40MQprcFtZxzB%2F-M3xQUOPf38XJmT3berr%2Fidea-6.png?generation=1585873551778679\&alt=media)

Then open MyUI.groovy file and add a label into main layout.

![](https://3271386179-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M3wXpb66WydUuf48oMu%2F-M3xQTa40MQprcFtZxzB%2F-M3xQUORNnsInJLyyf5T%2Fidea-11.png?generation=1585873551552477\&alt=media)

Switch to browser and refresh the page. We should see the newly added label on UI.

![](https://3271386179-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M3wXpb66WydUuf48oMu%2F-M3xQTa40MQprcFtZxzB%2F-M3xQUOTeILvimUQPcTF%2Fidea-12.png?generation=1585873552056580\&alt=media)
