With Eclipse Oxygen.2 Release (4.7.2), I'm trying to use bndtools to make some OSGi bundles.
By default (with the JPM repository) I am able to resolve dependencies fine. But I have no way of seeing what libraries are there. Because of this, I'd like to use Maven Central to handle my dependencies. I can browse the website, see what versions are there, and make choices on that information.
The default build.bnd
file in the cnf
project has the repositories setup like
# Configure Repositories
-plugin.1.Central: \
aQute.bnd.deployer.repository.wrapper.Plugin; \
location = "${build}/cache/wrapper"; \
reindex = true, \
aQute.bnd.jpm.Repository; \
includeStaged = true; \
name = Central; \
location = ~/.bnd/shacache; \
index = ${build}/central.json
-plugin.2.Local: \
aQute.bnd.deployer.repository.LocalIndexedRepo; \
name = Local; \
pretty = true; \
local = ${build}/local
-plugin.3.Templates: \
aQute.bnd.deployer.repository.LocalIndexedRepo; \
name = Templates; \
pretty = true; \
local = ${build}/templates
-plugin.4.Release: \
aQute.bnd.deployer.repository.LocalIndexedRepo; \
name = Release; \
pretty = true; \
local = ${build}/release
Following the instructions on the bnd website I added the following to my file; because there was already a Central
repository, I named this one Maven
but the rest is the same
-plugin.5.Maven = \
aQute.bnd.repository.maven.provider.MavenBndRepository; \
releaseUrl=https://repo.maven.apache.org/maven2/; \
index="${.}/central.maven"; \
name="Maven"
When I remove the JPM repository, suddenly everything is broken. This didn't come as too much of a surprise, because I did just remove a repository. However, I thought that after building and cleaning the workspace, it would resolve that we can access maven central, and it would pull from there. This was not the case.
I noticed that there was an index
property on the Maven repository, so I thought that perhaps I had to add all of my dependency names to the file specified, but I haven't been able to find any documentation on what the file looks like, or how to create one, or anything of the sort.
The errors that I get in Eclipse are
Cannot find /error/org.apache.servicemix.bundles.junit;version=4.12 Not found in [bnd-cache [PATH\TO\WORKSPACE\cnf\cache\3.5.0\bnd-cache r/w=false], Local, Templates, Release, MavenBndRepository [localRepo=PATH\TO\USER\FOLDER.m2\repository, storage=Maven, inited=true]]
Is there something I'm missing in this whole process? Is there something obvious I've missed?