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 196936 - Maven: Include dependency classes in Project Run -> Main class -> Browse
Summary: Maven: Include dependency classes in Project Run -> Main class -> Browse
Status: RESOLVED WONTFIX
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 7.0.1
Hardware: All All
: P3 normal with 1 vote (vote)
Assignee: Tomas Stupka
URL:
Keywords:
: 226268 (view as bug list)
Depends on: 227458
Blocks:
  Show dependency tree
 
Reported: 2011-03-21 21:29 UTC by pekarna
Modified: 2016-07-07 08:39 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description pekarna 2011-03-21 21:29:28 UTC
STR:

1) Have a maven project with modules.
2) One module will be "assembling" module, which creates a jar with all app's .jars and it's dependencies. Use maven-assembly-plugin for that.
3) On this project, open Project -> Properties -> Run -> Main class -> Browse
4) No classes are listed - because this project has no sources.

The classes which can be run, however, are in the produced jar.
For larger Maven project, it's quite common that such assembly-making module is present.
Other such use case is when there are multiple modules which add different configuration, but again, uses the same .jar's built by other modules.


Therefore, I suggest this:

In the Browse dialog, add "Include dependency classes" checkbox;
when checked, the deps would be also searched for the "Main candidates".

If it's not that easy to add such checkbox, I suggest to include dependency classes by default. Usually, it would not list a lot of classes, so it would not confuse user. Classes from dependencies might be differentiated somehow - e.g. italics or such.
Comment 1 pekarna 2011-03-21 21:31:01 UTC
STR correction:

3) On this module's project, open Project -> Properties -> Run -> Main class -> Browse

Pity that I can't edit the text.
Comment 2 Jesse Glick 2011-03-21 21:42:56 UTC
Could be much slower to search in all dependencies.

Remember that you can always edit nbactions.xml directly to customize how Run should work.
Comment 3 Milos Kleint 2013-03-14 11:02:14 UTC
we could add a button to optionally search the runtime classpath for the entire list of main classes. However the default behaviour should still be to just search the project's own sources.
Comment 4 tcamminati 2013-06-18 10:21:24 UTC
A button to search runtime classes would be very helpful. Even better would be a step-wise search like in the add-dependency search, so it does not has to look up all runtime dependencies.
Comment 5 Milos Kleint 2014-04-14 07:14:43 UTC
*** Bug 226268 has been marked as a duplicate of this bug. ***
Comment 6 Martin Balin 2016-07-07 08:39:22 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss