Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

You can download IntelliJ IDEA directly from the JetBrains download page, or install JetBrains Toolbox, which makes it easy to upgrade.


Simple Groovy project without Grouper source code

In this simple project setup, Grouper is just added as a dependency, and the source code for it won't be available for debugging. Use this type of project if you just want to check the syntax of your scripts.

1) Create project

File → New → Project...

Type: Groovy

Project SDK: 1.8...

You shouldn't need to set the Groovy library, because there is one associated with the Grouper library (see step 2). But if you did want to manually add one, you can download from https://groovy.apache.org/, and unzip one of the SDK packages.

→ Next

Select project name and base directory anywhere you want it

Image AddedImage Added


2) Add Grouper depedencies

File → Project Structure → Libraries → Add → From Maven...

Add these two dependencies (set version as desired). Don't worry if a search doesn't find it. Just hit enter after pasting in the strings

  • edu.internet2.middleware.grouper:grouperClient:2.5.54
  • edu.internet2.middleware.grouper:grouper:2.5.54


Image Added


Note that adding the Grouper dependency also sets a Groovy library version 2.5.0-beta-2, or whatever version is currently a dependency of Grouper.


3) Create Groovy scripts

The module will automatically create a src/ folder. Right click on it, select New Groovy Script (if it fails in your version due to a bug in 2021.2 use Groovy Class instead). You can delete the boilerplate class definition, and just write code outside of a class.

Image Added




Full development including Grouper project source code

...

This could take 10 minutes or more. While it's working, you won't see any project structure in the navigation pane. After it's dondone, e you will see all the main Grouper projects.

...

Once a process is listening on port 8000, you can start debugging the "JPDA" configuration

Tomcat

Make sure you are using Java 8 in your environment, not a higher version (java -version to verify). Start debugging with catalina jpda start. There won't be any output except in the logs, but it will start listening, and then you can debug. Stop Tomcat with catalina jpda stop.

GSH

Make sure you are using Java 8 in your environment, not a higher version (java -version to verify). Get the extra Java arguments by editing the configuration and copying the -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000 argument in the command line pane. Then start gsh with:

...

The module will automatically create a src/ folder. Right click on it, select New Groovy Class Script (better is Groovy Script, but a bug in 2021.2 and 2021.3 cause this to fail).If you choose New Groovy Class, you can or Groovy Class and delete the boilerplate class definition, and just write regular commands outside of a class. This should be aware of any grouper classes you referenceas a workaround if your version hasn't fixed this bug).




4) Run the script

There is probably a way to run this within the IDE, but I haven't tried it lately.

...