protected void process(final Component component) throws Exception { assert component != null; ScriptExecutor executor = (ScriptExecutor)component; if (source.configuration.getChildCount() != 0) { throw new MojoExecutionException("Invalid value for 'source' parameter; contains nested elements"); } ClassSource classSource = ClassSource.forValue(escapeAsNeeded(source.configuration.getValue())); log.debug("Class source: {}", classSource); ClassRealm realm = realmManager.createComponentRealm(provider(), createClassPath()); ResourceLoader resourceLoader = new MojoResourceLoader(realm, classSource); Configuration context = createContext(); log.debug("Executing '''{}''' w/context: {}", source, context); Object result = executor.execute(classSource, realm, resourceLoader, context); log.debug("Result: {}", result); realmManager.releaseComponentRealm(realm); }