From b3b279bcf7a616a6ddcb488b7b4c771b59460d1a Mon Sep 17 00:00:00 2001 From: Erin Harris Date: Fri, 17 Nov 2017 16:26:20 -0500 Subject: [PATCH] Issue 100: refresh user directory after src config changes copied over Make sure the user directory is refreshed after any changed src server configuration files are copied over. --- .../manager/internal/AbstractLibertyManager.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/dev/com.ibm.ws.st.liberty.buildplugin.integration/src/com/ibm/ws/st/liberty/buildplugin/integration/manager/internal/AbstractLibertyManager.java b/dev/com.ibm.ws.st.liberty.buildplugin.integration/src/com/ibm/ws/st/liberty/buildplugin/integration/manager/internal/AbstractLibertyManager.java index 06624524..11523984 100644 --- a/dev/com.ibm.ws.st.liberty.buildplugin.integration/src/com/ibm/ws/st/liberty/buildplugin/integration/manager/internal/AbstractLibertyManager.java +++ b/dev/com.ibm.ws.st.liberty.buildplugin.integration/src/com/ibm/ws/st/liberty/buildplugin/integration/manager/internal/AbstractLibertyManager.java @@ -295,6 +295,18 @@ private boolean lookForSrcConfigChanges(IResourceDelta projectDelta, IProgressMo IPath location = project.getLocation(); buildPluginHelper.updateSrcConfig(location, config, monitor); + // Any changes to the src server config have been copied over to the + // user directory so make sure it is refreshed + UserDirectory userDir = wsServer.getServerInfo().getUserDirectory(); + final IProject userDirProject = userDir.getProject(); + if (userDirProject != null && userDirProject.isAccessible()) { + try { + userDirProject.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor()); + } catch (Exception e) { + Trace.logError("Refreshing user directory project failed", e); + } + } + // Change the server to republish state so it will process the changed file on the next publish operation WebSphereServerBehaviour wsb = wsServer.getWebSphereServerBehaviour(); wsb.setWebSphereServerPublishState(IServer.PUBLISH_STATE_INCREMENTAL);