users@grizzly.java.net

Re: Confusion on maven packaging/dependencies

From: Jonathan Gold <jgold.bg_at_gmail.com>
Date: Wed, 18 Nov 2009 11:22:06 -0800

Hubert --

Thanks for that. That's what I was suspecting, but I was surprised to see that
declaring a dependency on only the bundle results in maven pulling -- and
thinking it needs -- the redundant jars which are actually subsumed in the
bundle.

Is this perhaps a bug in the pom for the grizzly-webserver artifact?

I notice that in the pomfile grizzly-webserver-1.9.18-e.pom, there are these
dependencies:

    <dependencies>
        <dependency>
            <groupId>com.sun.grizzly</groupId>
            <artifactId>grizzly-cometd</artifactId>
            <version>${grizzly-version}</version>
        </dependency>
        <dependency>
            <groupId>com.sun.grizzly</groupId>
            <artifactId>grizzly-http-servlet</artifactId>
            <version>${grizzly-version}</version>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>${servlet-version}</version>
        </dependency>
    </dependencies>

Is it possible that they could be the cause of the redundancy?

jon

On Tue, Nov 17, 2009 at 10:07:36PM +0100, Hubert Iwaniuk wrote:
> Hi Jon,
>
> That is because grizzly-webserver is a bundle package that means that is has
> packaged all it's dependencies within.
> So it should be enough to add only grizzly-webserver into classpath to get
> everything you need from grizzly :)
>
> HTH,
> Hubert.
>
>
> On Tue, Nov 17, 2009 at 6:49 PM, Jonathan Gold <jgold.bg_at_gmail.com> wrote:
>
> > Hi --
> >
> > I've searched through the users@ and dev@ lists, but couldn't seem to find
> > any
> > answers, so here goes.
> >
> > I'm building an application that uses the GrizzlyWebServer class to embed
> > grizzly, and using maven for the project. Before maven, I used
> > grizzly-webserver-1.9.18-e.jar, so I figured that's what I should stick
> > with in
> > the maven version, putting this in my pom:
> >
> > <dependency>
> > <groupId>com.sun.grizzly</groupId>
> > <artifactId>grizzly-webserver</artifactId>
> > <version>1.9.18-e</version>
> > </dependency>
> >
> > using the dev.java.net repo. Everything compiles and works fine, but what
> > I'm
> > noticing is that the classpath that maven assembles (via maven's dependency
> > plugin dependency:build-classpath) includes the webserver jar
> > as well as redundant jars:
> >
> >
> > .../.m2/repository/com/sun/grizzly/grizzly-comet/1.9.18-e/grizzly-comet-1.9.18-e.jar
> >
> > .../.m2/repository/com/sun/grizzly/grizzly-cometd/1.9.18-e/grizzly-cometd-1.9.18-e.jar
> >
> > .../.m2/repository/com/sun/grizzly/grizzly-framework/1.9.18-e/grizzly-framework-1.9.18-e.jar
> >
> > .../.m2/repository/com/sun/grizzly/grizzly-http/1.9.18-e/grizzly-http-1.9.18-e.jar
> >
> > .../.m2/repository/com/sun/grizzly/grizzly-http-servlet/1.9.18-e/grizzly-http-servlet-1.9.18-e.jar
> >
> > .../.m2/repository/com/sun/grizzly/grizzly-portunif/1.9.18-e/grizzly-portunif-1.9.18-e.jar
> >
> > .../.m2/repository/com/sun/grizzly/grizzly-rcm/1.9.18-e/grizzly-rcm-1.9.18-e.jar
> >
> > .../.m2/repository/com/sun/grizzly/grizzly-utils/1.9.18-e/grizzly-utils-1.9.18-e.jar
> >
> > .../.m2/repository/com/sun/grizzly/grizzly-webserver/1.9.18-e/grizzly-webserver-1.9.18-e.jar
> > .../.m2/repository/javax/servlet/servlet-api/2.5/servlet-api-2.5.jar
> >
> > Am I doing something wrong here? I realize the duplicate jars are okay
> > since no
> > matter which jar a class is loaded from, it's coming from the same grizzly
> > build. Still, it makes me uncomfortable having duplication, so wonder if
> > some
> > experienced maven or grizzly peeps can give me some input?
> >
> > jon
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
> > For additional commands, e-mail: users-help_at_grizzly.dev.java.net
> >
> >