sdedic opened a new pull request, #5781:
URL: https://github.com/apache/netbeans/pull/5781

   Sometimes, a Maven subprojects fails to load completely - most notably on a 
fresh computer or when a multi-module project is opened for the first time, 
because:
   - it does not use explicit plugin or dependency versions, relying on parent 
pom
   - the parent pom itself does not specify the versions, but relies on BOM 
artifact
   - the BOM artifact is not in the local repository.
   
   In this situation, the parent POM parses and loads - and ProblemDetectors 
detect it needs to be 'primed'. But the subproject fails, as (from maven 
perspective) it does not contain "V" in GAVs of its dependencies and model 
builder fails with an exception - NetBeans creates a fallback project with 
"error:error:0" coordinates in this case.
   
   As a result, sources in the broken subprojects remain full of errors, even 
after the parent pom primes (and primes all its maven modules incl. the 
subprojects). If NB IDE is closed and started again, POMs are evaluated again, 
this time (after priming) with BOM artifact and its dependencies (and versions) 
available and errors disappear - but the restart is required.
   
   This PR adds code that, after the parent pom recovers from broken state (is 
reloaded, and is not a fallback), forces reload of dependent projects, if they 
are still cached. This gives dependent projects a change to be parsed, now with 
versions available (after the priming build).
   
   This is rather a hotfix as  NBLS for vscode is released shortly. Later, I 
would like to replace the dummy placeholder with a partially loaded project 
which is available in the thrown exception - but it needs thorough testing as 
code that was used to get 'all or dummy' would now receive half-populated model.
   
   Even the re-parsing could be more precise, subprojects would register on 
their declared parent POM so they refresh when the parent pom reloads. But at 
the moment, the placeholder project simply does not have parent POM data in its 
model, so this is left for the future to fix.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

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

Reply via email to