summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntje Fuhrmann2012-11-22 02:55:45 (EST)
committer Sven Rottstock2012-11-22 02:55:45 (EST)
commitfd2300c5e9aaf24c2293140962d6ba5d24fddb68 (patch)
tree5de1cd35fdb6d94ecb9ce4558cc92ea4467483a3
parent5f957a6a220218c8b450451261ad136b259b60c8 (diff)
downloadorg.eclipse.stardust.ide-fd2300c5e9aaf24c2293140962d6ba5d24fddb68.zip
org.eclipse.stardust.ide-fd2300c5e9aaf24c2293140962d6ba5d24fddb68.tar.gz
org.eclipse.stardust.ide-fd2300c5e9aaf24c2293140962d6ba5d24fddb68.tar.bz2
Jira-ID: CRNT-27054
Classpath too long for DeployModelDialog git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ide@61015 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--modeling/org.eclipse.stardust.modeling.common.projectnature/src/org/eclipse/stardust/modeling/common/projectnature/classpath/DeployModelNLClasspathProvider.java59
1 files changed, 54 insertions, 5 deletions
diff --git a/modeling/org.eclipse.stardust.modeling.common.projectnature/src/org/eclipse/stardust/modeling/common/projectnature/classpath/DeployModelNLClasspathProvider.java b/modeling/org.eclipse.stardust.modeling.common.projectnature/src/org/eclipse/stardust/modeling/common/projectnature/classpath/DeployModelNLClasspathProvider.java
index f704292..f59c697 100644
--- a/modeling/org.eclipse.stardust.modeling.common.projectnature/src/org/eclipse/stardust/modeling/common/projectnature/classpath/DeployModelNLClasspathProvider.java
+++ b/modeling/org.eclipse.stardust.modeling.common.projectnature/src/org/eclipse/stardust/modeling/common/projectnature/classpath/DeployModelNLClasspathProvider.java
@@ -5,12 +5,10 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.URIUtil;
+import org.eclipse.core.runtime.*;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
+import org.eclipse.jdt.launching.IRuntimeClasspathEntry2;
import org.eclipse.jdt.launching.JavaRuntime;
import org.osgi.framework.Bundle;
@@ -23,6 +21,8 @@ import org.osgi.framework.Bundle;
*/
public class DeployModelNLClasspathProvider extends CarnotToolClasspathProvider
{
+ private static final String TOMCAT_RUNTIME_TARGET = "org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget";
+
private static final String SRC_FOLDER = "src";
private static final String MODELING_DEPLOY_NL_PLUGIN = "org.eclipse.stardust.modeling.deploy";
@@ -31,9 +31,12 @@ public class DeployModelNLClasspathProvider extends CarnotToolClasspathProvider
public IRuntimeClasspathEntry[] computeUnresolvedClasspath(
ILaunchConfiguration configuration) throws CoreException
{
- Bundle deployBundle = Platform.getBundle(MODELING_DEPLOY_NL_PLUGIN);
+
List<IRuntimeClasspathEntry> entries = new ArrayList<IRuntimeClasspathEntry>(
Arrays.asList(super.computeUnresolvedClasspath(configuration)));
+ removeTomcatLibraries(configuration, entries);
+
+ Bundle deployBundle = Platform.getBundle(MODELING_DEPLOY_NL_PLUGIN);
Bundle[] fragments = Platform.getFragments(deployBundle);
for (int i = 0; i < fragments.length; i++)
{
@@ -57,4 +60,50 @@ public class DeployModelNLClasspathProvider extends CarnotToolClasspathProvider
}
return (IRuntimeClasspathEntry[]) entries.toArray(new IRuntimeClasspathEntry[0]);
}
+
+ /**
+ * The ModelDeploymentTool is started with its own classpath. Currently there are a lot
+ * of classpath entries. If there is a long installation path of ipp model deployment
+ * within RAD environment results in "file name too long" error on windows operating
+ * system.
+ */
+ private void removeTomcatLibraries(ILaunchConfiguration configuration,
+ List<IRuntimeClasspathEntry> entries) throws CoreException
+ {
+ IRuntimeClasspathEntry defaultProjectEntry = null;
+ IRuntimeClasspathEntry[] newRuntimeClasspathEntries = new IRuntimeClasspathEntry[0];
+ for (IRuntimeClasspathEntry runtimeClasspathEntry : entries)
+ {
+ if (runtimeClasspathEntry instanceof IRuntimeClasspathEntry2)
+ {
+ defaultProjectEntry = runtimeClasspathEntry;
+ IRuntimeClasspathEntry[] runtimeClasspathEntries = ((IRuntimeClasspathEntry2) runtimeClasspathEntry)
+ .getRuntimeClasspathEntries(configuration);
+ if (runtimeClasspathEntries != null)
+ {
+ newRuntimeClasspathEntries = new IRuntimeClasspathEntry[runtimeClasspathEntries.length];
+ for (int i = 0, j = 0; i < runtimeClasspathEntries.length; i++)
+ {
+ IRuntimeClasspathEntry classpathEntry = runtimeClasspathEntries[i];
+ IPath rawPath = classpathEntry.getPath();
+ String path = rawPath.toString();
+ if (!path.startsWith(TOMCAT_RUNTIME_TARGET))
+ {
+ newRuntimeClasspathEntries[j] = runtimeClasspathEntries[i];
+ j++;
+ }
+ }
+ }
+ }
+ }
+ entries.remove(defaultProjectEntry);
+ for (int i = 0; i < newRuntimeClasspathEntries.length; i++)
+ {
+ IRuntimeClasspathEntry runtimeClasspathEntry = newRuntimeClasspathEntries[i];
+ if (runtimeClasspathEntry != null)
+ {
+ entries.add(runtimeClasspathEntry);
+ }
+ }
+ }
}