Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgor Fedorenko2014-07-07 20:22:46 +0000
committerIgor Fedorenko2014-07-08 04:54:43 +0000
commit2b6eace30686c8e2961d64a8b508aa231d0c9d61 (patch)
tree5df912e647a4d3bb584dcb10a5ce7dd91c8cc8cd /org.eclipse.m2e.launching
parentdc8bf3bfa170f3197426d4e5ea2ce03fc03bc19c (diff)
downloadm2e-core-2b6eace30686c8e2961d64a8b508aa231d0c9d61.tar.gz
m2e-core-2b6eace30686c8e2961d64a8b508aa231d0c9d61.tar.xz
m2e-core-2b6eace30686c8e2961d64a8b508aa231d0c9d61.zip
438922 moved cli workspace resolver to a separate git repo
Signed-off-by: Igor Fedorenko <igor@ifedorenko.com>
Diffstat (limited to 'org.eclipse.m2e.launching')
-rw-r--r--org.eclipse.m2e.launching/META-INF/MANIFEST.MF3
-rw-r--r--org.eclipse.m2e.launching/build.properties3
-rw-r--r--org.eclipse.m2e.launching/org.eclipse.m2e.cliresolver.jarbin5084 -> 0 bytes
-rw-r--r--org.eclipse.m2e.launching/org.eclipse.m2e.cliresolver30.jarbin7440 -> 0 bytes
-rw-r--r--org.eclipse.m2e.launching/org.eclipse.m2e.cliresolver31.jarbin6490 -> 0 bytes
-rw-r--r--org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLaunchUtils.java19
-rw-r--r--org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenRuntimeLaunchSupport.java25
-rw-r--r--org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenSourcePathComputer.java11
8 files changed, 31 insertions, 30 deletions
diff --git a/org.eclipse.m2e.launching/META-INF/MANIFEST.MF b/org.eclipse.m2e.launching/META-INF/MANIFEST.MF
index f997b8b6..2f9d0370 100644
--- a/org.eclipse.m2e.launching/META-INF/MANIFEST.MF
+++ b/org.eclipse.m2e.launching/META-INF/MANIFEST.MF
@@ -24,7 +24,8 @@ Require-Bundle: org.eclipse.core.runtime,
org.slf4j.api;bundle-version="1.6.2",
org.eclipse.jdt.debug,
org.eclipse.core.resources,
- org.eclipse.debug.core
+ org.eclipse.debug.core,
+ org.eclipse.m2e.workspace.cli;bundle-version="0.1.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.7,
JavaSE-1.8
diff --git a/org.eclipse.m2e.launching/build.properties b/org.eclipse.m2e.launching/build.properties
index 394a07af..d60ddae0 100644
--- a/org.eclipse.m2e.launching/build.properties
+++ b/org.eclipse.m2e.launching/build.properties
@@ -14,9 +14,6 @@ bin.includes = META-INF/,\
.,\
plugin.properties,\
icons/,\
- org.eclipse.m2e.cliresolver.jar,\
- org.eclipse.m2e.cliresolver30.jar,\
- org.eclipse.m2e.cliresolver31.jar,\
about.html,\
schema/
jars.compile.order = .
diff --git a/org.eclipse.m2e.launching/org.eclipse.m2e.cliresolver.jar b/org.eclipse.m2e.launching/org.eclipse.m2e.cliresolver.jar
deleted file mode 100644
index efc52b74..00000000
--- a/org.eclipse.m2e.launching/org.eclipse.m2e.cliresolver.jar
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.m2e.launching/org.eclipse.m2e.cliresolver30.jar b/org.eclipse.m2e.launching/org.eclipse.m2e.cliresolver30.jar
deleted file mode 100644
index 296a2243..00000000
--- a/org.eclipse.m2e.launching/org.eclipse.m2e.cliresolver30.jar
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.m2e.launching/org.eclipse.m2e.cliresolver31.jar b/org.eclipse.m2e.launching/org.eclipse.m2e.cliresolver31.jar
deleted file mode 100644
index 47d13b61..00000000
--- a/org.eclipse.m2e.launching/org.eclipse.m2e.cliresolver31.jar
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLaunchUtils.java b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLaunchUtils.java
index d8575fc4..c10804db 100644
--- a/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLaunchUtils.java
+++ b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLaunchUtils.java
@@ -14,6 +14,7 @@ package org.eclipse.m2e.internal.launch;
import java.io.File;
import java.net.URI;
import java.net.URL;
+import java.util.Collections;
import java.util.List;
import org.osgi.framework.Bundle;
@@ -26,6 +27,7 @@ import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.osgi.util.NLS;
import org.eclipse.m2e.actions.MavenLaunchConstants;
+import org.eclipse.m2e.core.internal.Bundles;
import org.eclipse.m2e.core.internal.MavenPluginActivator;
import org.eclipse.m2e.core.internal.launch.AbstractMavenRuntime;
import org.eclipse.m2e.core.internal.launch.MavenRuntimeManagerImpl;
@@ -50,21 +52,22 @@ public class MavenLaunchUtils {
return runtime;
}
- public static String getCliResolver(AbstractMavenRuntime runtime) throws CoreException {
- String jarname;
+ public static List<String> getCliResolver(AbstractMavenRuntime runtime) {
+ String resolverBundleId;
String runtimeVersion = runtime.getVersion();
- if(runtimeVersion.startsWith("3.0")) { //$NON-NLS-1$
- jarname = "org.eclipse.m2e.cliresolver30.jar"; //$NON-NLS-1$
- } else if(runtimeVersion.startsWith("3.")) { //$NON-NLS-1$
- jarname = "org.eclipse.m2e.cliresolver31.jar"; //$NON-NLS-1$
+ if(runtimeVersion.startsWith("3.")) { //$NON-NLS-1$
+ resolverBundleId = "org.eclipse.m2e.workspace.cli"; //$NON-NLS-1$
} else {
- jarname = "org.eclipse.m2e.cliresolver.jar"; //$NON-NLS-1$
+ return Collections.emptyList(); // unsupported version of maven
}
- return getBundleEntry(MavenLaunchPlugin.getDefault().getBundle(), jarname);
+ Bundle resolver = Bundles.findDependencyBundle(MavenLaunchPlugin.getDefault().getBundle(), resolverBundleId);
+ return Bundles.getClasspathEntries(resolver);
}
/**
* Returns bundle entry path on local filesystem.
+ *
+ * @deprecated this method is not used by m2e internally and will be removed before 1.6
*/
public static String getBundleEntry(Bundle bundle, String entryPath) throws CoreException {
URL url = bundle.getEntry(entryPath);
diff --git a/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenRuntimeLaunchSupport.java b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenRuntimeLaunchSupport.java
index ad631df1..e6fcc9a2 100644
--- a/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenRuntimeLaunchSupport.java
+++ b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenRuntimeLaunchSupport.java
@@ -1,12 +1,9 @@
/*******************************************************************************
- * Copyright (c) 2008-2010 Sonatype, Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
+ * Copyright (c) 2008-2010 Sonatype, Inc. All rights reserved. This program and the accompanying
+ * materials are made available under the terms of the Eclipse Public License v1.0 which accompanies
+ * this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html
*
- * Contributors:
- * Sonatype, Inc. - initial API and implementation
+ * Contributors: Sonatype, Inc. - initial API and implementation
*******************************************************************************/
package org.eclipse.m2e.internal.launch;
@@ -39,7 +36,7 @@ import org.eclipse.jdt.launching.VMRunnerConfiguration;
import org.eclipse.m2e.core.embedder.IMavenLauncherConfiguration;
import org.eclipse.m2e.core.internal.MavenPluginActivator;
import org.eclipse.m2e.core.internal.launch.AbstractMavenRuntime;
-import org.eclipse.m2e.core.internal.project.WorkspaceStateWriter;
+import org.eclipse.m2e.workspace.WorkspaceState;
/**
@@ -50,9 +47,9 @@ import org.eclipse.m2e.core.internal.project.WorkspaceStateWriter;
* <p>
* Sets the following conventional launch configuration attributes.
* <ul>
- * <li>m2eclipse.workspace.state, full absolute path of m2e workspace state file. See {@link WorkspaceStateWriter} for
- * details of the state file format. Only set if workspace dependency resolution is enabled for the launch
- * configuration.</li>
+ * <li>WorkspaceState.SYSPROP_STATEFILE_LOCATION, full absolute path of m2e workspace state file. See
+ * {@link WorkspaceState} for details of the state file format. Only set if workspace dependency resolution is enabled
+ * for the launch configuration.</li>
* <li>maven.bootclasspath, maven runtime bootstrap classpath, normally only contains classworlds jar.</li>
* <li>maven.home, location of maven runtime, logical name is used for embedded and workspace runtimes</li>
* <li>classworlds.conf, location of classworlds configuration file, i.e. m2.conf</li>
@@ -115,7 +112,9 @@ public class MavenRuntimeLaunchSupport {
MavenLauncherConfigurationHandler cwconf = new MavenLauncherConfigurationHandler();
runtime.createLauncherConfiguration(cwconf, monitor);
if(resolveWorkspaceArtifacts) {
- cwconf.forceArchiveEntry(MavenLaunchUtils.getCliResolver(runtime));
+ for(String entry : MavenLaunchUtils.getCliResolver(runtime)) {
+ cwconf.forceArchiveEntry(entry);
+ }
}
File cwconfFile;
@@ -177,7 +176,7 @@ public class MavenRuntimeLaunchSupport {
// workspace artifact resolution
if(resolveWorkspaceArtifacts) {
File state = MavenPluginActivator.getDefault().getMavenProjectManager().getWorkspaceStateFile();
- properties.appendProperty("m2eclipse.workspace.state", quote(state.getAbsolutePath())); //$NON-NLS-1$
+ properties.appendProperty(WorkspaceState.SYSPROP_STATEFILE_LOCATION, quote(state.getAbsolutePath())); //$NON-NLS-1$
}
// maven.home
diff --git a/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenSourcePathComputer.java b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenSourcePathComputer.java
index 3ba8ef39..4be53593 100644
--- a/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenSourcePathComputer.java
+++ b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenSourcePathComputer.java
@@ -72,7 +72,7 @@ public class MavenSourcePathComputer implements ISourcePathComputer {
AbstractMavenRuntime runtime = MavenLaunchUtils.getMavenRuntime(configuration);
IMavenLauncherConfiguration collector = new IMavenLauncherConfiguration() {
- public void addArchiveEntry(String entry) throws CoreException {
+ public void addArchiveEntry(String entry) {
addArchiveRuntimeClasspathEntry(entries, entry);
}
@@ -90,7 +90,9 @@ public class MavenSourcePathComputer implements ISourcePathComputer {
}
};
- collector.addArchiveEntry(MavenLaunchUtils.getCliResolver(runtime));
+ for(String entry : MavenLaunchUtils.getCliResolver(runtime)) {
+ collector.addArchiveEntry(entry);
+ }
runtime.createLauncherConfiguration(collector, monitor);
IRuntimeClasspathEntry[] resolved = JavaRuntime.resolveSourceLookupPath( //
@@ -98,8 +100,7 @@ public class MavenSourcePathComputer implements ISourcePathComputer {
return JavaRuntime.getSourceContainers(resolved);
}
- protected void addArchiveRuntimeClasspathEntry(List<IRuntimeClasspathEntry> entries, String entryPath)
- throws CoreException {
+ protected void addArchiveRuntimeClasspathEntry(List<IRuntimeClasspathEntry> entries, String entryPath) {
File entryFile = new File(entryPath);
if(!entryFile.exists()) {
@@ -149,7 +150,7 @@ public class MavenSourcePathComputer implements ISourcePathComputer {
}
private void addArchiveRuntimeClasspathEntry(List<IRuntimeClasspathEntry> entries, String entryPath, InputStream is)
- throws IOException, CoreException {
+ throws IOException {
Properties p = new Properties();
p.load(is);

Back to the top