Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] Is it possible to add mockito as a maven dependency to a test plugin?

It is possible to add Mockito and Hamcrest as dependencies to a test plug-in. The easiest way to do it is:

  1. Create a target platform that defines your development environment [1]. Use the Orbit update site to add JUnit, Mockito and Hamcrest to the target platform.
  2. Create your test plug-in and add JUnit, Mockito and Hamcrest to its dependencies.
  3. Configure your Tycho build and ask it to rely on the target platform [2], so that JUnit, Mockito and Hamcrest are known at compile-time.
  4. Run mvn verify

Alternatively, if you want to rely on artifacts from Maven Central that are not available from an update site you can also wrap the JAR as an OSGi bundle [3] or ask Tycho to create a new OSGi bundle dynamically [4].


Le 16/08/2019 à 17:49, Steinar Bang a écrit :
Mickael Istria <mistria@xxxxxxxxxx>:
On Thursday, August 15, 2019, Steinar Bang <sb@xxxxxx> wrote:
Is it possible to add mockito and hamcrest as maven dependencies to a
test plugin project built with tycho[1]?

Use the Orbit p2 repo to get those artifacts in a p2/Tycho-friendly way:
In other words: No it isn't possible...? :-)

That's a pity, it would have simplified things a lot, if I could have
used artifacts from maven central (provided that they are OSGi bundles,
of course...).

tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit

Back to the top