users@jersey.java.net

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

From: Casper Bang <casper.bang_at_gmail.com>
Date: Mon, 21 Feb 2011 11:54:22 +0100

Hello list,

After laying dormant for about a year, I got back to my Maven project using
Jersey. Rolling forward to most recent stable dependencies (i.e. Jersey 1.5)
I've run into some trouble with the unit testing parts.

I used to only rely on jersey-test-framework, but now the wiki [
http://jersey.java.net/nonav/documentation/latest/user-guide.html#d4e1298]
says it requires jersey-test-framework-grizzly. However, if I add this
dependency, my project refuses to compile due to transient dependency of
org.glassfish:javax.sevlet.jar:3.0-b66:

Missing: ---------- 1) org.glassfish:javax.servlet:jar:3.0-b66 Try
downloading the file manually from the project website. Then, install it
using the command: mvn install:install-file -DgroupId=org.glassfish
-DartifactId=javax.servlet -Dversion=3.0-b66 -Dpackaging=jar
-Dfile=/path/to/file Alternatively, if you host your own repository you can
deploy the file there: mvn deploy:deploy-file -DgroupId=org.glassfish
-DartifactId=javax.servlet -Dversion=3.0-b66 -Dpackaging=jar
-Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id] Path to dependency: 1)
com.brunata:ws-webmon:war:1.3-SNAPSHOT 2)
com.sun.jersey.jersey-test-framework:jersey-test-framework-grizzly:jar:1.5
3) com.sun.jersey.jersey-test-framework:jersey-test-framework-core:jar:1.5
4) org.glassfish:javax.servlet:jar:3.0-b66

I find it odd that 1) there should be a dependency of a
specific (glassfish) servlet implementation and 2) that the dependency can't
be found yet observed in the java.net repo[
http://download.java.net/maven/glassfish/org/glassfish/javax.servlet/3.0-b66/javax.servlet-3.0-b66.pom
].

I'm also getting an error for jersey-test-framework:

2) com.sun.jersey:jersey-test-framework:jar:1.5

  Try downloading the file manually from the project website.

  Then, install it using the command:
      mvn install:install-file -DgroupId=com.sun.jersey
-DartifactId=jersey-test-framework -Dversion=1.5 -Dpackaging=jar
-Dfile=/path/to/file

  Alternatively, if you host your own repository you can deploy the file
there:
      mvn deploy:deploy-file -DgroupId=com.sun.jersey
-DartifactId=jersey-test-framework -Dversion=1.5 -Dpackaging=jar
-Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

  Path to dependency:
   1) com.brunata:ws-webmon:war:1.3-SNAPSHOT
   2) com.sun.jersey:jersey-test-framework:jar:1.5

Since this dependency is mentioned by a wiki referenced blog entry [
http://blogs.sun.com/naresh/entry/jersey_test_framework_makes_it] and indeed
seems visible in the java.net repo [
http://download.java.net/maven/2/com/sun/jersey/jersey-test-framework/1.5/]
it seems a bit odd.

Perhaps I am missing a repository:

2 required artifacts are missing.

for artifact:
  com.brunata:ws-webmon:war:1.3-SNAPSHOT

from the specified remote repositories:
  central (http://repo1.maven.org/maven2),
  releases (http://maven.brunata.dk/releases),
  terracotta-repository (http://www.terracotta.org/download/reflector/maven2
),
  internal (http://maven.brunata.dk/internal),
  maven2-repository.dev.java.net (http://download.java.net/maven/2/),
  snapshots (http://maven.brunata.dk/snapshots),
  dist.wso2.org (http://dist.wso2.org/maven2/),
  maven-repository.dev.java.net (http://download.java.net/maven/1)

...or does something else jump in the eye? Perhaps there's an up-to-date
sample using jersey-test-* which can work as a template for porting my stuff
over. Thanks in advance for pointers. :)

/Casper