Sunny Onesotrue
Sunny Onesotrue

Reputation: 152

Eclipse RCP with Gradle - bnd instruction Import-Package not working for org.eclipse.e4.core.di

I have an Eclipse RCP, dependencies managed with gradle.

After updating to a newer Eclipse version with Java 11 I'm currently updating the dependencies. That's when I've encountered a problem.

Caused by: java.lang.ClassNotFoundException: javax.annotation.PostConstruct cannot be found by org.eclipse.e4.core.di_1.8.200.v20220512-1957

and saw that the Manifest of org.eclipse.e4.core.di doesn't import javax.annotation anymore:

Manifest-Version: 1.0
Created-By: Maven Archiver 3.5.2
Build-Jdk-Spec: 11
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.e4.core.di
Bundle-Version: 1.8.200.v20220512-1957
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-11
Export-Package: org.eclipse.e4.core.di;version="1.7.0",org.eclipse.e4.co
 re.di.suppliers;version="1.7.0",org.eclipse.e4.core.internal.di;x-frien
 ds:="org.eclipse.e4.core.contexts",org.eclipse.e4.core.internal.di.osgi
 ;x-internal:=true,org.eclipse.e4.core.internal.di.shared;x-friends:="or
 g.eclipse.e4.core.contexts,org.eclipse.e4.core.di.extensions.supplier"
Require-Bundle: org.eclipse.e4.core.di.annotations;bundle-version="[1.4.
 0,2.0.0)";visibility:=reexport,javax.annotation;bundle-version="[1.3.5,
 2.0.0)"
Import-Package: javax.inject;version="1.0.0",org.eclipse.osgi.framework.
 log;version="1.1.0",org.osgi.framework;version="1.8.0",org.osgi.util.tr
 acker;version="1.5.1"

So naturally I've tried using bnd tools to include javax.annotation in the Import-Packages:

bnd group: 'org.eclipse.platform', name: 'org.eclipse.e4.core.di', {
        instruction 'Import-Package', 'javax.annotation, *'
        instruction '-noee', 'true'
    }

but no matter what I try to do (and I've tried a lot of things), the Manifest never gets edited... I've also tried omitting the group definition, tried including the version, but nothing seems to have any effect on the Manifest.

On the other hand I'm not even sure if I'm on the right track. For other dependecies I was successful with this approach but maybe this is all wrong?

Upvotes: 0

Views: 89

Answers (0)

Related Questions