This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 172502

Summary: Improve indication what user should do to fix "broken" project with missing deps
Product: projects Reporter: Antonin Nebuzelsky <anebuzelsky>
Component: MavenAssignee: Jesse Glick <jglick>
Status: RESOLVED FIXED    
Severity: blocker CC: mkleint
Priority: P2 Keywords: PLAN
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:
Bug Depends on: 175472, 188964, 189442, 193021, 195440, 197669, 200445, 201459, 201460, 201461, 201462    
Bug Blocks:    

Description Antonin Nebuzelsky 2009-09-17 17:22:00 UTC
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.
Comment 1 David Simonek 2009-09-24 09:29:25 UTC
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)
Comment 2 Antonin Nebuzelsky 2009-09-25 17:27:13 UTC
Sounds good!
Comment 3 Jesse Glick 2011-04-05 22:20:34 UTC
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.
Comment 4 Jesse Glick 2011-04-12 17:21:36 UTC
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.
Comment 5 Jesse Glick 2011-06-24 18:22:12 UTC
dependency:go-offline may also be helpful.
Comment 6 Jesse Glick 2011-08-02 17:02:15 UTC
Using maven_fix_problems_172502 branch in core-main.
Comment 7 Jesse Glick 2011-08-12 00:15:49 UTC
New UI in core-main #3d7198ee62eb prompts you to run priming builds on relevant projects.
Comment 8 Quality Engineering 2011-08-13 14:14:58 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/3d7198ee62eb
User: Jesse Glick <jglick@netbeans.org>
Log: #172502: better UI for addressing Maven load problems.