Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicitly refresh and rebuild test project after .classpath change #261

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,11 @@ public void testProjectClasspath() throws Exception {
+ " <classpathentry kind=\"lib\" path=\"/ExternalProject/sample-lib4.jar\"/>\n"
+ "</classpath>\n";
file.setContents(IOUtils.toInputStream(newClasspathContent, "UTF-8"), 0, null);
// refresh, so that changed .classpath file is considered
this.testProject.refreshLocal(IResource.DEPTH_INFINITE, null);
// rebuild again, so that changed classpath is configured on java project
this.testProject.build(IncrementalProjectBuilder.FULL_BUILD, null);

final IProjectPropertiesManager mgr = PMDPlugin.getDefault().getPropertiesManager();
IProjectProperties model = mgr.loadProjectProperties(this.testProject);
URLClassLoader auxClasspath = (URLClassLoader) model.getAuxClasspath(); // NOPMD: don't close auxclasspath in test, this should be done by the plugin
Expand Down