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.

webApp
--dataTier (provided)
----Hibernate (transitive)

We use the Jetty plugin during development.  This is set to use the test
classpath in addition to compile as so:

<!-- Jetty -->
<plugin>
  <groupId>org.mortbay.jetty</groupId>
  <artifactId>maven-jetty-plugin</artifactId>
  <version>6.1.5</version>
  <configuration>
    <scanIntervalSeconds>10</scanIntervalSeconds>
    <webXml>src/sandbox/etc/web.xml</webXml>
    <useTestClasspath>true</useTestClasspath>
    <connectors>
      <connector
        implementation="org.mortbay.jetty.nio.SelectChannelConnector">
        <port>9090</port>
        <maxIdleTime>60000</maxIdleTime>
      </connector>
    </connectors>
  </configuration>
</plugin>

When I startup Jetty it is unable to find dataTier.jar.  If I change
dataTier from provided to default everything works fine.


----- Original message -----
From: "Antonio Petrelli" <[EMAIL PROTECTED]>
To: "Maven Users List" <users@maven.apache.org>
Date: Tue, 11 Sep 2007 11:15:44 +0200
Subject: Re: Dependency scope

2007/9/11, Martin Gilday <[EMAIL PROTECTED]>:
> I have tried provided which makes sense
> in excluding it from the WAR but then it is not available to my tests.

On second thought, are you sure of what you say?
I wrote JUnit tests referring to provided-scoped libraries (like
javax.servlet.*).

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