GayaBalan / ivybeans

Automatically exported from code.google.com/p/ivybeans
0 stars 0 forks source link

Does Ivybeans Pay Attention to excludes on dependencies? #19

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Environment : ivybeans 1.1 M1, netbeans 6.5 RC2 , Windows XP , jdk 1.6

Description :

I've been trying to add excludes to an ivy.xml file for one of my projects.
For example:

<dependency org="***" name="***" rev="1.0+" conf="*" >
    <exclude org="commons-collections" module="commons-collections" />
    <exclude org="commons-dbcp" module="commons-dbcp" />
    <exclude org="commons-pool" module="commons-pool" />
</dependency>

I starred out the org and name of our homegrown jar. Unimportant. However,
it has several apache,commons jars that it depends on that the Project I am
trying to build does not need. I've tried adding exclude to the
dependencies as shown above. (Our ivy repo mirrors maven, where the org and
module is the same for these jars.)

It's not impossible that I'm doing something wrong here, but for some
reason even when defining these excludes, ivybeans still ends up fetching
the jars. Do you happen to know if the exclude tag is supported by ivybeans
yet?

Original issue reported on code.google.com by droozenr...@gmail.com on 14 Nov 2008 at 6:43

GoogleCodeExporter commented 9 years ago
Ivybeans use ivy resolve results to add or exclude dependencies . It is 
probably then
more an ivy issue than an ivybena issue.

I propose you to add a discussion in the new discussion group :
usr-ivybeans@googlegroups.com

regards

Original comment by laurent....@gmail.com on 16 Nov 2008 at 1:34

GoogleCodeExporter commented 9 years ago

Original comment by laurent....@gmail.com on 16 Nov 2008 at 7:50

GoogleCodeExporter commented 9 years ago
For anyone else interested, I figured out how to make excludes work with this 
plugin.

I'm not sure if the plugin is using an older version of Ivy, or whatever other 
fluke
is going on, but the ivy documentation that I had read said that I could add 
excludes
as so:

<dependency  ---your dependency--->
   <exclude org="--exclude org--" module="--exclude module--" />
</dependency>

However, no form of having the exclude between the dependency tags could get 
Netbeans
to exclude that jar. I discovered, by right-clicking one of the libraries under 
Ivy
Libraries that I wanted to exclude, I could select to Remove Library. Then, my 
ivy
file ended up looking like:

<dependency ---your dependency--- />
<dependency ---all dependencies like this--- />
<exclude --exclude info-- />
<exclude --excludes listed separately at end of dependency />

Ivy says I should be able to set my ivy file up like I had it above in my first
example, but the second example works. Just FYI in case anyone else was having
troubles with this, as well.

Original comment by droozenr...@gmail.com on 5 Dec 2008 at 6:10

GoogleCodeExporter commented 9 years ago
It is definitely more an ivy issue than an ivybeans one.
AFAIK, if you use exclude a lib outside a <dependency> declaration you tell Ivy 
to 
definitely exclude this lib even if you find it in another dependency.  
Contrarily if you exclude a lib in a dependency you tell Ivy to exclude this 
and only 
this transitive dependency. You can get this lib from another dependency.

Original comment by laurent....@gmail.com on 5 Dec 2008 at 11:00

GoogleCodeExporter commented 9 years ago

Original comment by laurent....@gmail.com on 5 Dec 2008 at 11:01

GoogleCodeExporter commented 9 years ago
Yeah, that makes sense. However, if I exclude a lib inside a dependency 
declaration,
ivybeans does not exclude it, even from that dependency, at least from my tests.

As far as I'm concerned at the moment, this is fine. I was just adding a little 
more
documentation for whoever else might come across this.

Original comment by droozenr...@gmail.com on 7 Dec 2008 at 2:47