You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by "Nimbkar, Mandar" <Ma...@patni.com> on 2009/01/09 14:48:04 UTC

How do I add all the jars in a directory in junit test exeicution classpath

Hi,

I have few junit test cases to be executed using Maven build.
My test classes require all the jars located a directory (say %JBOSS_HOME%\server\default\lib dir) in the classpath. How do I add them in the classpath.

I don't want to add them one by one using "dependency", it'd be too huge list :(

Can somebody help me with this?

Regards,
Mandar Nimbkar

Patni Computer Systems Ltd
SDF VII, Unit 20, SEEPZ, Andheri (E)
Mumbai 400096.
Tel : 91 22 28291454 x5844
Fax : 91 22 28280911
Link: 601 7141


________________________________
This e-mail message may contain proprietary, confidential or legally privileged information for the sole use of the person or entity to whom this message was originally addressed. Any review, e-transmission dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you have received this e-mail in error kindly delete this e-mail from your records. If it appears that this mail has been forwarded to you without proper authority, please notify us immediately at netadmin@patni.com and delete this mail.

RE: How do I add all the jars in a directory in junit test exeicution classpath

Posted by "Nimbkar, Mandar" <Ma...@patni.com>.
Thanks Wendy for the response.. I'll follow it in users list..

Regards,
Mandar Nimbkar

Patni Computer Systems Ltd
SDF VII, Unit 20, SEEPZ, Andheri (E)
Mumbai 400096.
Tel : 91 22 28291454 x5844
Fax : 91 22 28280911
Link: 601 7141
-----Original Message-----
From: Wendy Smoak [mailto:wsmoak@gmail.com]
Sent: Friday, January 09, 2009 8:07 PM
To: Maven Developers List
Subject: Re: How do I add all the jars in a directory in junit test exeicution classpath

On Fri, Jan 9, 2009 at 6:48 AM, Nimbkar, Mandar
<Ma...@patni.com> wrote:

> I have few junit test cases to be executed using Maven build.
...

I replied on the users list and copied you.  Please follow up on that
list instead; this one is for discussing the development of Maven
itself.  Thanks!

--
Wendy

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


This e-mail message may contain proprietary, confidential or legally privileged information for the sole use of the person or entity to whom this message was originally addressed. Any review, e-transmission dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you have received this e-mail in error kindly delete  this e-mail from your records. If it appears that this mail has been forwarded to you without proper authority, please notify us immediately at netadmin@patni.com and delete this mail.

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


Re: How do I add all the jars in a directory in junit test exeicution classpath

Posted by Wendy Smoak <ws...@gmail.com>.
On Fri, Jan 9, 2009 at 6:48 AM, Nimbkar, Mandar
<Ma...@patni.com> wrote:

> I have few junit test cases to be executed using Maven build.
...

I replied on the users list and copied you.  Please follow up on that
list instead; this one is for discussing the development of Maven
itself.  Thanks!

-- 
Wendy

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


Re: How do I add all the jars in a directory in junit test exeicution classpath

Posted by Wendy Smoak <ws...@gmail.com>.
On Wed, Jan 21, 2009 at 3:57 AM, peppinolusuraio <ua...@libero.it> wrote:

> I have created a directory
>
> %M2_REPO%/myNewGroup/myNewArtifacId/
>
> and I have copied all my jar in the lib.
> It does not work.

You need to use the install plugin to put the jars into your local repository.

mvn install:install-file -Dfile=... -DgroupId=... ...

http://maven.apache.org/plugins/maven-install-plugin/usage.html

-- 
Wendy

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


Re: How do I add all the jars in a directory in junit test exeicution classpath

Posted by peppinolusuraio <ua...@libero.it>.
I have the same problem but I'm not able to make it work.

Assume I have to add to CLASSPATH about 10 jars all coming from other
products of my society.
for the moment all this products are not built using maven, so I have to use
them in a quite "ANT" fashion adding these jars to the classpath taking them
from a /lib directory.

I have created a directory

%M2_REPO%/myNewGroup/myNewArtifacId/

and I have copied all my jar in the lib.
It does not work.
How can getiing out of this?
Do I have to recreate all a well structured directory tree with each jar in
his own artifactid subdir and respecting all the naming convention?
There is an unelegant but straightforward solution?

thanks

-- 
View this message in context: http://www.nabble.com/Re%3A-How-do-I-add-all-the-jars-in-a-directory-in-junit-test-exeicution-classpath-tp21373497p21580902.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: How do I add all the jars in a directory in junit test exeicution classpath

Posted by Wendy Smoak <ws...@gmail.com>.
[moved from dev@]

On Fri, Jan 9, 2009 at 6:48 AM, Nimbkar, Mandar
<Ma...@patni.com> wrote:

> I have few junit test cases to be executed using Maven build.
> My test classes require all the jars located a directory (say %JBOSS_HOME%\server\default\lib dir) in the classpath. How do I add them in the classpath.

You need to get them into a repository and declare them as
dependencies with test scope.

I bet you'll discover that you don't really need *all* of them, and
the exercise of figuring out what you actually depend on is a useful
one that will pay off down the road.

-- 
Wendy

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