This is considered a "lite" dev env since we are not cloning git, or making pull requests. We just want to run grouper and make GSH templates or hooks or provisioners or daemons.
Note, if using Java 17, pass this argument to tests and tomcat
--add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.sql/java.sql=ALL-UNNAMED
- Install Java17 (or whatever version your container runs in)
- Install eclipse, in installer select "Eclipse IDE for Enterprise Java and Web Developers", select the Java17 you just installed
- Make sure eclipse ini has at least 3 gig memory
- Add Java17 JRE
- Make a new Maven project without archetype
- Right click on Project, Maven → Add dependency
- GroupId: edu.internet2.middleware.grouper
- ArtifactId: grouper-ui
- Version: (whatever you use): e.g. 4.12.0
- Right click on project, Maven, update project
- I use the java perspective, so switch to that
You can stop here if just coding GSH. If coding against the UI, continue: Get the webapp dir out of container
PS C:> cd C:\users\mchyzer-local\eclipse-workspace\test PS C:\users\mchyzer-local\eclipse-workspace\test> docker run --detach -e GROUPER_LOG_TO_HOST=true --name grouperFiles i2incommon/grouper:2.5.47 ui 62149d4d5f784949c635ba3ebc4276fb91b11e2bc39fe77d2ce7100f4780f405 PS C:\users\mchyzer-local\eclipse-workspace\test> docker cp grouperFiles:/opt/grouper/grouperWebapp . PS C:\users\mchyzer-local\eclipse-workspace\test> docker rm -f grouperFiles grouperFiles PS C:\users\mchyzer-local\eclipse-workspace\test>
- Refresh your eclipse project and see grouperWebapp
- Lets move the existing grouperWebapp/WEB-INF/classes dir contents into a new source folder named grouperWebappClasses
- Move any properties files from there to the resources folder and customize. Note if you are connecting to an existing database, the morphString secret must match
- If you are using a new database
Start hsql
PS C:\users\mchyzer-local\eclipse-workspace\test> mkdir temp PS C:\users\mchyzer-local\eclipse-workspace\test> cd temp PS C:\users\mchyzer-local\eclipse-workspace\test> java -cp .\grouperWebapp\WEB-INF\lib\hsqldb-2.3.5.jar org.hsqldb.Server -port 9001 -database file:temp/grouper
- grouper.hibernate.properties (moved from grouperWebappClasses)
- If you are using an existing database
Add in to grouper.hibernate.properties that it is ui, and put in a local pass for a subject (remote database) or GrouperSystem (hsql database or remote)
grouper.is.ui = true # UI basic auth is for quick start. Set to false when you migrate to shib or something else grouper.is.ui.basicAuthn = true grouperPasswordConfigOverride_UI_mchyzer_pass = pass grouperPasswordConfigOverride_UI_GrouperSystem_pass = pass
- Set java17 for project
- Change build path to compile to grouperWebapp/WEB-INF/classes (except the test source and test resources). Also dont exclude any resources. Note, in future if you do Maven → Update project, you might have reset some of these settings
- Download tomcat 9
- Add a new server in eclipse
- Window → Show view → Servers, add a module
- Make a large startup timeout
- Start the server
- Go to local grouper: http://localhost:8080/grouper (userName/pass) or whatever you put in grouper.hibernate.properties
Steps to move lite env to new container version
- Close eclipse
NOTE: This is important so that Eclipse can get a consistent state after the following changes! - cleanup dynamic folders from older container content
cd ......\test. ( Be in the Eclipse project's root directory )
rm -rf .\grouperWebapp
rm -rf .\grouperWebappClasses - Get new container to copy files from (Note reusing the same container name as before. You may need to 'docker rm -f grouperFiles' first. )
docker run --detach -e GROUPER_LOG_TO_HOST=true --name grouperFiles i2incommon/grouper:2.5.NN ui - Copy the new container's files to the local filesystem
cd ......\test. ( Be in the Eclipse project's root directory )
docker cp grouperFiles:/opt/grouper/grouperWebapp . - Move the existing grouperWebapp/WEB-INF/classes dir contents into the local source folder named grouperWebappClasses
cd ......\test. ( Be in the Eclipse project's root directory )
mv grouperWebapp/WEB-INF/classes/* grouperWebappClasses - Remove any "non base" config files from grouperWebappClasses (or anything your going to override with files in src\main\resources )
likely examples: grouper.hibernate.properties , morphString.properties, grouper-ui.properties, log4j.properties, etc.... - Start Eclipse
- select the project, right click and "refresh" ( or press the "F5" key )
- Do a "Project"(menu) → "Clean..." ( not maven clean! )