I am new to IDEA. What I would like to do is have a project (or module?) that has maven folder structure (aka src/main/java, src/main/groovy, src/test/groovy, etc), be managed by Gradle and support creation of Groovy classes, their compilation and execution.
What I tried:
What I am looking for:
Gradle The Gradle versions' support: starting with the version 3.0 and later. Note that for the Gradle version less than 4.8 and the Java version 11 there is an ongoing Gradle issue. If you work in IntelliJ IDEA, you don't need to install Gradle separately, IntelliJ IDEA does it for you.
The Groovy plugin is bundled with IntelliJ IDEA and enabled by default. IntelliJ IDEA supports the latest stable version of Groovy and Groovy 4 syntax.
In the Project tool window, right-click the project and from the context menu, select Add Framework Support. In the dialog that opens, select Groovy and click OK. IntelliJ IDEA adds the Groovy SDK to your project and you can add Groovy classes and Groovy scripts.
Dependency management Because Gradle's build language is based on Groovy, and parts of Gradle are implemented in Groovy, Gradle already ships with a Groovy library.
I would suggest not creating the project from inside Intellij.
Since Intellij imports Gradle projects quite nicely you can just import one of the pre-made Groovy Gradle Quick Starts you can find at the root of your Gradle installation.
For example $GRADLE_HOME/samples/groovy/mixedJavaAndGroovy
has the exact Java/Groovy layout you describe with the HelloWorld Classes and Tests in place. Just copy it, rename the root folder, import it into Intellij and code!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With