{"id":31749,"date":"2016-01-22T21:47:47","date_gmt":"2016-01-22T16:17:47","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=31749"},"modified":"2016-01-27T11:25:02","modified_gmt":"2016-01-27T05:55:02","slug":"debugging-your-grails-3-0-x-application","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/debugging-your-grails-3-0-x-application\/","title":{"rendered":"Debugging your Grails 3.0.x application"},"content":{"rendered":"<p>Every new version of <strong>Grails<\/strong> brings some enhancements, and challenges on developer side too. Starting <a title=\"Grails 2.3.x debugging\" href=\"http:\/\/www.tothenew.com\/blog\/grails-debugging-in-version-2-3-x-and-above\/\" target=\"_blank\">Grails 2.3.x<\/a>, we had to change our approach to use debugger with our application, and with Grails 3.x coming out, we need to change approach to use debugger again.<\/p>\n<p>As Grails now uses <strong>Spring Boot<\/strong> and <strong>Gradle<\/strong>, we have to hook into <strong>bootRun<\/strong> gradle task that gets added by Spring Boot Gradle plugin. We can customize it by adding this task to <strong>build.gradle<\/strong> file, as follows:<\/p>\n<p>[sourcecode language=&#8221;java&#8221;]<br \/>\nbootRun {<br \/>\n    addResources = false \/\/ We can set it to true if we would like to reload src\/main\/resources<br \/>\n    jvmArgs = [&quot;-Xdebug&quot;, &quot;-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005&quot;]<br \/>\n}<br \/>\n[\/sourcecode]<\/p>\n<p>Now follow the steps below:<\/p>\n<ol>\n<li>Add a remote configuration inside your IDE that would attach your debugger to that port.<\/li>\n<li>Go to terminal, execute <strong>grails run-app<\/strong> and wait for prompt that says <em>Listening for transport dt_socket at address: 5005<\/em>.<\/li>\n<li>Now just hit <strong>debug <\/strong>toolbar symbol on your IDE.<\/li>\n<\/ol>\n<p>You&#8217;re again debugging your <a title=\"Grails Development\" href=\"http:\/\/www.tothenew.com\/grails-application-development\">Grails application<\/a>!<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Every new version of Grails brings some enhancements, and challenges on developer side too. Starting Grails 2.3.x, we had to change our approach to use debugger with our application, and with Grails 3.x coming out, we need to change approach to use debugger again. As Grails now uses Spring Boot and Gradle, we have to [&hellip;]<\/p>\n","protected":false},"author":70,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":10},"categories":[7,1],"tags":[3023,3022],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/31749"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/70"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=31749"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/31749\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=31749"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=31749"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=31749"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}