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 136135 - improve local dependency management
Summary: improve local dependency management
Status: RESOLVED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Milos Kleint
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-05-30 08:29 UTC by kawazu428
Modified: 2009-02-19 22:42 UTC (History)
0 users

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 kawazu428 2008-05-30 08:29:55 UTC
Scenario:
- bunch of projects representing various maven artifacts  (two wars, a couple of jars)
- projects depending upon each other in a non-obvious way, so along with the amount of components rebuilding everything
is not trivial
- Opening a project in the IDE and browsing to "Libraries" makes the IDE display artifacts represented by "local"
projects with an "m2 project" icon, other artifacts as a "normal" jar icon, so obviously the IDE has a clue which are
"local" projects and which aren't.

Expectation:
- After dealing with standard NetBeans (ant) projects: Dependencies, if changed, will be rebuilt before building the
depending project.


Actual behaviour:
- The IDE tries to build the project chosen to be built and, then, will complain about required jar artifacts missing.
- By then the user will go out trying to manually build all the dependent projects in the "right" order to satisfy
dependencies.
- This is likely to be done each time rebuilding such a "chain" of transitively depending projects if having done
changes on that way.


This has been discussed on the nbusers alias before, and reasons have been outlined why creating such an "automated"
build mechanism is possibly a difficult and/or bad idea. However I am filing an enhancement request against this hoping
to get some discussion on it goin', both because this feature would drastically ease dealing with larger maven project
collections and because IMHO this is required to make maven2 behaviour comply with ant-project behaviour.
Comment 1 kawazu428 2008-06-05 14:46:39 UTC
proposed solution idea for that (no matter whether possible or how difficult to be done): 

- allow for automatically creating a "pom" artifact including a "modules" section
- allow for adding local projects (<module>../whatever</module>) to that
- provide some way to support user eventually getting modules sort in the "right" order in terms of how they depend upon
each other

So far, I see that while opening a maven2 project the IDE "sees" other maven2 projects that could be opened as
"required" projects, so the idea of having "required" project opened yet not automatically built along with the main
project seems somewhat counter-intuitive... ;)
Comment 2 Milos Kleint 2008-07-28 11:12:25 UTC
not for 6.5 I guess. The problems to solve include:
1. how to keep track of "changed" projects.
2. how to actually rebuild the changed projects in the right order.

please note that Compile on Save feature (not for maven projects in 6.5) might help with some scenarios. But at the same
time whenever a maven build is involved local repository needs to have the right dependencies in store.


Comment 3 kawazu428 2008-07-30 08:13:55 UTC
Okay, reasonable. From that point of view, so far I consider using a custom pom artifact having the projects added to it
in the "right" order as modules seems to be the easiest way to go. Is there a way to enhance IDE tooling to provide more
support for that (i.e. "add module and dependent project to pom modules section" via context menu or drag-and-drop)?
This would help a lot definitely. :)
Comment 4 Milos Kleint 2008-07-30 09:12:27 UTC
not sure I understand you proposition correctly, but the <modules> section can only be added to projects with "pom"
packaging.
Comment 5 kawazu428 2008-07-30 09:29:38 UTC
Yes, I am aware of that. :) But given this rebuild-of-transitive-dependencies has been bugging me for quite a while now,
I eventually chose to create an empty "build-helper" artifact, packaging pom, to manually add my modules in the right
order and use this to quickly rebuild everything in times of need (see http://wiki.netbeans.org/TaTMavenBuildAllProjects
). Though somewhat of a "hack", I wonder whether something like this might be a feasible solution to be quickly
implemented and easily usable... ?
Comment 6 kawazu428 2008-08-01 07:23:59 UTC
Adding to that, another idea: Couldn't the "Enterprise Application" tooling be abused for that in order to, say, be
allowed to create an umbrella "maven2 application" to which other "maven2 artifacts", be that war or jar or whatever,
easily could be added? This would feel / look / be homogenous compared to EAR tooling and possibly be the cleanest way
of handling things looking at it from a maven2 point of view...
Comment 7 Milos Kleint 2008-10-20 08:07:34 UTC
it seems to have been solved at least partially on the maven side itself.
http://maven.apache.org/plugins/maven-reactor-plugin/
AFAIK the functionality shall become part of the maven core in the future as cmdline switches.
Comment 8 nvarun 2008-11-02 17:58:20 UTC
WikiName got changed sometime back;

Before-
http://wiki.netbeans.org/TaTMavenBuildAllProjects

After-
http://wiki.netbeans.org/TaT_MavenBuildAllProjects
Comment 9 Milos Kleint 2009-02-06 15:55:49 UTC
I consider this fixed by introduction of "build with dependencies" action that relies on maven-reactor-plugin to perform
the build of projects the current one depends on. The scope of what gets built along is defined the the reactor root
project.