On 7/13/07, Johannes Stamminger <[EMAIL PROTECTED]>
wrote:


Hi!

On Friday 13 July 2007, Xavier Hanin wrote:
> On 7/13/07, hezjing <[EMAIL PROTECTED]> wrote:
> > Hi
> >
> > It would be very helpful if you can add examples for <exclude> in
> > http://incubator.apache.org/ivy/history/trunk/ivyfile/exclude.html
>
> Could you open a jira issue for that? And if you have examples, you can
> even provide a patch to the page, it's pretty easy to contribute
> documentation if you follow this doc:
> http://incubator.apache.org/ivy/write-doc.html

A) At least in 1.4.1 the exclusion modules does not work. Caused by using
DefaultArtifact.newIvyArtifact in IvyNode.isDependencyModuleExcluded. The
new
ivy artifact as currently being used is lateron on exclusion checking
compared with the exclude definition ... and that fails always due to the
fixed name/type "ivy" and ext "xml" of the default ivy artifact.

I patched DefaultArtifact by adding:

    public static Artifact newCheckModuleExcludeArtifact(ModuleRevisionId
mrid, Date pubDate) {
        return new DefaultArtifact(mrid, pubDate, "*", "*", "*");
    }

next to newIvyArtifact and using this method instead from
IvyNode.isDependencyModuleExcluded. SInce having done this, exclusion now
works for me (but I would appreciate very much someone wuold review my
change - I will open an issue on monday on that and attach my changes
there
in more detail).

Note 1: this affects only complete module's exclusion as defined with
<exclude module="xyz"/> within an dependency. Exclusion of artifacts seem
to
work for me


I'm surprised, I thought we had a unit test for that... Are you sure it's
not working? The exclusion rule itself should have * for artifact name and
extension, so in this case whatever the name and extension of the 'artifact'
corresponding to the module descriptor (ivy xml in this case), the exclusion
rule should match. But if you have run tests I believe you, I'll review your
patch when you'll submit it next week.

Note 2: No idea if this affects 2.0 trunk, too, as there is no stable
release
of that, yet, I did stop testing with that some time ago.


Exclusion and inclusion has changed in 2.0. If you want to test it you can
use the not yet official 2.0.0 alpha 2:
http://people.apache.org/~xavier/ivy/staging/2.0.0-alpha2-incubating/

You can even vote for this release on the ivy-dev list, we really appreciate
feedback from the community (the vote should not reflect the technical
quality though, this is only an alpha release)

B) Another pitfall on exclusion is when wanting to exclude something being
resolved by multiple dependencies: it will go only with excluding it on
*every* dependency the module is resolved with.


This is implemented in 2.0:
<dependencies>
 <dependency ... />
 <dependency ... />
 <exclude .. />
</dependencies>

Exclude rules directly under dependencies affect the whole module.

C) And finally in my very complex environment I still get exactly one
exclusion not working ... but I have to debug it down to detect the
cause ... . So there might be another bug  - but it is more probable that
I
have defined something wrong/incompleet and do not see this, yet (most
problems like that I could reveal only by debugging - outputs did not help
very much on such problems)


If when debugging you had some traces you find useful, feel free to open an
issue and attach a patch. Finding useful traces is not always easy.

D) When just talking about exclusions: I would appreciate it very much if
the
exclusions having taken place on resolve became part of the resolve
report.
But I will request this by an issue ...


I think there's already an issue for that (not sure though). Search and if
you find it, vote and comment it, it helps us know this is a more wanted
feature.

Have a nice week-end too!

Xavier

Regards and have a nice wekend,
Johannes Stamminger

This email (including any attachments) may contain confidential and/or
privileged information or information otherwise protected from disclosure.
If you are not the intended recipient, please notify the sender immediately,
do not copy this message or any attachments and do not use it for any
purpose or disclose its content to any person, but delete this message and
any attachments from your system. Astrium disclaims any and all liability if
this email transmission was virus corrupted, altered or falsified.
---------------------------------------------------------
Astrium GmbH Vorsitzender des Aufsichtsrates: Thomas Mueller -
Geschaeftsfuehrung: Evert Dudok (Vorsitzender), Dr. Reinhold Lutz, Pablo
Salame Fischer
Sitz der Gesellschaft: Muenchen - Registergericht: Amtsgericht Muenchen,
HRB Nr. 107 647




--
Xavier Hanin - Independent Java Consultant
http://xhab.blogspot.com/
http://incubator.apache.org/ivy/
http://www.xoocode.org/

Reply via email to