2

I am working with Bndtools in Eclipse. I am trying to add Apache Thrift as dependency to a project. My build.bnd has this code for adding the Maven Central as well as our Nexus repository:

-plugin.5.Nexus = \
    aQute.bnd.repository.maven.pom.provider.BndPomRepository; \
        releaseUrls=https://<NEXUS_URL>:8081/content/groups/public/    ; \
        snapshotUrls=https://<NEXUS_URL>:8081/content/groups/public/    ; \
        index=${.}/release.maven; \
        pom = ${workspace}/cnf/maven-nexus.xml; \
        name="Nexus"

-plugin.6.MavenCentral: \
    aQute.bnd.repository.maven.pom.provider.BndPomRepository; \
        releaseUrls = https://repo1.maven.org/maven2/; \
        pom = ${workspace}/cnf/maven-central.xml; \
        name = Maven Central

I tried to add the dependency to both xml files like this:

<dependency>
    <groupId>org.apache.thrift</groupId>
    <artifactId>libthrift</artifactId>
    <version>0.10.0</version>
</dependency>

Other dependencies like Gson work just fine. The bnd.bnd file of the project where I want to use Thrift only has this content:

-buildpath: \
    org.apache.thrift

I also tried org.apache.libthrift, but I found out that this should be the correct OSGi bundle name. I always get

Cannot find /error/org.apache.thrift;version=0 Not found

Am I missing something here? I am new to OSGi and so I might miss something really obvious. I am also not sure if my configurations of the repositories are correct. Still, other dependencies work just fine. Thanks for any advice!

EDIT: Maybe as additional information: In Eclipse the build.bnd file is shown empty in the GUI view. Does this mean, that my project is somehow corrupted or is this normal? Eclipse build.bnd GUI

EDIT2: For testing (didn't help) I also added the Maven Central using the MavenBndRepository Plugin additionally to the BndPomRepository:

-plugin.7.MavenCentralAlternative = \
    aQute.bnd.repository.maven.provider.MavenBndRepository; \
        releaseUrl=https://repo.maven.apache.org/maven2/; \
        index=${.}/central.maven; \
        name="Maven Central Alternative"

EDIT3: The problem has to be Thrift related. All other packages work just fine, only Thrift is not found. My current workaround is to add the Thrift jar to the project manually and reference its dependencies as OSGi bundle just like I tried to add Thrift in the first place. Obviously I get now this warning:

Bndtools: The .classpath contains a library that will not be available during continuous integration

mapf
  • 496
  • 1
  • 5
  • 21
  • Did you 'kick' the build.bnd file? Just modify the file with a space and save. Sometimes bndtools needs a kick to pickup the changes. – Peter Kriens Aug 25 '17 at 13:32
  • Yes, I tried that with the build.bnd as well as with the bnd.bnd files. I also tried to refresh the repositories multiple times. Once I also closed Eclipse, deleted the cache folders in ".bnd/" and started it again. – mapf Aug 25 '17 at 13:36
  • and libthrift is in your nexus? (you could try using central to test the rest) – Peter Kriens Aug 25 '17 at 14:28
  • At first it was not. At first I tried to get it using my specification of the Maven Central. Does it not work this way, that if it does not find it on the Nexus it uses the Central automatically? Anyways, for testing I also added it to the Nexus but this did not change anything unfortunately. – mapf Aug 25 '17 at 14:50
  • Anything in the Eclipse error view? – Peter Kriens Aug 27 '17 at 08:25
  • In the following the complete error message, I also tried to run Eclipse in debug mode without any outcome: Cannot find /error/org.apache.thrift;version=0 Not found in [bnd-cache [/Users/user/workspace/cnf/cache/3.4.0/bnd-cache r/w=false], JpmRepository [writable=false, name=Central, location=~/.bnd/shacache, digest=21A78DF2D931CE525D1242CADAFD233F00AF0CFF], Local, Templates, Release, Nexus, Maven Central, MavenBndRepository [localRepo=/Users/user/.m2/repository, storage=Maven Central Alternative, inited=true]] bnd.bnd /de.example.idl line 1 Bndtools Path Problem Marker – mapf Aug 28 '17 at 07:04

0 Answers0