Friday, 15 January 2010

java - Excluded artifact shows in dependency:tree -



java - Excluded artifact shows in dependency:tree -

my project depends on org.apache.pig:pig don't want transitive dependencies of org.mortbay.jetty:jetty , org.mortbay.jetty:servlet-api. added these 2 artifacts <excludes> doesn't seem work:

mvn dependency:tree -dincludes=org.mortbay.jetty:servlet-api [info] scanning projects... [info] searching repository plugin prefix: 'dependency'. [info] ------------------------------------------------------------------------ [info] building unnamed - mygroupp:myartifact:jar:1.0-snapshot [info] task-segment: [dependency:tree] [info] ------------------------------------------------------------------------ [info] [dependency:tree {execution: default-cli}] [info] mygroupp:myartifact:jar:1.0-snapshot [info] \- org.apache.pig:pig:jar:0.10.0:compile [info] \- org.mortbay.jetty:jetty:jar:6.1.26:compile [info] \- org.mortbay.jetty:servlet-api:jar:2.5-20081211:compile simple showcase pom.xml <?xml version="1.0" encoding="utf-8"?> <project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelversion>4.0.0</modelversion> <groupid>mygroupp</groupid> <artifactid>myartifact</artifactid> <version>1.0-snapshot</version> <packaging>jar</packaging> <dependencies> <dependency> <groupid>org.apache.pig</groupid> <artifactid>pig</artifactid> <version>0.10.0</version> <exclusions> <exclusion> <artifactid>org.mortbay.jetty</artifactid> <groupid>jetty</groupid> </exclusion> <exclusion> <artifactid>org.mortbay.jetty</artifactid> <groupid>servlet-api</groupid> </exclusion> </exclusions> </dependency> </dependencies> </project>

i've tried with: mvn --version

apache maven 2.2.1 (rdebian-8) apache maven 3.0.4 (r1232337; 2012-01-17 00:44:56-0800)

can help me exclude this?

you have artifactid , groupid element values transposed.

try these exclusions instead:

<exclusions> <exclusion> <groupid>org.mortbay.jetty</groupid> <artifactid>jetty</artifactid> </exclusion> <exclusion> <groupid>org.mortbay.jetty</groupid> <artifactid>servlet-api</artifactid> </exclusion> </exclusions>

java maven

No comments:

Post a Comment