Re: New Reactor Tag

2005-02-05 Thread Brett Porter
I have responded to this on the maven developers list.

- Brett


On Wed, 2 Feb 2005 14:15:13 -0500, Brian Cochran
<[EMAIL PROTECTED]> wrote:
> I'm glad someone else has run upon the issue. The creators of the
> DependencyResolver certainly thought of the idea that you may wish to
> resolve dependencies starting at a specific project. But the
> functionality isn't exposed in the reactor tag (at least I don't see
> how it is). I have written something that is a reactor like tag that
> exposes this functionality.
> 
> Here is a brief overview.
> 
> The ReactorTag currently uses the following to build the project order.
> 
> DependencyResolver dr = new DependencyResolver();
> dr.setProjects(projects);
> 
> dr.getSortedDependencies(false);
> 
> Looking at the DependencyResolverInterface, implementing classes
> support the idea of specifying the project that should be the head of
> the graph (exactly what we need to accomplish this functionality).
> 
> All we should need to do is to change the above line to
> 
> Project currentProject = ((MavenJellyContext)getContext()).getProject();
> 
> dr.getSortedDependencies(currentProject, false);
> 
> We have done something like this and it has worked successfully.
> Tell me what you think.
> 
> 
> Thanks,
> Brian
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: New Reactor Tag

2005-02-02 Thread Brian Cochran
I'm glad someone else has run upon the issue. The creators of the
DependencyResolver certainly thought of the idea that you may wish to
resolve dependencies starting at a specific project. But the
functionality isn't exposed in the reactor tag (at least I don't see
how it is). I have written something that is a reactor like tag that
exposes this functionality.

Here is a brief overview.

The ReactorTag currently uses the following to build the project order.

DependencyResolver dr = new DependencyResolver();
dr.setProjects(projects);

dr.getSortedDependencies(false);

Looking at the DependencyResolverInterface, implementing classes
support the idea of specifying the project that should be the head of
the graph (exactly what we need to accomplish this functionality).

All we should need to do is to change the above line to

Project currentProject = ((MavenJellyContext)getContext()).getProject();

dr.getSortedDependencies(currentProject, false);

We have done something like this and it has worked successfully.
Tell me what you think.


Thanks,
Brian

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: New Reactor Tag

2005-01-31 Thread Rick Mangi
Kind of  a hack, but we do this like so:




 Sub Projects Built... time to war
 

On Jan 31, 2005, at 4:35 PM, Brian Cochran wrote:
Sorry to cross post, but I wanted to see the reaction from the maven
userbase as to the demand for a new type of reactor tag.
---
Forgive me if someone has already discussed this but I thought it was
important to volunteer an idea.
Suppose you set up projects using a flat, not hierarchal directory
structure. In this case I want to rely on the project.xml dependency
structures only to designate parent and child projects. We use this
structure to obtain an m to n mapping between "deliverable projects
(zips, ears, wars, etc.) and component projects (jars, wars, etc.)
thus encouraging more project Independence.
Here is an example of how we would set up a couple different J2EE 
projects.

projects/
   /core-jar-project
   /ejb-jar project
   /war-one-project
   /ear-one-project
   /war-two-project
   /database-one-project (this may produce a zip file that can
be extracted and run on  a database)
   /database-two-project
   /deployable-one-project (maybe this is a zip of the ear-one
and database-one)
   /deployable-two-project
The two deliverable projects "one" and "two" above are relying on a
core set of components, but are not separated by folder structure. The
hierarchy is described completely in the project.xml's dependencies,
not the folder hierarchy. This of course also means that each
developer can organize the projects in his or her development
environment however he feels necessary. Adding a new project is also
easier. For example, creating a project "three" would not involve
duplicating the hierarchy of the individual components.
Of course the problem arises when one wants to do a multi project
build for a specific deliverable. In the above example, this is very
difficult as doing a regular multi project reactor based build will
build project "one" and project "two" even though I am only working on
project "one".
To address this issue, we built a new tag based on the reactor tag
called reconcile. This tag behaves very similarly to the reactor tag,
but instead of finding the relationships between all projects. It only
searches dependent projects from the current project. For example, I
execute the following command to build all components (that I have
checked out) relating to project one.
projects/deployable-one-project> maven reconcile:install
This would cause all projects in the dependency chain of project one
to build, but not project two.

If anyone is interested in this, please let me know.
Thanks,
Brian
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]