You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Andrew Pennebaker <ap...@42six.com> on 2014/01/28 18:52:30 UTC

Can't exclude org.mortbay.jetty:servlet-api from cobertura dependency

I want to use Cobertura for code coverage, but its dependencies are
interfering with my XML parsing and Jetty serving. I'm able to resolve most
of these by using <exclusion>'s, but Maven is somehow *still* putting one
dependency in particular, jetty servlet-api, on the CLASSPATH.

pom.xml:

...
  <dependencies>
    <dependency>
      <groupId>net.sourceforge.cobertura</groupId>
      <artifactId>cobertura</artifactId>
      <version>2.0.3</version>
      <exclusions>
        <exclusion>
          <groupId>org.mortbay.jetty</groupId>
          <artifactId>servlet-api</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
  </dependencies>
...

As confirmed by `mvn dependency:tree`, cobertura is still bringing jetty's
servlet-api onto the CLASSPATH. Am I doing something wrong?

-- 
Cheers,

Andrew Pennebaker
apennebaker@42six.com

Re: Can't exclude org.mortbay.jetty:servlet-api from cobertura dependency

Posted by Andrew Pennebaker <ap...@42six.com>.
Thanks! I'll try that.

Oddly, mvn dependency:tree wasn't displaying the artifactId correctly.


On Wed, Jan 29, 2014 at 4:45 AM, Adrien Rivard <ad...@gmail.com>wrote:

> Hi,
>
> Try with <artifactId>servlet-api-2.5</artifactId>
>
> spec version is in the artifactId.
>
>
>
> On Tue, Jan 28, 2014 at 6:52 PM, Andrew Pennebaker <apennebaker@42six.com
> >wrote:
>
> > I want to use Cobertura for code coverage, but its dependencies are
> > interfering with my XML parsing and Jetty serving. I'm able to resolve
> most
> > of these by using <exclusion>'s, but Maven is somehow *still* putting one
> > dependency in particular, jetty servlet-api, on the CLASSPATH.
> >
> > pom.xml:
> >
> > ...
> >   <dependencies>
> >     <dependency>
> >       <groupId>net.sourceforge.cobertura</groupId>
> >       <artifactId>cobertura</artifactId>
> >       <version>2.0.3</version>
> >       <exclusions>
> >         <exclusion>
> >           <groupId>org.mortbay.jetty</groupId>
> >           <artifactId>servlet-api</artifactId>
> >         </exclusion>
> >       </exclusions>
> >     </dependency>
> >   </dependencies>
> > ...
> >
> > As confirmed by `mvn dependency:tree`, cobertura is still bringing
> jetty's
> > servlet-api onto the CLASSPATH. Am I doing something wrong?
> >
> > --
> > Cheers,
> >
> > Andrew Pennebaker
> > apennebaker@42six.com
> >
>
>
>
> --
> Adrien Rivard
>



-- 
Cheers,

Andrew Pennebaker
apennebaker@42six.com

Re: Can't exclude org.mortbay.jetty:servlet-api from cobertura dependency

Posted by Adrien Rivard <ad...@gmail.com>.
Hi,

Try with <artifactId>servlet-api-2.5</artifactId>

spec version is in the artifactId.



On Tue, Jan 28, 2014 at 6:52 PM, Andrew Pennebaker <ap...@42six.com>wrote:

> I want to use Cobertura for code coverage, but its dependencies are
> interfering with my XML parsing and Jetty serving. I'm able to resolve most
> of these by using <exclusion>'s, but Maven is somehow *still* putting one
> dependency in particular, jetty servlet-api, on the CLASSPATH.
>
> pom.xml:
>
> ...
>   <dependencies>
>     <dependency>
>       <groupId>net.sourceforge.cobertura</groupId>
>       <artifactId>cobertura</artifactId>
>       <version>2.0.3</version>
>       <exclusions>
>         <exclusion>
>           <groupId>org.mortbay.jetty</groupId>
>           <artifactId>servlet-api</artifactId>
>         </exclusion>
>       </exclusions>
>     </dependency>
>   </dependencies>
> ...
>
> As confirmed by `mvn dependency:tree`, cobertura is still bringing jetty's
> servlet-api onto the CLASSPATH. Am I doing something wrong?
>
> --
> Cheers,
>
> Andrew Pennebaker
> apennebaker@42six.com
>



-- 
Adrien Rivard