简体   繁体   中英

How to setup stand alone Junit and Mockito without maven

I am working with a very old codebase where no build/library management tool such as maven or ant is used. All library is copied in the local lib directory. I found the stand-alone Junit. That I can import the library in my project. I downloaded and put it in the lib and also configure the build path in the eclipse. I can't import Mokito library in my unit test code. I don't know how do I setup mokito as a standalone library in my project. As shown in the picture below. Please let me know how can I setup this:-

在此处输入图片说明

在此处输入图片说明

Maybe an easier way to gather all depencies is to configure a maven project somewhere else (using eclipse ), then export it as runnable jar . Check the option to export all dependencies into a folder.

You will have to change the scopes, because some scopes are ignored (like test ).

Then copy the folder to your old project and import all of the jars into the classpath. You still need to check for conflicts manually.


Or you just mavenize the old codebase instead ;)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM