Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgor Fedorenko2013-08-13 11:22:18 -0400
committerIgor Fedorenko2013-08-13 11:22:18 -0400
commit8a0b8b9760d18af2e826c00f41e0edc2d0773092 (patch)
treee04eba625e83ab09b9e2b34550ef804bdf835d19
parent909cb889363513822c86fc8c4a3aa88603dd2378 (diff)
downloadm2e-core-8a0b8b9760d18af2e826c00f41e0edc2d0773092.tar.gz
m2e-core-8a0b8b9760d18af2e826c00f41e0edc2d0773092.tar.xz
m2e-core-8a0b8b9760d18af2e826c00f41e0edc2d0773092.zip
414989 persist IClasspathEntryDescriptor#optionalDependency
Signed-off-by: Igor Fedorenko <igor@ifedorenko.com>
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/IClasspathManager.java8
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/ClasspathEntryDescriptor.java3
2 files changed, 11 insertions, 0 deletions
diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/IClasspathManager.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/IClasspathManager.java
index fd6062c0..4478b57e 100644
--- a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/IClasspathManager.java
+++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/IClasspathManager.java
@@ -61,6 +61,14 @@ public interface IClasspathManager {
public static final String POMDERIVED_ATTRIBUTE = "maven.pomderived"; //$NON-NLS-1$
/**
+ * Name of IClasspathEntry attribute that is set to {@code true} for entries that correspond to optional Maven
+ * dependency.
+ *
+ * @since 1.5
+ */
+ public static final String OPTIONALDEPENDENCY_ATTRIBUTE = "maven.optionaldependency"; //$NON-NLS-1$
+
+ /**
* Maven dependency resolution scope constant indicating test scope.
*/
public static final int CLASSPATH_TEST = 0;
diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/ClasspathEntryDescriptor.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/ClasspathEntryDescriptor.java
index ff33c691..77dbb569 100644
--- a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/ClasspathEntryDescriptor.java
+++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/ClasspathEntryDescriptor.java
@@ -89,6 +89,9 @@ public class ClasspathEntryDescriptor implements IClasspathEntryDescriptor {
if(scope != null) {
attributes.put(IClasspathManager.SCOPE_ATTRIBUTE, scope);
}
+ if(optionalDependency) {
+ attributes.put(IClasspathManager.OPTIONALDEPENDENCY_ATTRIBUTE, Boolean.toString(true));
+ }
IClasspathAttribute[] attributesArray = new IClasspathAttribute[attributes.size()];
int attributeIndex = 0;

Back to the top