How to install powermock to eclipse

1,096 views
Skip to first unread message

gokturk mavus

unread,
Aug 4, 2014, 4:45:01 AM8/4/14
to powe...@googlegroups.com
I have already added mockito to my project class path; in addition, JUnit comes default in Eclipse. Now, I want to use powermock in my project. However, in downloaded package, I have seen;
  • cglib.nodep-2.2.2
  • javassist-3.18.2-GA
  • junit-4.11
  • mockito-all-1.9.5
  • objenesis-2.1
  • powermock-mockito-1.5.5-full
Which one should I add to my class path so that I can use Powermock in my project?

Johan Haleby

unread,
Aug 4, 2014, 4:56:55 AM8/4/14
to powe...@googlegroups.com
You must add all of them.


--
You received this message because you are subscribed to the Google Groups "PowerMock" group.
To unsubscribe from this group and stop receiving emails from it, send an email to powermock+...@googlegroups.com.
To post to this group, send email to powe...@googlegroups.com.
Visit this group at http://groups.google.com/group/powermock.
For more options, visit https://groups.google.com/d/optout.

gokturk mavus

unread,
Aug 4, 2014, 4:59:13 AM8/4/14
to powe...@googlegroups.com
Why? I have already installed Mockito and JUnit to my Eclipse.  Why do I put dublicate package to my project?

4 Ağustos 2014 Pazartesi 11:56:55 UTC+3 tarihinde Johan Haleby yazdı:

Johan Haleby

unread,
Aug 4, 2014, 5:02:16 AM8/4/14
to powe...@googlegroups.com
PowerMock are tightly coupled to specific versions of JUnit and Mockito. If you already have Mockito 1.9.5 and JUnit 4.8+ in your classpath you should be able to use those that you already have (provided that you're using the latest version of PowerMock).

/Johan

gokturk mavus

unread,
Aug 4, 2014, 5:06:10 AM8/4/14
to powe...@googlegroups.com
I have latest version of them in my project. If I add powermock-mockito-1.5.5-full to my project. Then, I will have dublicate libraries in my project. Am I right?

4 Ağustos 2014 Pazartesi 12:02:16 UTC+3 tarihinde Johan Haleby yazdı:

Johan Haleby

unread,
Aug 4, 2014, 5:13:41 AM8/4/14
to powe...@googlegroups.com
No, PowerMock consists of several different modules and powermock-mockito-1.5.5-full have aggregated all of them into one jar in order to reduce the number of dependencies when downloading the zip file manually. That's why it's called "full".

/Johan

gokturk mavus

unread,
Aug 4, 2014, 5:22:28 AM8/4/14
to powe...@googlegroups.com
As I understand, you have included all of the cglib.nodep-2.2.2,  javassist-3.18.2-GA,  junit-4.11,  mockito-all-1.9.5, and  objenesis-2.1 into powermock-mockito-1.5.5-full. Is it correct?

Then, If I add powermock-mockito-1.5.5-full to my Eclipse classpath, I will definitely have dublicate licraries in my project. One comes with Eclipse and the other is installed while ago in my project. In  powermock-mockito-1.5.5-full, you have these two also. Am I wrong?
 

Johan Haleby

unread,
Aug 4, 2014, 5:28:51 AM8/4/14
to powe...@googlegroups.com
No that is not correct. powermock-mockito-1.5.5-full consists of the following projects aggregated into a single jar: powermock-core, powermock-api-mockito, powermock-module-junit4-common, powermock-module-junit4, powermock-module-junit4-legacy, powermock-module-junit3, powermock-classloading-base. Additionally PowerMock depends of third-party libraries (the ones you mentioned in your list) that you must add in your classpath.

/Johan


On Mon, Aug 4, 2014 at 11:22 AM, gokturk mavus <goktur...@gmail.com> wrote:
As I understand, you have included all of the cglib.nodep-2.2.2,  javassist-3.18.2-GA,  junit-4.11,  mockito-all-1.9.5, and  objenesis-2.1 into powermock-mockito-1.5.5-full. Is it correct?

Then, If I add powermock-mockito-1.5.5-full to my Eclipse classpath, I will definitely have dublicate licraries in my project. One comes with Eclipse and the other is installed while ago in my project. In  powermock-mockito-1.5.5-full, you have these two also. Am I wrong?
 

--

gokturk mavus

unread,
Aug 4, 2014, 5:31:48 AM8/4/14
to powe...@googlegroups.com
Thanks for kindness and replay.
Reply all
Reply to author
Forward
0 new messages