I tend to write stuff iteratively. I’ll write a little chunk, then poke at it a bit, then write some more, and so on. The Groovy Console is a great tool for doing so, but one thing that just hasn’t “clicked” with me yet is the concept of dependencies, classpaths, and all the dependency management stuff in between (Maven, Gradle, Ivy, etc.).
I quickly found myself frustrated with my lack of understanding, so I got in to the bad habit of just pasting all my classes right into the Groovy Console window and playing around with them right there. As my toy projects grew larger (and especially once they started relying on external dependencies), this became unworkable.
I did some poking around and found three ways to run the Groovy Console from Gradle, which (as far as I can tell) populates the Groovy Console classpath with everything I need for my project.