

If you need to check what Groovy SDK version is used in a module, select Modules, the module's name and click the Dependencies tab.Ĭhange the existing Groovy SDK version in a project In the Project Structure dialog, under Platform Settings, select Global Libraries. You can check which version of Groovy SDK IntelliJ IDEA uses in a project.įrom the main menu select File | Project Structure Control+Alt+Shift+S. IntelliJ IDEA adds the Groovy SDK to your project, and you can add Groovy classes and Groovy scripts. In the dialog that opens, select Groovy and click OK. Once the action is found, click it to open the Add Framework Support dialog. Press Control+Shift+A and type Add Framework Support. In the Project tool window Alt+1, select the module to which you want to add the Groovy support. For more information, refer to the Gradle or Maven documentation. However, if you want to add the Groovy support for a Gradle or a Maven project, use their build script files ( adle or pom.xml). You can add the Groovy framework support for an existing project. Add Groovy support for an existing project To import a Groovy project, follow the steps from the Import a project with settings section. Specify your project information and click Finish. Java EE version - select the appropriate Java EE version. To add a library dependency after you've created or imported your Groovy project, refer to the add a library to the module dependencies section.
#INTELLIJ IDEA DEBUG DOWNLOAD#
Download the SDK, unpack it into any directory and specify this directory as the library home.Īdditional libraries and frameworks - if you need, specify additional libraries and frameworks that Groovy supports. IntelliJ IDEA expects the standard Groovy SDK layout which is provided with the official distributions available at.

String json = new GsonBuilder().setPrettyPrinting().create().You can create, import, test, and run Groovy applications as you would any other projects.īefore you start working with Groovy, make sure the Groovy plugin is enabled in IntelliJ IDEA. If there is an issue during serialization, with this renderer you can find the stack trace from the exception that you need to fix in the console. Initially I was having IllegalArgumentException for serialization of a nested object that I wasn't able to analyse. The following renderer helped me to identify multiple fields with the same name in the class hierarchy, so I could change that. In case someone is having hard time to make the renderers work for more complex objects - below you can find a combined JSON renderer from: disable(.SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)Ĭom.FIELD, registerModule(new .jsr310.JavaTimeModule()) Here you may add more sophisticated test which types you want to exclude from the JSON conversion. For some reason which I don't understand, even if I have Apply renderers to object of type set to, I needed to typecast this as (Object)this when used as a parameter of the writeValueAsString() method.

I also added some modifications to the ObjectMapper. Note: If you don't want to change default behaviour, create a "default" renderer also with "use default renderer" settings, and put it first in the list, it will use that as default and you can switch to JSON on demand by right click on debugged variable -> use renderer: JSON Renderer.įollow the instructions of and use the following expression.įor me it did not work without fully-qualified class names. Now when you choose Copy Value on a variable, it will copy as json.New ().setPrettyPrinting().create().toJson(this) If (null = this || this instanceof String) Choose Use following expression: and supply an expression like so:.Supply for Apply renderer to objects of type.Going to File | Settings | Build, Execution, Deployment | Debugger | Data Views | Java Type Renderers.EDIT: as noted in the comments, this is not perfect, as for some variables you will get a "stackoverflow" responseĪs suggested by Han's answer, here's how you can do this: Add a new way to view objects in Intellij debugger as json by
