[ 
https://jira.codehaus.org/browse/MNG-1977?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=277793#comment-277793
 ] 

Jean-Noel Rouvignac commented on MNG-1977:
------------------------------------------

@Arnaud Sorry, I went for the easiest to implement. If you do not like it this 
way, fair enough, we can do it otherwise. I originally started with such change 
to the pom.xml:
<project>
    <dependencies>
        <exclusions>
            <exclusion>
                <groupId>com.mycompany</groupId>
                <artifactId>myproject</artifactId>
                <classifier>optional</classifier>
            </exclusion>
        </exclusions>
        <dependency>
            ...
        </dependency>
        ...
    </dependencies>
    ...
</project>

No I did not test with older versions of maven.
I saw that maven-3 has got some validation mechanism for the scope so I think 
it would reject it.
For maven-2 I need to check. Indeed the following scenario would be 
catastrophic:
"And when a maven version ignores it, what does it do ? It uses the compile 
scope ? #fail in that case, instead of excluding it, you explicitely add it 
(transitively)".
I will test both of these and let you know.

Same, it does not really matter to me which mechanism you prefer to use. Just 
tell me how you want it to look in the pom.xml and I can have a look at doing 
it.

Jean-Noel

> Global dependency exclusions
> ----------------------------
>
>                 Key: MNG-1977
>                 URL: https://jira.codehaus.org/browse/MNG-1977
>             Project: Maven 2 & 3
>          Issue Type: New Feature
>          Components: POM
>            Reporter: Kees de Kooter
>             Fix For: 3.1
>
>         Attachments: global_excls_it-test_v2.patch, 
> global_excls_maven3_v2.patch
>
>
> I depend on some libraries, which in turn depend on something
> (which in turn depend on something) that I don't want, because I declare
> some other artifact in my pom.xml.
> A concrete example: I don't want that the artifact "xerces" is imported in
> my project because I declare to depend on  "xercesImpl" which ships newer
> libraries but with the same namespaces.
> I guess I would need an "exclude transitive dependency at all", either
> globally or from this and that artifact. I saw the <exclusions> tag, but it
> forces me to be very verbose and have exact control on what is required by a
> dependency.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to