You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ivy-user@ant.apache.org by Sam Berlin <sb...@gmail.com> on 2009/03/30 19:34:33 UTC

Multi-Project IvyDE

Hi All,

We have a large multi-project repository that currently uses Ivy+Ant and
works very well.  I'm looking into using IvyDE, but setting it up for a
large multi-project repository seems to be a real pain.

An ivy.xml file exists in each project, and a shared ivysettings exists
under the 'common' project's directory.  I've been able to configure IvyDE
properly by using "project:///ivysettings.xml" in the common project's IvyDE
properties and 'project://common-project-name/ivysettings.xml' in each other
module's IvyDE properties.  This works, but is a real pain to setup.

What I'd like to do is something similar to the m2eclipse plugin, where they
take the parent of a multi-module pom and the plugin automatically creates a
project for each module.  In Ivy-land, this would be similar to subant after
ivy:buildlist within Ant.

Would you be amenable to having some kind of 'Checkout as Ivy Project' or
'Create Ivy Project' that scans for subdirectories containing ivy.xml
(perhaps offering options similar to buildlist) and then automatically
creating each project it finds?  The setup wizard could ask where a shared
ivysettings is for each project and automatically fill in the properties for
each project.  Something like this would be an amazing step in in terms of
usability of IvyDE for multi-project repositories.

I can investigate into how m2eclipse does this and try and create something
similar for IvyDE if people think this is a feature that would be accepted.

Thanks,
 Sam

Re: Multi-Project IvyDE

Posted by Sam Berlin <sb...@gmail.com>.
I've been hacking on IvyDE using the m2eclipse plugin as an example, and
have got it currently working to scan for ivy.xmls and creating projects
where the ivy.xmls exist.  It currently only creates a simple project (with
no java nature) and has a few other TODOs that are mainly questions I have
to ask on this list... but as a proof-of-concept, it works.

I figure if we provide sane defaults (such as creating with a java nature,
allowing the user to specify an ivysettings location that will be used by
default for each project's ivy container, etc..), it's a clear improvement
from what it is now.  If more configuration is required, there can either be
UI widgets to let the user set it, or a new ivyde.xml file that could be
present where the project is created that could instruct IvyDE on how to
automatically set things up.  My personal preference would be for some kind
of optional ivyde.xml so that users could automagically create the projects
without needing to follow instructions, but I have no strong feelings on it.

Sam

2009/4/7 Nicolas Lalevée <ni...@hibnet.org>

> On mardi 31 mars 2009 14:29:19 Sam Berlin wrote:
> > Hi Nicolas,
> >
> > Thanks for the reply.  There's no separate place to do this in m2eclipse
> --
> > the plugin just "makes it work".  That is, if you attempt to import a
> Maven
> > Project that has a multi-module pom, it will automatically create
> multiple
> > projects.  (The same thing with 'Checkout as Maven Project' from CVS or
> > Subclipse integration.)
> >
> > For example, the HttpComponents' HttpClient top-level project is a
> > multi-module project containing httpclient, httpclient-osgi, and
> httpmime.
> > If you add 'http://svn.apache.org/repos/asf/httpcomponents/httpclient'
> as
> > an SVN Repository, then right-click on 'trunk' and choose 'Check out as
> > Maven Project', it will create 4 projects: httpcomponents-client,
> > httpclient, httpclient-osgi, and httpmime.  It chooses the names from the
> > pom.xml files.  The first project is the top-level project and is really
> > just a 'commit space' to let you commit changes to all the modules at
> once
> > (since Eclipse doesn't do well with commiting over multiple projects).
>  The
> > other 3 are projects for each subproject, with their own dependencies.
> >
> > Similarly, if you already had the code checked out somewhere on disk (
> 'svn
> > co
> >
> http://svn.apache.org/repos/asf/httpcomponents/httpclient/trunkhttpclient'
> > ) and you choose File -> Import, General -> Maven Projects, and
> > choose the checkout location as the root directory, m2eclipse will
> > immediately list the parent pom and the module poms and give you an
> option
> > of checking/unchecking which projects you'd like to create.  If you leave
> > the default options, it creates the projects in the same way as 'Checkout
> > as Maven Project' did.
> >
> > Your workarounds are doable, but require more steps from the developer.
> > I'm hoping to make this work for an open-source project, and would like
> to
> > create as little steps as possible for new developers/users.  Requiring a
> > global setting is definitely out of the question.  If ultimately IvyDE
> can
> > integrate with CVS & SVN and add 'Checkout IvyDE Project', it would allow
> a
> > developer to use Eclipse from start-to-finish to get compiling code with
> > proper dependencies.
>
> And what about a setup in two steps ?
> Get into Eclipse from wherever your projects are, with whatever Eclipse
> nature
> (java, wtp, spring....). And then add an IvyDE container in each project,
> with
> an special UI, a UI which will "batch" the add of the containers. So there
> won't be any iterative task. This UI could also allow you to edit several
> ivyde container configurations.
> Though this UI has to be invented so it would be really ergonomic. (and to
> be
> coded :) )
>
> Nicolas
>
>
> >
> > Thanks,
> >  Sam
> >
> > 2009/3/31 Nicolas Lalevée <ni...@hibnet.org>
> >
> > > On lundi 30 mars 2009 19:34:33 Sam Berlin wrote:
> > > > Hi All,
> > > >
> > > > We have a large multi-project repository that currently uses Ivy+Ant
> > > > and works very well.  I'm looking into using IvyDE, but setting it up
> > > > for a large multi-project repository seems to be a real pain.
> > > >
> > > > An ivy.xml file exists in each project, and a shared ivysettings
> exists
> > > > under the 'common' project's directory.  I've been able to configure
> > >
> > > IvyDE
> > >
> > > > properly by using "project:///ivysettings.xml" in the common
> project's
> > > > IvyDE properties and 'project://common-project-name/ivysettings.xml'
> in
> > > > each other module's IvyDE properties.  This works, but is a real pain
> > > > to setup.
> > > >
> > > > What I'd like to do is something similar to the m2eclipse plugin,
> where
> > > > they take the parent of a multi-module pom and the plugin
> automatically
> > > > creates a project for each module.  In Ivy-land, this would be
> similar
> > > > to subant after ivy:buildlist within Ant.
> > > >
> > > > Would you be amenable to having some kind of 'Checkout as Ivy
> Project'
> > > > or 'Create Ivy Project' that scans for subdirectories containing
> > > > ivy.xml (perhaps offering options similar to buildlist) and then
> > > > automatically creating each project it finds?  The setup wizard could
> > > > ask where a
> > >
> > > shared
> > >
> > > > ivysettings is for each project and automatically fill in the
> > > > properties for each project.  Something like this would be an amazing
> > > > step in in
> > >
> > > terms
> > >
> > > > of usability of IvyDE for multi-project repositories.
> > > >
> > > > I can investigate into how m2eclipse does this and try and create
> > >
> > > something
> > >
> > > > similar for IvyDE if people think this is a feature that would be
> > >
> > > accepted.
> > >
> > > I tried to look into m2eclipse where is that feature and I didn't see
> any
> > > "import several maven project", or "create several maven project". I
> > > don't daily use maven so I may have missed something. Unless you talked
> > > about the eclipse:eclipse maven goal ?
> > >
> > > The way I managed it in our project is by using an ant target. As ant
> > > always
> > > knows where is the ivysettings for the current project, I made a target
> > > that
> > > create a .classpath for eclipse, .classpath which includes a reference
> to
> > > the
> > > IvyDE plugin. And then on the upper level, I can have a target that for
> > > each
> > > project launch that "eclipse-ivyde" target. The flaw is that the
> > > .classpath cannot be shared between developpers, but my experience
> tells
> > > me that this is
> > > generally a good idea.
> > >
> > > Another solution is to use the global settings of IvyDE. In your global
> > > preference of IvyDE, set an ivysettings to your:
> > > project://common-project-name/ivysettings.xml
> > > And then every of your sub project would be configured to use the
> > > workspace settings. The disadvantage is that it doesn't work if you
> have
> > > sevral "big project" with different ivysettings in workspace.
> > >
> > > Nicolas
>
>

Re: Multi-Project IvyDE

Posted by Nicolas Lalevée <ni...@hibnet.org>.
On mardi 31 mars 2009 14:29:19 Sam Berlin wrote:
> Hi Nicolas,
>
> Thanks for the reply.  There's no separate place to do this in m2eclipse --
> the plugin just "makes it work".  That is, if you attempt to import a Maven
> Project that has a multi-module pom, it will automatically create multiple
> projects.  (The same thing with 'Checkout as Maven Project' from CVS or
> Subclipse integration.)
>
> For example, the HttpComponents' HttpClient top-level project is a
> multi-module project containing httpclient, httpclient-osgi, and httpmime.
> If you add 'http://svn.apache.org/repos/asf/httpcomponents/httpclient' as
> an SVN Repository, then right-click on 'trunk' and choose 'Check out as
> Maven Project', it will create 4 projects: httpcomponents-client,
> httpclient, httpclient-osgi, and httpmime.  It chooses the names from the
> pom.xml files.  The first project is the top-level project and is really
> just a 'commit space' to let you commit changes to all the modules at once
> (since Eclipse doesn't do well with commiting over multiple projects).  The
> other 3 are projects for each subproject, with their own dependencies.
>
> Similarly, if you already had the code checked out somewhere on disk ( 'svn
> co
> http://svn.apache.org/repos/asf/httpcomponents/httpclient/trunkhttpclient'
> ) and you choose File -> Import, General -> Maven Projects, and
> choose the checkout location as the root directory, m2eclipse will
> immediately list the parent pom and the module poms and give you an option
> of checking/unchecking which projects you'd like to create.  If you leave
> the default options, it creates the projects in the same way as 'Checkout
> as Maven Project' did.
>
> Your workarounds are doable, but require more steps from the developer. 
> I'm hoping to make this work for an open-source project, and would like to
> create as little steps as possible for new developers/users.  Requiring a
> global setting is definitely out of the question.  If ultimately IvyDE can
> integrate with CVS & SVN and add 'Checkout IvyDE Project', it would allow a
> developer to use Eclipse from start-to-finish to get compiling code with
> proper dependencies.

And what about a setup in two steps ?
Get into Eclipse from wherever your projects are, with whatever Eclipse nature 
(java, wtp, spring....). And then add an IvyDE container in each project, with 
an special UI, a UI which will "batch" the add of the containers. So there 
won't be any iterative task. This UI could also allow you to edit several 
ivyde container configurations.
Though this UI has to be invented so it would be really ergonomic. (and to be 
coded :) )

Nicolas


>
> Thanks,
>  Sam
>
> 2009/3/31 Nicolas Lalevée <ni...@hibnet.org>
>
> > On lundi 30 mars 2009 19:34:33 Sam Berlin wrote:
> > > Hi All,
> > >
> > > We have a large multi-project repository that currently uses Ivy+Ant
> > > and works very well.  I'm looking into using IvyDE, but setting it up
> > > for a large multi-project repository seems to be a real pain.
> > >
> > > An ivy.xml file exists in each project, and a shared ivysettings exists
> > > under the 'common' project's directory.  I've been able to configure
> >
> > IvyDE
> >
> > > properly by using "project:///ivysettings.xml" in the common project's
> > > IvyDE properties and 'project://common-project-name/ivysettings.xml' in
> > > each other module's IvyDE properties.  This works, but is a real pain
> > > to setup.
> > >
> > > What I'd like to do is something similar to the m2eclipse plugin, where
> > > they take the parent of a multi-module pom and the plugin automatically
> > > creates a project for each module.  In Ivy-land, this would be similar
> > > to subant after ivy:buildlist within Ant.
> > >
> > > Would you be amenable to having some kind of 'Checkout as Ivy Project'
> > > or 'Create Ivy Project' that scans for subdirectories containing
> > > ivy.xml (perhaps offering options similar to buildlist) and then
> > > automatically creating each project it finds?  The setup wizard could
> > > ask where a
> >
> > shared
> >
> > > ivysettings is for each project and automatically fill in the
> > > properties for each project.  Something like this would be an amazing
> > > step in in
> >
> > terms
> >
> > > of usability of IvyDE for multi-project repositories.
> > >
> > > I can investigate into how m2eclipse does this and try and create
> >
> > something
> >
> > > similar for IvyDE if people think this is a feature that would be
> >
> > accepted.
> >
> > I tried to look into m2eclipse where is that feature and I didn't see any
> > "import several maven project", or "create several maven project". I
> > don't daily use maven so I may have missed something. Unless you talked
> > about the eclipse:eclipse maven goal ?
> >
> > The way I managed it in our project is by using an ant target. As ant
> > always
> > knows where is the ivysettings for the current project, I made a target
> > that
> > create a .classpath for eclipse, .classpath which includes a reference to
> > the
> > IvyDE plugin. And then on the upper level, I can have a target that for
> > each
> > project launch that "eclipse-ivyde" target. The flaw is that the
> > .classpath cannot be shared between developpers, but my experience tells
> > me that this is
> > generally a good idea.
> >
> > Another solution is to use the global settings of IvyDE. In your global
> > preference of IvyDE, set an ivysettings to your:
> > project://common-project-name/ivysettings.xml
> > And then every of your sub project would be configured to use the
> > workspace settings. The disadvantage is that it doesn't work if you have
> > sevral "big project" with different ivysettings in workspace.
> >
> > Nicolas


Re: Multi-Project IvyDE

Posted by Sam Berlin <sb...@gmail.com>.
Hi Nicolas,

Thanks for the reply.  There's no separate place to do this in m2eclipse --
the plugin just "makes it work".  That is, if you attempt to import a Maven
Project that has a multi-module pom, it will automatically create multiple
projects.  (The same thing with 'Checkout as Maven Project' from CVS or
Subclipse integration.)

For example, the HttpComponents' HttpClient top-level project is a
multi-module project containing httpclient, httpclient-osgi, and httpmime.
If you add 'http://svn.apache.org/repos/asf/httpcomponents/httpclient' as an
SVN Repository, then right-click on 'trunk' and choose 'Check out as Maven
Project', it will create 4 projects: httpcomponents-client, httpclient,
httpclient-osgi, and httpmime.  It chooses the names from the pom.xml
files.  The first project is the top-level project and is really just a
'commit space' to let you commit changes to all the modules at once (since
Eclipse doesn't do well with commiting over multiple projects).  The other 3
are projects for each subproject, with their own dependencies.

Similarly, if you already had the code checked out somewhere on disk ( 'svn
co http://svn.apache.org/repos/asf/httpcomponents/httpclient/trunkhttpclient'
) and you choose File -> Import, General -> Maven Projects, and
choose the checkout location as the root directory, m2eclipse will
immediately list the parent pom and the module poms and give you an option
of checking/unchecking which projects you'd like to create.  If you leave
the default options, it creates the projects in the same way as 'Checkout as
Maven Project' did.

Your workarounds are doable, but require more steps from the developer.  I'm
hoping to make this work for an open-source project, and would like to
create as little steps as possible for new developers/users.  Requiring a
global setting is definitely out of the question.  If ultimately IvyDE can
integrate with CVS & SVN and add 'Checkout IvyDE Project', it would allow a
developer to use Eclipse from start-to-finish to get compiling code with
proper dependencies.

Thanks,
 Sam

2009/3/31 Nicolas Lalevée <ni...@hibnet.org>

> On lundi 30 mars 2009 19:34:33 Sam Berlin wrote:
> > Hi All,
> >
> > We have a large multi-project repository that currently uses Ivy+Ant and
> > works very well.  I'm looking into using IvyDE, but setting it up for a
> > large multi-project repository seems to be a real pain.
> >
> > An ivy.xml file exists in each project, and a shared ivysettings exists
> > under the 'common' project's directory.  I've been able to configure
> IvyDE
> > properly by using "project:///ivysettings.xml" in the common project's
> > IvyDE properties and 'project://common-project-name/ivysettings.xml' in
> > each other module's IvyDE properties.  This works, but is a real pain to
> > setup.
> >
> > What I'd like to do is something similar to the m2eclipse plugin, where
> > they take the parent of a multi-module pom and the plugin automatically
> > creates a project for each module.  In Ivy-land, this would be similar to
> > subant after ivy:buildlist within Ant.
> >
> > Would you be amenable to having some kind of 'Checkout as Ivy Project' or
> > 'Create Ivy Project' that scans for subdirectories containing ivy.xml
> > (perhaps offering options similar to buildlist) and then automatically
> > creating each project it finds?  The setup wizard could ask where a
> shared
> > ivysettings is for each project and automatically fill in the properties
> > for each project.  Something like this would be an amazing step in in
> terms
> > of usability of IvyDE for multi-project repositories.
> >
> > I can investigate into how m2eclipse does this and try and create
> something
> > similar for IvyDE if people think this is a feature that would be
> accepted.
>
> I tried to look into m2eclipse where is that feature and I didn't see any
> "import several maven project", or "create several maven project". I don't
> daily use maven so I may have missed something. Unless you talked about the
> eclipse:eclipse maven goal ?
>
> The way I managed it in our project is by using an ant target. As ant
> always
> knows where is the ivysettings for the current project, I made a target
> that
> create a .classpath for eclipse, .classpath which includes a reference to
> the
> IvyDE plugin. And then on the upper level, I can have a target that for
> each
> project launch that "eclipse-ivyde" target. The flaw is that the .classpath
> cannot be shared between developpers, but my experience tells me that this
> is
> generally a good idea.
>
> Another solution is to use the global settings of IvyDE. In your global
> preference of IvyDE, set an ivysettings to your:
> project://common-project-name/ivysettings.xml
> And then every of your sub project would be configured to use the workspace
> settings. The disadvantage is that it doesn't work if you have sevral "big
> project" with different ivysettings in workspace.
>
> Nicolas
>
>

Re: Multi-Project IvyDE

Posted by Nicolas Lalevée <ni...@hibnet.org>.
On lundi 30 mars 2009 19:34:33 Sam Berlin wrote:
> Hi All,
>
> We have a large multi-project repository that currently uses Ivy+Ant and
> works very well.  I'm looking into using IvyDE, but setting it up for a
> large multi-project repository seems to be a real pain.
>
> An ivy.xml file exists in each project, and a shared ivysettings exists
> under the 'common' project's directory.  I've been able to configure IvyDE
> properly by using "project:///ivysettings.xml" in the common project's
> IvyDE properties and 'project://common-project-name/ivysettings.xml' in
> each other module's IvyDE properties.  This works, but is a real pain to
> setup.
>
> What I'd like to do is something similar to the m2eclipse plugin, where
> they take the parent of a multi-module pom and the plugin automatically
> creates a project for each module.  In Ivy-land, this would be similar to
> subant after ivy:buildlist within Ant.
>
> Would you be amenable to having some kind of 'Checkout as Ivy Project' or
> 'Create Ivy Project' that scans for subdirectories containing ivy.xml
> (perhaps offering options similar to buildlist) and then automatically
> creating each project it finds?  The setup wizard could ask where a shared
> ivysettings is for each project and automatically fill in the properties
> for each project.  Something like this would be an amazing step in in terms
> of usability of IvyDE for multi-project repositories.
>
> I can investigate into how m2eclipse does this and try and create something
> similar for IvyDE if people think this is a feature that would be accepted.

I tried to look into m2eclipse where is that feature and I didn't see any 
"import several maven project", or "create several maven project". I don't 
daily use maven so I may have missed something. Unless you talked about the 
eclipse:eclipse maven goal ?

The way I managed it in our project is by using an ant target. As ant always 
knows where is the ivysettings for the current project, I made a target that 
create a .classpath for eclipse, .classpath which includes a reference to the 
IvyDE plugin. And then on the upper level, I can have a target that for each 
project launch that "eclipse-ivyde" target. The flaw is that the .classpath 
cannot be shared between developpers, but my experience tells me that this is 
generally a good idea.

Another solution is to use the global settings of IvyDE. In your global 
preference of IvyDE, set an ivysettings to your:
project://common-project-name/ivysettings.xml
And then every of your sub project would be configured to use the workspace 
settings. The disadvantage is that it doesn't work if you have sevral "big 
project" with different ivysettings in workspace.

Nicolas