Use the following three simple steps to develop and run a Groovy script in NetBeans:
- Install Groovy-Eclipse Plugin.
- Develop a Groovy script.
To install Groovy-Eclipse Plugin
- Go to https://github.com/groovy/groovy-eclipse.
- Follow the instructions for installing Groovy-Eclipse Plugin.
To develop a Groovy Script
- Create a Groovy project.
- Right-click the project in Package Explorer and click Properties.
- Click Java Build Path in the tree on the left-hand side. Click the Libraries tab on the right pane.
- Click Add External JARs to add all the JAR files in <modeling tool name>/lib and in <modeling tool name>/plugins/com.nomagic.magicdraw.automaton/engines/groovy-2.0.1/embeddable/groovy-all-2.0.1.jar.
- Click OK to close the dialog.
- Create a new Groovy class in the project. Remove a class declaration, and then put the script there.