In a Bndtools workspace, I would like to add dependencies to JUnit and Mockito in a certain project
Therefore the project's bnd.bnd
file contains this -testpath
instruction:
-testpath: \
junit:junit;version=latest,\
org.mockito:mockito-core;version=latest
A 'global' bnd file in cnf/ext/repositories.bnd
denotes these repositories:
-plugin: \
aQute.bnd.repository.osgi.OSGiRepository; \
name=Bndtools Hub; \
locations=https://raw.githubusercontent.com/bndtools/bundle-hub/master/index.xml.gz; \
, \
aQute.bnd.repository.maven.pom.provider.BndPomRepository; \
releaseUrls=https://repo.maven.apache.org/maven2/; \
pom=${workspace}/cnf/maven-central.xml; \
location=cnf/cache/maven-central.xml; \
name=Maven Central;
The maven-central.xml
lists these dependencies:
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>2.6.3</version>
</dependency>
</dependencies>
The Repositories view shows both repositories. The Mockito library is even present in both repositories: v2.6 in the Maven repository and v 1.x in Bndtools Hub
The JUnit dependency can be resolved just fine, but whatever I tried, the Mockito dependency cannot be resolved:
The Repositories view decorates the unresolvable entries with an exclamation mark [!] and NullPointerException
Debugging Bndtools leads me to the conclusion that there is no local copy of the respective POM files (see bnd issue #1849). However, I am unable to figure out as to why there is no POM file.
I've also tried other libraries instead of Mockito, AssertJ for example, without a notable difference, though. Hence this seems not to be an issue with Mockito itself.
Any hints as to why Mockito cannot be resolved or how to fix this would be very welcome.