diff --git a/src/main/java/io/openliberty/tools/common/plugins/util/DevUtil.java b/src/main/java/io/openliberty/tools/common/plugins/util/DevUtil.java index 150841a8..62214adc 100644 --- a/src/main/java/io/openliberty/tools/common/plugins/util/DevUtil.java +++ b/src/main/java/io/openliberty/tools/common/plugins/util/DevUtil.java @@ -358,7 +358,8 @@ private enum FileTrackMode { private File projectDirectory; private File multiModuleProjectDirectory; private List resourceDirs; - private List webResourceDirs; + // Not all webResource dirs need to be monitored, but those for which a Maven filtering will be applied do, since they can't be added to the loose app as source + private List monitoredWebResourceDirs; private boolean hotTests; private Path tempConfigPath; private boolean skipTests; @@ -443,7 +444,7 @@ public DevUtil(File buildDirectory, File serverDirectory, File sourceDirectory, boolean skipDefaultPorts, JavaCompilerOptions compilerOptions, boolean keepTempDockerfile, String mavenCacheLocation, List upstreamProjects, boolean recompileDependencies, String packagingType, File buildFile, Map> parentBuildFiles, boolean generateFeatures, - Set compileArtifactPaths, Set testArtifactPaths, List webResourceDirs) { + Set compileArtifactPaths, Set testArtifactPaths, List monitoredWebResourceDirs) { this.buildDirectory = buildDirectory; this.serverDirectory = serverDirectory; this.sourceDirectory = sourceDirectory; @@ -509,7 +510,7 @@ public DevUtil(File buildDirectory, File serverDirectory, File sourceDirectory, this.generateFeatures = generateFeatures; this.compileArtifactPaths = compileArtifactPaths; this.testArtifactPaths = testArtifactPaths; - this.webResourceDirs = webResourceDirs; + this.monitoredWebResourceDirs = monitoredWebResourceDirs; this.generatedFeaturesFile = new File(configDirectory, BinaryScannerUtil.GENERATED_FEATURES_FILE_PATH); this.generatedFeaturesModified = false; if (this.generateFeatures) { @@ -2835,7 +2836,7 @@ public void watchFiles(File outputDirectory, File testOutputDirectory, final Thr } HashMap webResourceMap = new HashMap(); - for (Path webResourceDir : webResourceDirs) { + for (Path webResourceDir : monitoredWebResourceDirs) { webResourceMap.put(webResourceDir, false); if (Files.exists(webResourceDir)) { registerAll(webResourceDir, executor); @@ -3033,7 +3034,7 @@ public void watchFiles(File outputDirectory, File testOutputDirectory, final Thr } // Check if webResourceDirectory has been added or deleted - for (Path webResourceDir : webResourceDirs) { + for (Path webResourceDir : monitoredWebResourceDirs) { if (!webResourceMap.get(webResourceDir) && Files.exists(webResourceDir)) { updateLooseApp(); registerAll(webResourceDir, executor); @@ -3906,7 +3907,7 @@ private void processFileChanges( // webResource file check Path webResourceParent = null; - for (Path webResourceDir : webResourceDirs) { + for (Path webResourceDir : monitoredWebResourceDirs) { if (directory.startsWith(webResourceDir)) { webResourceParent = webResourceDir; break; @@ -4082,9 +4083,6 @@ private void processFileChanges( } } } - // Update the loose app in case something changed - updateLooseApp(); - } else if (upstreamResourceParent != null && directory.startsWith(upstreamResourceParent.getCanonicalFile().toPath())) { // resources debug("Resource dir: " + upstreamResourceParent.toString()); @@ -4233,8 +4231,6 @@ private void processFileChanges( triggerJavaTestRecompile = true; } } - // Update the loose app in case something changed - updateLooseApp(); runTestThread(true, executor, numApplicationUpdatedMessages, skipUTs, false, buildFile); } } else if (fileChanged.equals(dockerfileUsed) @@ -4998,8 +4994,6 @@ protected boolean recompileJava(Collection javaFilesChanged, Set a // redeploy app after compilation if not loose application if (!isLooseApplication()) { redeployApp(); - } else { - updateLooseApp(); } if (projectName != null) { info(projectName + " source compilation was successful.");