IT's probably because they are run in VM. Try enabling forking in the
surefire plugin and both should work.

- Brett

On 2/16/06, Tim Davies <[EMAIL PROTECTED]> wrote:
> Interesting point Brett. This particular set of code runs outside of any
> containers and so Ive been using
> "System.setProperty("jdbc.drivers","com.mysql.jdbc.Driver");".
>
> This morning I tried using an explicit,
> "Class.forName("com.mysql.jdbc.Driver").newInstance();", and this works.
>
> To be honest since this is just for my unit testing I can live with this
> as a workaround. I can only assume that something in maven is resetting
> this property although this seems pretty odd.
>
>
> Brett Porter wrote:
> > Runtime should work. How are you using the driver? Class.forName /
> > driver manager, some pooling toolkit, thrugh hibernate or some other
> > library?
> >
> > - Brett
> >
> > On 2/16/06, Tim Davies <[EMAIL PROTECTED]> wrote:
> >
> >> Tried with compile, provided, test and runtime but no joy.
> >>
> >> I even read on one site the jdbc driver scenario being used as an
> >> example of when to use the runtime scope.
> >>
> >> Has anyone had this working?
> >>
> >> Krishnan A S wrote:
> >>
> >>> Try with compile option or test option :)
> >>>
> >>>
> >>> Thanks & Regards,
> >>> A.S.KRISHNAN,
> >>> AZTEC, BANGALORE.
> >>>
> >>> -----Original Message-----
> >>> From: Tim Davies [mailto:[EMAIL PROTECTED]
> >>>
> >>> Sent: Wednesday, February 15, 2006 6:17 PM
> >>> To: users@maven.apache.org
> >>> Subject: [M2] Runtime dependencies not being found
> >>>
> >>> Hi,
> >>>
> >>> Ive got a set of classes that access databases and so need a jdbc driver
> >>>
> >>> on the classpath.
> >>>
> >>> Ive written a set of junit tests for these classes which obviously need
> >>>
> >>> access to these drivers.
> >>>
> >>> I can run the junit tests fine from eclipse but when I try to run them
> >>>
> >>> with maven they fail because the driver cannot be found.
> >>>
> >>> I have the jdbc driver jar in my pom with scope set to runtime.
> >>>
> >>> Has anyone else had this problem or have any advice? Its going to be
> >>>
> >>> pretty frustrating if I cant run these tests with maven.
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>> For additional commands, e-mail: [EMAIL PROTECTED]
> >>>
> >>>
> >>>
> >>>
> >>> **********************************************************
> >>>
> >>> The information contained in, or attached to, this e-mail, contains 
> >>> confidential information and is intended solely for the use of the 
> >>> individual or entity to whom they are addressed and is subject to legal 
> >>> privilege. If you have received this e-mail in error you should notify 
> >>> the sender immediately by reply e-mail, delete the message from your 
> >>> system and notify your system manager. Please do not copy it for any 
> >>> purpose, or disclose its contents to any other person. The views or 
> >>> opinions presented in this e-mail are solely those of the author and do 
> >>> not necessarily represent those of the company. The recipient should 
> >>> check this e-mail and any attachments for the presence of viruses. The 
> >>> company accepts no liability for any damage caused, directly or 
> >>> indirectly, by any virus transmitted in this email
> >>>
> >>> ************************************************************
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>> For additional commands, e-mail: [EMAIL PROTECTED]
> >>>
> >>>
> >>>
> >> --
> >> Tim Davies
> >> Analyst Developer
> >>
> >> KTS PLC: Service you can bank on
> >> 8th Floor, Finsbury Tower,
> >> 103-105 Bunhill Row,
> >> London  EC1Y 8LZ
> >> tel: +44 (0)20 7256 2300
> >> fax: +44 (0)20 7256 2301
> >>
> >> email: [EMAIL PROTECTED]
> >> web: http://www.ktsplc.com
> >>
> >>
> >> ---------------------------------------------------------------------
> >> 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]
> >
> >
>
> --
> Tim Davies
> Analyst Developer
>
> KTS PLC: Service you can bank on
> 8th Floor, Finsbury Tower,
> 103-105 Bunhill Row,
> London  EC1Y 8LZ
> tel: +44 (0)20 7256 2300
> fax: +44 (0)20 7256 2301
>
> email: [EMAIL PROTECTED]
> web: http://www.ktsplc.com
>
>
> ---------------------------------------------------------------------
> 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