users@jersey.java.net

[Jersey] Re: Problem with Maven and jersey-test-*

From: Casper Bang <casper.bang_at_gmail.com>
Date: Wed, 23 Feb 2011 15:36:40 +0100

>
> this is weird.. see
> http://download.java.net/maven/glassfish/org/glassfish/javax.servlet/3.0-b66/
>
> are you sure that you are not somehow excluding/ignoring glassfish maven
> repo? You might want try to add it to your pom file:
>
> <repository>
> <id>glassfish.dev.java.net</id>
> <url>http://download.java.net/maven/glassfish</url>
> <layout>default</layout>
> </repository>
>
> it could help..
>

It did! Thanks, I have no idea where in the Maven chain there's a weak link
(I suspect ehcache-web and my explicit terracotta-repository) but this fixed
it.


> You don't need json dependencies, they are already introduced by
> jersey-json module.
>

Indeed, thanks!


> Same applies to javax.servlet (introduced by jersey-server).
>

Well except, I inject javax.servlet.ServletContext into many of my resources
and this type can not be resolved without an explicit dependency of
javax.servlet.servlet-api. But this seems remotely connected to my previous
problem (resolving org.glassfish.*). I noticed jersey-server pulls in what
looks like a glassfish specific variation of the servlet specification:

        <dependency>
            <groupId>org.glassfish</groupId>
            <artifactId>javax.servlet</artifactId>
            <version>3.0</version>
            <scope>provided</scope>
        </dependency>

I am not sure I understand this, considering what the EE specification [
http://download.oracle.com/javaee/6/api/javax/servlet/package-summary.html].
Why
this apparent duality/inconsistency? Has one superseded/deprecated the other
or is it an API/SPI hybrid thing?

I might be able to help you better if you can share that project and way how
> you are executing your tests. You can send it directly to me if you don't
> want/can't share it publicly.
>

That's very kind, but thanks to your help my tests now run again. I think it
was that pesky inability to resolve org.glassfish.* in the maven dependency
chain that caused most of my trouble.

Kind regards,
Casper