Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipse-dev] Still stuck with no progress trying to replace "hard-stored" jars with generated bundle

Just about two weeks ago now I discovered a problem with an Eclipse plugin codebase that I inherited, being that one plugin module was storing a small number of third-party jars directly in the module. I realized quickly that I had to replace this with declarative dependencies.

Since that time, I've posted questions about this problem on eclipse-dev, tycho-user, the Eclipse platform forum, and the #eclipse IRC channel. From these queries, I've received a small number of responses, mostly talking about the idea of using the "maven-bundle-plugin" to produce a bundle from the declared Maven dependencies. Despite that, half of the responses I've gotten about this admitted that they've never gotten this to work when they had attempted this. Some of the responses referred to strategies using "mvn dependencies", or some variation, but I believe that only addresses building the bundle, not referencing it from the "core" module. As far as I can tell, what I've done so far is producing a valid bundle, I just can't get the referencing module to find it.

I've reported the problems I've been hitting, particularly on this list, but I'm going to try again, because I still don't have a solution. You might think this is more appropriate on "tycho-user", but I've already tried again there.

The main project has several modules, consisting of a handful of plugins, two features, a target platform, and an update site. The "core" plugin module (not its full name) is the one that had the "lib" folder with a handful of jars.

What I've done so far is define a new "maventhirdparty" plugin module, that declares Maven dependencies for the third-party jars formerly in the "core" module, and uses the "maven-bundle-plugin" to produce a bundle. I added the "maventhirdparty" bundle to the "Require-Bundle" list in the manifest for the "core" module. I would have thought that that would be all that is required. However, when I run the build in the "core" module, I see the following output:
[INFO] Resolving dependencies of MavenProject: @ /home/opnfv/git/yangide/plugins/ [INFO] {osgi.os=linux,, org.eclipse.update.install.features=true, osgi.arch=x86}
[ERROR] Cannot resolve project dependencies:
[ERROR]   Software being installed: 1.1.1.qualifier
[ERROR] Missing requirement: 1.1.1.qualifier requires 'bundle 1.1.1' but it could not be found

I would REALLY like to understand how to add more verbosity to this, so I can understand where this is looking, if it couldn't find this bundle. Perhaps that verbosity will make it obvious to me what the problem is, but I'm not aware of any way to make this give me more information.

The following is an excerpt from the "maventhirdparty" pom:


              antlr4-runtime, mapdb, yang-model-api, yang-parser-impl
<Export-Package>org.opendaylight.yangtools.*, org.antlr.*, org.mapdb.*</Export-Package>

I also inspected the jar and manifest produced by the "maventhirdparty" build, which is installed in my local .m2 repo. Here's an excerpt of the manifest, with some of the longer values elided, if I felt they likely wouldn't provide any info:
Manifest-Version: 1.0
Bnd-LastModified: 1453741848674
Build-Jdk: 1.8.0_60
Built-By: opnfv
Bundle-ClassPath: .,jars/antlr4-runtime-4.0.jar,jars/mapdb-1.0.4.jar,jar
Bundle-ManifestVersion: 2
Bundle-Vendor: OpenDaylight
Bundle-Version: 1.1.1
Created-By: Apache Maven Bundle Plugin
Embed-Dependency: antlr4-runtime, mapdb, yang-model-api, yang-parser-imp
Embed-Directory: jars
Embed-Transitive: true
Embedded-Artifacts: ...
Export-Package: ...
Import-Package: ...
Tool: Bnd-

I would assume the "Bundle-Name" and "Bundle-Version" properties are significant here, and their values match I specified in the manifest for the "core" module, and which are reported on the build output. Here is an excerpt of the manifest for the "core" module:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Version: 1.1.1.qualifier
Bundle-Vendor: Cisco Systems, Inc.
Require-Bundle: org.eclipse.core.runtime,
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ActivationPolicy: lazy

Again, I'd really appreciate substantive advice that leads me to a solution to this.

Back to the top