You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Jason Porter <Ja...@octanner.com> on 2007/12/07 20:12:16 UTC

Dependency question

Is there a way to specify a dependency to be available for compilation
and test running, but not have it packaged up?  

We have a situation where some older code that has been converted to
maven2 uses a library (SAP JCo if anyone is familiar with it) that must
be there to compile and also to run.  Some of the tests were written to
communicate with SAP, which requires the jar to be in the classpath at
runtime.  When the application is deployed the jar is provided via the
container, so we need it available to run the tests, but don't want it
packaged up with the application.

Jason Porter
O.C. Tanner
Information Services
Technical Specialist 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Dependency question

Posted by nicolas de loof <ni...@gmail.com>.
As you said "When the application is deployed the jar is provided via the
container". So simply try the "provided" scope !

provided dependencies are commonly used for java API (servlet, jta ...) taht
are part of the JEE server runtime BUT required to compile and test.

Nico.


2007/12/7, Jason Porter <Ja...@octanner.com>:
>
> Is there a way to specify a dependency to be available for compilation
> and test running, but not have it packaged up?
>
> We have a situation where some older code that has been converted to
> maven2 uses a library (SAP JCo if anyone is familiar with it) that must
> be there to compile and also to run.  Some of the tests were written to
> communicate with SAP, which requires the jar to be in the classpath at
> runtime.  When the application is deployed the jar is provided via the
> container, so we need it available to run the tests, but don't want it
> packaged up with the application.
>
> Jason Porter
> O.C. Tanner
> Information Services
> Technical Specialist
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

RE: Dependency question

Posted by "Brewster, Richard" <ri...@pqa.com>.
Declare the dependency as test scope:

        <dependency>
            <groupId>${jdbc.groupId}</groupId>
            <artifactId>${jdbc.artifactId}</artifactId>
            <version>${jdbc.version}</version>
            <scope>test</scope> 
        </dependency>

Richard Brewster
Senior Associate
Perrin Quarles Associates
richardbrewster@pqa.com
(434) 817-2640


-----Original Message-----
From: Jason Porter [mailto:Jason.Porter@octanner.com] 
Sent: Friday, December 07, 2007 2:12 PM
To: users@maven.apache.org
Subject: Dependency question

Is there a way to specify a dependency to be available for compilation
and test running, but not have it packaged up?  

We have a situation where some older code that has been converted to
maven2 uses a library (SAP JCo if anyone is familiar with it) that must
be there to compile and also to run.  Some of the tests were written to
communicate with SAP, which requires the jar to be in the classpath at
runtime.  When the application is deployed the jar is provided via the
container, so we need it available to run the tests, but don't want it
packaged up with the application.

Jason Porter
O.C. Tanner
Information Services
Technical Specialist 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org