1

I am building an OSGi project using Eclipse Proton with bndtools. I am having problems connecting to Maven Central or at least pulling the jar dependencies from there.

In the cnf/build.bnd, I have defined

-plugin.2.Maven:  \
aQute.bnd.repository.maven.provider.MavenBndRepository; \
    releaseUrls=https://repo1.maven.org/maven2/; \
    index=${.}/central.maven; \
    name=Maven

The index file, index=${.}/central.maven exists at cnf/central.maven, the same folder that contains the build.bnd file. (As a note I have also tried to define the index file at index=${build}/central.maven)

For my initial test, the central.maven file has one entry

log4j:log4j:1.2.17

When I save the file and click Reload in the workspace tab, the repository is shown in the lower left of Eclipse. When I open it I see...

Maven
    log4j:log4j [!]
        1.2.17 [File not found]

When I double-click the version I get a dialog showing

This repository entry is unable to be opened because it has not been downloaded. Download and open it now?

There is a Yes and No option. I click the Yes option and nothing happens.

I found this question/answer Unable to use Maven Central Repository with bnd to resolve dependencies but it did not provide a solution other than the index file is being referenced correctly.

Jim
  • 59
  • 1
  • 1
  • 6

1 Answers1

0

I believe that the source I used was incorrect. The problem is that the

-plugin.2.Maven:  \
aQute.bnd.repository.maven.provider.MavenBndRepository; \
    releaseUrls=https://repo1.maven.org/maven2/; \
    index=${.}/central.maven; \
    name=Maven

Should be

-plugin.2.Maven:  \
aQute.bnd.repository.maven.provider.MavenBndRepository; \
    releaseUrl=https://repo1.maven.org/maven2/; \
    index=${.}/central.maven; \
    name=Maven

The 's' on releaseUrl was making it invalid.

Jim
  • 59
  • 1
  • 1
  • 6