While working on SWITCHYARD-2907, Fred Bricon pointed out that we should not really be caching the maven project in the SwitchYardProjectWorkingCopy. Instead, we should refresh it from the facade to ensure that we're getting the most up to date reference.
So we need to find a way to eliminate this copy https://github.com/jboss-switchyard/tools/blob/master/eclipse/plugins/org.switchyard.tools.ui/src/org/switchyard/tools/ui/common/impl/SwitchYardProjectWorkingCopy.java#L86
And do something more like we did with the facet install fix Fred led me to:
IFile pomFile = project.getFile(IMavenConstants.POM_FILE_NAME);
|
IMavenProjectFacade projectFacade = MavenPlugin.getMavenProjectRegistry().create(pomFile, true, monitor);
|
if (projectFacade == null || projectFacade.getMavenProject(monitor) == null) {
|
The "getMavenProject(monitor)" method refreshes the project in the cache so we get the updated one.
|