The documentation says, that <r:script> is the right way to do this, but this is part of the Resources Plugin, which is not available in Grails 3.0, so I think in a single GSP the right way to use Javascript is at the end of the <body> with the <g:javascript>-tag.
Is there a better way to do this?