You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Wendy Smoak <ws...@gmail.com> on 2009/01/09 15:35:12 UTC

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

[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


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