This seems to work, but I've had to exclude a lot of dependencies in
order to trim the JARs down to what I had previous with
all-jars-in-CVS.  The one I can't seem to get rid of is
servlet-api-2.4.jar.  Is there a quick way to find out which
dependency is causing it to be included?

Many of my dependencies seem to require it. FWIW, there seems to be a
lot of trial-and-error to prevent WEB-INF/lib bloat with unnecessary
dependencies. Below is what I've come up with so far - 212 lines of
XML to replace 10MB in CVS
(https://equinox.dev.java.net/source/browse/equinox/web/WEB-INF/lib/).

Thanks,

Matt

<project>
    <modelVersion>4.0.0</modelVersion>
    <groupId>org.appfuse</groupId>
    <artifactId>equinox</artifactId>
    <packaging>war</packaging>
    <version>1.5</version>

    <dependencies>
        <dependency>
            <artifactId>cargo</artifactId>
            <groupId>cargo</groupId>
            <version>0.5</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <artifactId>ant</artifactId>
                    <groupId>ant</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>xml-apis</artifactId>
                    <groupId>xml-apis</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>xercesImpl</artifactId>
                    <groupId>xerces</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <artifactId>commons-lang</artifactId>
            <groupId>commons-lang</groupId>
            <version>2.0</version>
        </dependency>
        <dependency>
            <artifactId>displaytag</artifactId>
            <groupId>displaytag</groupId>
            <version>1.0</version>
            <scope>runtime</scope>
            <exclusions>
                <exclusion>
                    <artifactId>commons-beanutils</artifactId>
                    <groupId>commons-beanutils</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>struts</artifactId>
                    <groupId>struts</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>tools</artifactId>
                    <groupId>jdk</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>webwork</artifactId>
                    <groupId>opensymphony</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>xwork</artifactId>
                    <groupId>opensymphony</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <artifactId>hibernate</artifactId>
            <groupId>org.hibernate</groupId>
            <version>3.0.5</version>
            <scope>compile</scope>
            <exclusions>
                <exclusion>
                    <artifactId>ant</artifactId>
                    <groupId>ant</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>avalon-framework</artifactId>
                    <groupId>avalon-framework</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>concurrent</artifactId>
                    <groupId>concurrent</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>jacc</artifactId>
                    <groupId>javax.security</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>jboss-cache</artifactId>
                    <groupId>jboss</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>jboss-common</artifactId>
                    <groupId>jboss</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>jboss-j2se</artifactId>
                    <groupId>jboss</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>jboss-minimal</artifactId>
                    <groupId>jboss</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>jboss-system</artifactId>
                    <groupId>jboss</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>jta</artifactId>
                    <groupId>javax.transaction</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>logkit</artifactId>
                    <groupId>logkit</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>odmg</artifactId>
                    <groupId>odmg</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>proxool</artifactId>
                    <groupId>proxool</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <artifactId>geronimo-spec-jta</artifactId>
            <groupId>geronimo-spec</groupId>
            <version>1.0.1B-rc4</version>
        </dependency>
        <dependency>
            <artifactId>jmock</artifactId>
            <groupId>jmock</groupId>
            <version>1.0.1</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <artifactId>junit</artifactId>
                    <groupId>junit</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <artifactId>junit</artifactId>
            <groupId>junit</groupId>
            <version>3.8.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <artifactId>jwebunit</artifactId>
            <groupId>jwebunit</groupId>
            <version>1.2</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <artifactId>servletapi</artifactId>
                    <groupId>servletapi</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <artifactId>log4j</artifactId>
            <groupId>log4j</groupId>
            <version>1.2.11</version>
        </dependency>
        <dependency>
            <artifactId>postgresql</artifactId>
            <groupId>postgresql</groupId>
            <version>8.0-312.jdbc3</version>
        </dependency>
        <dependency>
            <artifactId>servlet-api</artifactId>
            <groupId>javax.servlet</groupId>
            <version>2.4</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <artifactId>sitemesh</artifactId>
            <groupId>opensymphony</groupId>
            <version>2.2.1</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <artifactId>springmodules-validator</artifactId>
            <groupId>springmodules</groupId>
            <version>0.1</version>
            <exclusions>
                <exclusion>
                    <artifactId>servlet-api</artifactId>
                    <groupId>javax.servlet</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <artifactId>spring</artifactId>
            <groupId>springframework</groupId>
            <version>1.2.5</version>
        </dependency>
        <dependency>
            <artifactId>spring-mock</artifactId>
            <groupId>springframework</groupId>
            <version>1.2.5</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <artifactId>spring-jdbc</artifactId>
                    <groupId>springframework</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>spring-web</artifactId>
                    <groupId>springframework</groupId>
                </exclusion>
            </exclusions>
        </dependency>
    </dependencies>
</project>



On 10/14/05, Brett Porter <[EMAIL PROTECTED]> wrote:
> Yes, the pom is the easiest way - otherwise we'd need to have one of
> each of the Id parameters for each scope.
>
> - Brett
>
> On 10/15/05, Matt Raible <[EMAIL PROTECTED]> wrote:
> > On 10/14/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> > > I share Matt's concern.   It'd be nice if I can do something like:
> > >
> > >     <artifact:dependencies scope="runtime"
> > > pathId="project.classpath.core" filesetId="project.classpath.fileset">
> > >         <artifact:pom file="pom.xml" />
> > >         <artifact:remoteRepository url="${project.repository}" />
> > >     </artifact:dependencies>
> > >
> >
> > You can do this:
> >
> > <artifact:dependencies useScope="runtime"...
> >
> > What I'm trying to avoid was having <artifact:dependencies> 3 times in
> > my build.xml file - mainly b/c I want to specify the dependencies
> > inline.  I'm fine with using a pom like you do - I just wanted to make
> > sure that this was the easiest way to do this.
> >
> > Matt
> >
> > > There's no way to make dependencies accept a paramter as a filter akin
> > > to syslog's levle scheme?  Test meaning everything, compile meaning a
> > > base set and runtime just a small set?  Cue people to chime in w/
> > > counter examples if they exist.
> > >
> > > Dave Brondsema wrote:
> > >
> > > >Matt Raible wrote:
> > > >
> > > >
> > > >>I'm just starting to play around with Maven 2's Ant tasks.  While I
> > > >>like the transitive dependencies, it seems like I have to exclude more
> > > >>than I'd normally include. ;-)
> > > >>
> > > >>Onto my question - is it possible to declare a single
> > > >><artifact:dependencies>, set the scopes appropriately and then
> > > >>copy/include only the compile+runtime JARS in WEB-INF/lib?  As far as
> > > >>I can tell this is not possible - unless you declare dependencies in a
> > > >>pom.xml and use different <artifact:dependencies> for compile, test
> > > >>and runtime.
> > > >>
> > > >>
> > > >>
> > > >
> > > >What's wrong with that?  It's good to seperate concerns of {project
> > > >dependency info} with {project build functionality}.  In my case it's
> > > >necessary because we use Ant imports to achieve a generic ant build tool
> > > >(same functionality everywhere) with configuration files, like pom.xml,
> > > >for each project (different dependencies for each project).
> > > >
> > > >
> > > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to