return "org.apache.uima.ruta.ide.launching.RutaLauncher";
}
@Override
public String[] getClasspath(ILaunchConfiguration configuration) throws CoreException {
RutaIdePlugin d = RutaIdePlugin.getDefault();
List<String> extendedClasspath = new ArrayList<String>();
Collections.addAll(extendedClasspath, super.getClasspath(configuration));
// Normal mode, add the launcher plugin and uima runtime jar to the classpath
if (!Platform.inDevelopmentMode()) {
try {
// Add this plugin jar to the classpath
extendedClasspath.add(d.pluginIdToJarPath(RutaIdePlugin.PLUGIN_ID));
// UIMA jar should be added the end of the class path, because user uima jars
// (maybe a different version) should appear first on the class path
extendedClasspath.add(d.pluginIdToJarPath("org.apache.uima.runtime"));
extendedClasspath.add(d.pluginIdToJarPath("org.apache.uima.ruta.engine"));
} catch (IOException e) {
throw new CoreException(new Status(IStatus.ERROR, RutaIdePlugin.PLUGIN_ID, IStatus.OK,
"Failed to compose classpath!", e));
}
}
// When running inside eclipse with PDE in development mode the plugins
// are not installed inform of jar files and the classes must be loaded
// from the target/classes folder or target/org.apache.uima.runtime.*.jar file
else {
try {
extendedClasspath.add(d.pluginIdToJarPath(RutaIdePlugin.PLUGIN_ID) + "target/classes");
Bundle bundle = RutaIdePlugin.getDefault().getBundle("org.apache.uima.runtime");
if (bundle != null) {
Enumeration<?> jarEnum = bundle.findEntries("/", "*.jar", true);
if (jarEnum == null) {
extendedClasspath.add(d.pluginIdToJarPath("org.apache.uima.runtime"));
}
while (jarEnum != null && jarEnum.hasMoreElements()) {
URL element = (URL) jarEnum.nextElement();
extendedClasspath.add(FileLocator.toFileURL(element).getFile());
}