Skip to content

Commit b2c7a9e

Browse files
committed
Explicitly refresh and rebuild test project after .classpath change (#261)
Merge pull request #261 from adangel:project-classpath-test
2 parents d941d9c + e9676a5 commit b2c7a9e

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

ReleaseNotes.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ This is a minor release.
1717

1818
### API Changes
1919

20-
### External Contributions
20+
### Merged pull requests
21+
* Explicitly refresh and rebuild test project after .classpath change ([#261](https://github.com/pmd/pmd-eclipse-plugin/pull/261)) by [@adangel](https://github.com/adangel)
2122

2223
## 28-February-2025: 7.11.0.v20250228-1209-r
2324

net.sourceforge.pmd.eclipse.plugin.test/src/main/java/net/sourceforge/pmd/eclipse/runtime/properties/ProjectPropertiesModelTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,11 @@ public void testProjectClasspath() throws Exception {
573573
+ " <classpathentry kind=\"lib\" path=\"/ExternalProject/sample-lib4.jar\"/>\n"
574574
+ "</classpath>\n";
575575
file.setContents(IOUtils.toInputStream(newClasspathContent, "UTF-8"), 0, null);
576+
// refresh, so that changed .classpath file is considered
577+
this.testProject.refreshLocal(IResource.DEPTH_INFINITE, null);
578+
// rebuild again, so that changed classpath is configured on java project
579+
this.testProject.build(IncrementalProjectBuilder.FULL_BUILD, null);
580+
576581
final IProjectPropertiesManager mgr = PMDPlugin.getDefault().getPropertiesManager();
577582
IProjectProperties model = mgr.loadProjectProperties(this.testProject);
578583
URLClassLoader auxClasspath = (URLClassLoader) model.getAuxClasspath(); // NOPMD: don't close auxclasspath in test, this should be done by the plugin

0 commit comments

Comments
 (0)