When a user opens a maven project which he received from someone else (e.g. a sample project downloaded from web), the
project is usually marked as broken in the Projects view because some artifacts it depends on are not yet cached in his
local maven repository.
For users unexperienced with Maven it may be a problem to realize what they should do.
We should improve the instructions in the UI to guide the users to either Build the project, or to click Show and
Resolve Problems in the project's popup menu and let the IDE download the dependencies.
The least what we can do is to add these instructions to the tooltip on the broken project.
I'm taking this one, my main ideas are:
1) to show red node as a first subnode of broken project, saying "Show and resolve problems..."
2) Move "Show and resolve problems..." to the top of project's popup
3) Don't touch tooltip - I think it's bad idea to add even more info into the tooltip, as it is currently so long that
user is certainly having problems to read it at once
In fact, situation with foreign projects is somehow complicated, as there are several typical scenarios what could
happen and they can be mixed:
a) (most common) Dependencies are missing locally ---> OK, just download them through "Show and resolve problems...", done.
Impl1: add a comment to a dialog that building prevents from these errors automatically
Impl2: if dependency can't be downloaded, don't offer "Download missing dependencies" repeatedly or at least say that
downloading failed and jump to that other problem. Currently there is no sign that downloading deps failed, "Show and
resolve problems..." just doesn't disappear from projects' menu
b) Project can't be loaded, saying <Badly formed Maven project>, typical reason:
- some artifact or plugin can't be found in repo ----> impl: enhance "problems" dialog, offer user to open project's web
page to learn what may be missing. enhance wiki page to tell user how to add "<repository>" section to add repo where
artifact can be found, tell user that project may need some extra repository defined in settings.xml and suggest to
visit project's web page again
c) Project can't be built
- Maven itself gives useful info in output window, no extra info needed. Either there is real bug in project or again
some artifact or plugin can't be found in repo, so the same in b)
A simple technique that would resolve a lot of problems: find the reactor root (maybe just this project), then run process-sources (or process-test-sources) on it. This will download all plugins and dependencies, the usual source of issues, and also generate source code which might be needed for the versioned source root to refer to. That should suffice for the Java scanner to work properly.
Seems that test-compile is in fact needed to download all test dependencies in some cases. And bug #197669 makes even that not work reliably.
dependency:go-offline may also be helpful.
Using maven_fix_problems_172502 branch in core-main.
New UI in core-main #3d7198ee62eb prompts you to run priming builds on relevant projects.
Integrated into 'main-golden'
User: Jesse Glick <email@example.com>
Log: #172502: better UI for addressing Maven load problems.