You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "sdedic (via GitHub)" <gi...@apache.org> on 2023/04/06 09:26:18 UTC

[GitHub] [netbeans] sdedic commented on a diff in pull request #5781: Force refresh of live subprojects when parent recovers from broken.

sdedic commented on code in PR #5781:
URL: https://github.com/apache/netbeans/pull/5781#discussion_r1159527188


##########
java/maven/src/org/netbeans/modules/maven/NbMavenProjectImpl.java:
##########
@@ -552,6 +555,50 @@ public RequestProcessor.Task fireProjectReload() {
         }
         return reloadTask;
     }
+    
+    private void reloadPossibleBrokenModules(MavenProject preceding, MavenProject p) {
+        // restrict to just poms that were marked as broken/incomplete.
+        if (!(MavenProjectCache.isFallbackproject(preceding) || 
+            preceding.getContextValue("org.netbeans.modules.maven.problems.primingNotDone") != Boolean.TRUE)) {
+            return;
+        }
+        // but do not cascade from projects, which are themselves broken.
+        if (MavenProjectCache.isFallbackproject(p)) {
+            return;
+        }
+        File basePOMFile = p.getFile().getParentFile();
+        for (String modName : p.getModules()) {
+            File modPom = new File(new File(basePOMFile, modName), "pom.xml");
+            if (!modPom.exists() && modPom.isFile()) {
+                LOG.log(Level.FINE, "POM file {0} for module {1} does not exist", new Object[] { modPom, modName });
+                continue;
+            }
+            MavenProject child = MavenProjectCache.getMavenProject(modPom, true, false);
+            // the project may have more problems, more subtle, but now repair just total breakage
+            if (!MavenProjectCache.isFallbackproject(child)) {

Review Comment:
   Thanks! Fixed in e0159d8f0f86



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists