I patched the Jetty plugin to allow provided scope dependencies which
seems to solve all my duplication issues.
I've created a JIRA patch here http://jira.codehaus.org/browse/JETTY-429


----- Original message -----
From: "Martin Gilday" <[EMAIL PROTECTED]>
To: "Maven Users List" <[email protected]>
Date: Tue, 11 Sep 2007 10:53:38 +0100
Subject: Re: Dependency scope

I think in a way you did answer it, in that there probably isn't an
easier way than by profiles.  It does work it just seems to result in a
lot of duplication in my POM.  Here is a (very) cut down version of what
I mean:

<project>
  <properties>
    <version.dataTier>2.4-SNAPSHOT</version.dataTier>       
  </properties>

  <dependencies>
    <dependency>
      <groupId>mygroup</groupId>
      <artifactId>dataTier</artifactId>
      <version>${version.dataTier}</version>
      <scope>provided</scope>
    </dependency>
  </dependencies>

  <profiles>
    <profile>               
      <id>sandbox</id>

      <dependencies>
        <dependency>
          <groupId>mygroup</groupId>
          <artifactId>dataTier</artifactId>
          <version>${version.dataTier}</version>
        </dependency>
      </dependencies>
    </profile>
  </profiles>

</project>

So we run mvn -Psandbox jetty:run and everything is fine.  But as you
can see pretty much all of the dependency block is duplicated just to
remove "provided".  I think the fix is for the Jetty plugin to offer a
parameter <useProvidedScope> to complement <useTestScope>.

----- Original message -----
From: "Antonio Petrelli" <[EMAIL PROTECTED]>
To: "Maven Users List" <[email protected]>
Date: Tue, 11 Sep 2007 11:37:29 +0200
Subject: Re: Dependency scope

2007/9/11, Martin Gilday <[EMAIL PROTECTED]>:
>
> I think what you say is correct.  I think my problem is really to do
> with the Jetty plugin.  I think by saying "test" I may have misled.  My
> situation simplified is this.  dataTier has a dependency on Hibernate.
> This is a dependency of webApp.  dataTier is going to be placed in the
> app servers lib folder (Hibernate is already there as this is JBoss AS),
> as it contains a parent Spring application context which is used to
> share a single SessionFactory across a few WebApps on the server.  So
> dataTier is marked as "provided" in webApp's POM.



Now everything is clear :-)
IMHO the most elegant way to do it is by using profiles, but, again
IMHO,
the "Jetty" configuration should be the "default" profile, while the
JBoss
configuration is the "exception": just because usually all needed
libraries
are put in WEB-INF/lib, and putting in a common place is just an
exception
for your particular needs.

At the end, I think that I did not answer your question :-(
Antonio

---------------------------------------------------------------------
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