Skip to content

Commit dff4ee0

Browse files
authored
Merge hotfix to master (#221)
fix issue #402 missing runtime scope classpath entry, eg: maven.pomderived=true test=true maven.groupId=org.yaml maven.artifactId=snakeyaml maven.version=1.19 maven.scope=runtime * Bump version to 0.12.2 (#220)
1 parent 1b73e14 commit dff4ee0

File tree

8 files changed

+24
-12
lines changed

8 files changed

+24
-12
lines changed

com.microsoft.java.debug.core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.microsoft.java</groupId>
77
<artifactId>java-debug-parent</artifactId>
8-
<version>0.12.1</version>
8+
<version>0.12.2</version>
99
</parent>
1010
<artifactId>com.microsoft.java.debug.core</artifactId>
1111
<packaging>jar</packaging>

com.microsoft.java.debug.plugin/.classpath

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
<classpathentry kind="src" path="src/main/java"/>
77
<classpathentry exported="true" kind="lib" path="lib/rxjava-2.1.1.jar"/>
88
<classpathentry exported="true" kind="lib" path="lib/reactive-streams-1.0.0.jar"/>
9-
<classpathentry exported="true" kind="lib" path="lib/com.microsoft.java.debug.core-0.12.1.jar"/>
9+
<classpathentry exported="true" kind="lib" path="lib/com.microsoft.java.debug.core-0.12.2.jar"/>
1010
<classpathentry kind="output" path="target/classes"/>
1111
</classpath>

com.microsoft.java.debug.plugin/META-INF/MANIFEST.MF

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
22
Bundle-ManifestVersion: 2
33
Bundle-Name: Java Debug Server Plugin
44
Bundle-SymbolicName: com.microsoft.java.debug.plugin;singleton:=true
5-
Bundle-Version: 0.12.1
5+
Bundle-Version: 0.12.2
66
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
77
Bundle-ActivationPolicy: lazy
88
Bundle-Activator: com.microsoft.java.debug.plugin.internal.JavaDebuggerServerPlugin
@@ -23,4 +23,4 @@ Bundle-ClassPath: lib/commons-io-2.5.jar,
2323
.,
2424
lib/rxjava-2.1.1.jar,
2525
lib/reactive-streams-1.0.0.jar,
26-
lib/com.microsoft.java.debug.core-0.12.1.jar
26+
lib/com.microsoft.java.debug.core-0.12.2.jar

com.microsoft.java.debug.plugin/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.microsoft.java</groupId>
77
<artifactId>java-debug-parent</artifactId>
8-
<version>0.12.1</version>
8+
<version>0.12.2</version>
99
</parent>
1010
<artifactId>com.microsoft.java.debug.plugin</artifactId>
1111
<packaging>eclipse-plugin</packaging>
@@ -45,7 +45,7 @@
4545
<artifactItem>
4646
<groupId>com.microsoft.java</groupId>
4747
<artifactId>com.microsoft.java.debug.core</artifactId>
48-
<version>0.12.1</version>
48+
<version>0.12.2</version>
4949
</artifactItem>
5050
</artifactItems>
5151
</configuration>

com.microsoft.java.debug.plugin/src/main/java/com/microsoft/java/debug/plugin/internal/ResolveClasspathsHandler.java

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
import org.eclipse.core.runtime.CoreException;
2121
import org.eclipse.core.runtime.IStatus;
2222
import org.eclipse.core.runtime.Status;
23+
import org.eclipse.jdt.core.IClasspathAttribute;
24+
import org.eclipse.jdt.core.IClasspathEntry;
2325
import org.eclipse.jdt.core.IJavaElement;
2426
import org.eclipse.jdt.core.IJavaProject;
2527
import org.eclipse.jdt.core.search.IJavaSearchConstants;
@@ -36,6 +38,7 @@
3638

3739
public class ResolveClasspathsHandler {
3840
private static final Logger logger = Logger.getLogger(Configuration.LOGGER_NAME);
41+
private static final String SCOPE_ATTRIBUTE = "maven.scope";
3942

4043
/**
4144
* Resolves class path for a java project.
@@ -178,10 +181,10 @@ private static String[] computeDefaultRuntimeClassPath(IJavaProject jproject) th
178181
for (int i = 0; i < unresolved.length; i++) {
179182
IRuntimeClasspathEntry entry = unresolved[i];
180183
if (entry.getClasspathProperty() == IRuntimeClasspathEntry.USER_CLASSES) {
181-
IRuntimeClasspathEntry[] entries = JavaRuntime.resolveRuntimeClasspathEntry(entry, jproject);
184+
IRuntimeClasspathEntry[] entries = JavaRuntime.resolveRuntimeClasspathEntry(entry, jproject, true);
182185
for (int j = 0; j < entries.length; j++) {
183186

184-
if (entries[j].getClasspathEntry().isTest()) {
187+
if (entries[j].getClasspathEntry().isTest() && !isRuntime(entries[j].getClasspathEntry())) {
185188
continue;
186189
}
187190
String location = entries[j].getLocation();
@@ -193,4 +196,13 @@ private static String[] computeDefaultRuntimeClassPath(IJavaProject jproject) th
193196
}
194197
return resolved.toArray(new String[resolved.size()]);
195198
}
199+
200+
private static boolean isRuntime(final IClasspathEntry classpathEntry) {
201+
for (IClasspathAttribute attribute : classpathEntry.getExtraAttributes()) {
202+
if (SCOPE_ATTRIBUTE.equals(attribute.getName()) && "runtime".equals(attribute.getValue())) {
203+
return true;
204+
}
205+
}
206+
return false;
207+
}
196208
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<site>
3-
<bundle id="com.microsoft.java.debug.plugin" version="0.12.1">
4-
<category name="javadebug" />
3+
<bundle id="com.microsoft.java.debug.plugin" version="0.12.2">
4+
<category name="javadebug" />
55
</bundle>
66
<category-def name="javadebug" label="Java Debug Server"/>
77
</site>

com.microsoft.java.debug.repository/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>com.microsoft.java</groupId>
66
<artifactId>java-debug-parent</artifactId>
7-
<version>0.12.1</version>
7+
<version>0.12.2</version>
88
</parent>
99
<artifactId>com.microsoft.java.debug.repository</artifactId>
1010
<packaging>eclipse-repository</packaging>

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<name>${base.name} :: Parent</name>
77
<description>The Java Debug Server is an implementation of Visual Studio Code (VSCode) Debug Protocol. It can be used in Visual Studio Code to debug Java programs.</description>
88
<url>https://github.com/Microsoft/java-debug</url>
9-
<version>0.12.1</version>
9+
<version>0.12.2</version>
1010
<packaging>pom</packaging>
1111
<properties>
1212
<base.name>Java Debug Server for Visual Studio Code</base.name>

0 commit comments

Comments
 (0)