Skip to content

Gradle Export Task fails #5257

@amitjoy

Description

@amitjoy

Currently, with the latest version (6.4.0-SNAPSHOT), the bndruns cannot be exported anymore.

It reports several warnings regarding the component property types denoting that the annotation should be in the project build path whereas all our custom property types are in a single base API project which is added to the builpath of all the workspace projects. It also reports the similar problems for org.osgi.service.event.propertytypes.EventTopics component property type which is also in the aforementioned base API and by default added to the buildpath of all projects.

After reporting the above-mentioned warnings, it fails with the following ERROR message:

The Bundle-Activator header only supports a single type. The following types were found: com.qivicon.gateway.dmt.simple.provider.Activator,com.qivicon.gateway.dmt.systemproperty.synchronizer.Activator,com.qivicon.gateway.eventnotification.internal.Activator,com.qivicon.gateway.logger.forwarder.LoggerFacadeController,com.qivicon.gateway.slm.agent.internal.Activator,com.qivicon.runtime.healthcheck.core.osgi.OSGiCoreServicesCheckActivator,com.qivicon.runtime.inithooks.adapter.Activator,com.qivicon.runtime.osgiagent.Activator,com.qivicon.runtime.redirect.internal.Activator,com.qivicon.runtime.systemstate.starter.Activator,com.qivicon.tools.console.commands.RandomBundleRestartCommand,org.apache.felix.gogo.command.Activator,org.apache.felix.gogo.runtime.activator.Activator. This usually happens when a macro resolves to multiple types

Surprisingly, the export task thinks that all these different bundle activators are inside a single bundle whereas these activators are in separate bundles. Since a bundle cannot have more than one activator, it is also prevented by bndtools by default during build phase as a precautionary step. But, somehow during export the gradle task considers them to be part of a single bundle and that's why the build fails.

For your reference, all our activators in the workspace use org.osgi.annotation.bundle.Header annotation as follows:
@Header(name = org.osgi.framework.Constants.BUNDLE_ACTIVATOR, value = "${@class}"). We don't specify the Bundle-Activator manifest entry manually in the respective project's bnd.bnd file and surprisingly, the abovementioned ERROR log only comprises those projects that have activators specified using org.osgi.annotation.bundle.Header annotation. We also have a few projects where Bundle-Activator manifest entry has been added manually to their respective bnd.bnd files but they are exempted from the aforementioned ERROR log.

Please also find the gradle execution log with --full-stacktrace enabled here.

log.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions