Skip to content

Commit 5778829

Browse files
committed
Fixes #96: Wrong auxclasspath if project is stored outside of workspace
1 parent f0ddade commit 5778829

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

ReleaseNotes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ This is a bugfix release.
1313

1414
### Fixed Issues
1515

16+
* [#96](https://github.com/pmd/pmd-eclipse-plugin/issues/96): Wrong auxclasspath if project is stored outside of workspace
1617

1718
## 31-March-2019: 4.2.0.v20190331-1136
1819

net.sourceforge.pmd.eclipse.plugin/src/main/java/net/sourceforge/pmd/eclipse/runtime/cmd/JavaProjectClassLoader.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ private void addURLs(IJavaProject javaProject, boolean exportsOnly) {
6262

6363
try {
6464
// Add default output location
65-
addURL(javaProject.getOutputLocation());
65+
IPath projectLocation = javaProject.getProject().getLocation().removeLastSegments(1);
66+
addURL(projectLocation.append(javaProject.getOutputLocation()));
6667

6768
// Add each classpath entry
6869
IClasspathEntry[] classpathEntries = javaProject.getResolvedClasspath(true);
@@ -89,7 +90,7 @@ private void addURLs(IJavaProject javaProject, boolean exportsOnly) {
8990
case IClasspathEntry.CPE_SOURCE:
9091
IPath outputLocation = classpathEntry.getOutputLocation();
9192
if (outputLocation != null) {
92-
addURL(outputLocation);
93+
addURL(projectLocation.append(outputLocation));
9394
}
9495
break;
9596

0 commit comments

Comments
 (0)