}
if (useRuntimeClasspath) {
classpath.addAll(project.getRuntimeClasspathElements());
}
String classpathStr = MainHelper.toMultiPath(classpath.toArray(new String[classpath.size()]));
JavaMainCaller jcmd = null;
List<String> list = new ArrayList<String>(args != null ? args.length + 3 : 3);
if(args != null) {
for(String arg : args) {
list.add(arg);
}
}
list.add("-cp");
list.add(classpathStr);
if(fork) {
getLog().warn("scala-maven-plugin cannot fork scala console!! Running in process");
}
jcmd = new JavaMainCallerInProcess(this, mainConsole, classpathStr, jvmArgs, list.toArray(new String[list.size()]));
//We need to make sure compiler plugins are sent into the interpreter as well!
addCompilerPluginOptions(jcmd);
if (javaRebelPath != null) {
if (!javaRebelPath.exists()) {
getLog().warn("javaRevelPath '"+javaRebelPath.getCanonicalPath()+"' not found");
} else {
jcmd.addJvmArgs("-noverify", "-javaagent:" + javaRebelPath.getCanonicalPath());
}
}
jcmd.run(displayCmd);
}