users@jersey.java.net

Re: [Jersey] Mavenizing Jersey - first steps done - contribs and helloworld samples

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Mon, 26 May 2008 09:43:03 +0200

Hi Martin,

This looks really good. I agree with merging back to the trunk sooner
rather than later. In the interim period we just need to make sure we
can produce the same bits directly using ant [*] (i am currently
depending on the NB ant project for development).

Re: the use of PackagesResourceConfig. I thought this would be the
case :-) I wonder if there is anything we could do with respect to
maven to simply the configuration, e.g. a Jersey maven plugin that
executes using say the Grizzly container?

Paul.

[*] BTW when i run the spring-contrib unit tests on the command line
things work fine, but when i run them in NBs some fail, i have no
idea why...


On May 25, 2008, at 5:45 PM, Martin Grotzke wrote:

> Hi,
>
> the first steps of mavenising jersey are done: I created a new branch
> [1] and changed the main project structure:
> |-- jersey
> |-- repo
> `-- www
>
> The jersey folder represents the parent jersey project that
> contains the
> modules "contrib", "jersey" and "samples". One can invoke `mvn
> install`
> to build and install the whole project with all modules.
>
> The directory structure and maven groupId/artifactId below trunk/
> jersey
> looks like this:
>
> |-- contribs
> | |-- pom.xml (groupId=com.sun.jersey, artifactId=jersey-contribs)
> | `-- spring
> | |-- pom.xml (groupId=com.sun.jersey, artifactId=jersey-spring)
> |-- jersey
> | |-- maven
> | | |-- pom.xml (groupId=com.sun.jersey, artifactId=jersey)
> |-- pom.xml (groupId=com.sun.jersey, artifactId=jersey-project)
> `-- samples
> |-- helloworld
> | |-- pom.xml (groupId=com.sun.jersey.samples,
> artifactId=helloworld)
> |-- helloworld-webapp
> | |-- pom.xml (groupId=com.sun.jersey.samples,
> artifactId=helloworld-webapp)
> `-- pom.xml (groupId=com.sun.jersey.samples, artifactId=jersey-
> samples)
>
> The jersey-project pom.xml is not really complete, information like
> scm,
> reporting, distributionManagement etc. is still missing.
>
> I decided not to rename jersey to modules, IMHO this should be done
> when
> jersey is split into several modules.
>
> The helloworld sample is the example taken from
> jersey/examples/HelloWorld, I only copied java classes and
> README.html.
> For beeing able to the helloworld Main class with the exec-maven-
> plugin
> I had to change Main.java to create an HttpHandler with an appropriate
> PackagesResourceConfig.
> The helloworld app now can be run via `mvn compile exec:java`, I
> updated
> README.html accordingly.
>
> The helloworld-webapp sample is the example taken from
> jersey/examples/HelloWorldWebApp, I only copied the
> HelloWorldResource.java, web.xml and README.html.
> I extended web.xml with the PackageResourceConfig.
> The helloworld-webapp can be run via `mvn jetty:run`, I updated
> README.html to reflect this change.
>
> This should be a good start to convert examples to a maven build.
>
> To keep these changes in sync with upcoming commits (for jersey)
> IMHO it
> would be the best to merge changes back into the trunk. Then all
> examples can be mavenized under samples, after that jersey/examples
> can
> be removed.
>
> Once this is finished we can start breaking up jersey into modules.
>
> What do you think?
>
> Cheers,
> Martin
>
>
> [1] https://jersey.dev.java.net/svn/jersey/branches/mavenize-jersey
>
>