FYI, GroovyStarter creates a RootLoader that is configured by its "--classpath" arguments. Then runs its "--main" class argument. When groovy.ui.GroovyMain is that main class, it resets the thread's context class loader from the RootLoader to a new loader provided by "new GroovyShell(new CompilerConfiguration(command line processing)).getClassLoader()".
________________________________ From: Milles, Eric (TR Tech, Content & Ops) <eric.mil...@thomsonreuters.com> Sent: Friday, May 17, 2019 11:47 AM To: dev@groovy.apache.org Subject: groovy.ui.GroovyMain and groovy.ui.Console classpath arguments Both GroovyMain and Console claim to accept "--classpath" arguments, however neither class has any processing for them. How are these arguments supported? Is GroovyMain or Console supposed to be able to be run programatically? What I am trying to do is use GroovyStarter to bootstrap a basic Java/Groovy environment that groovy.ui.GroovyMain (for scripts) or groovy.ui.Console (for interaction) can be run from. What I am finding is that the classpath given to GroovyStarter is not propagating to GroovyMain. So I try and move the "--classpath" arguments from GroovyStarter to GroovyMain and the latter just ignores them. I'd actually prefer if GroovyStarter properly transferred its classpath to its "--main" class.