gradle-karaf-plugin icon indicating copy to clipboard operation
gradle-karaf-plugin copied to clipboard

project dependency does not have a version

Open elpinjo opened this issue 7 years ago • 5 comments

I have bnd project consisting of 3 sub-projects. one sub project is the karaf "feature" project, the two other projects are my provider bundle and application bundle.

the build.gradle of the "feature" project contains the following dependencies:

dependencies { iot project(':com.iotapp.provider') iot project(':com.iotapp.application') mqtt 'org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.1.1' }

karaf { features { name = "${project.name}-${version}" xsdVersion = '1.3.0' outputFile = file("${project.buildDir}/karaf/features/${project.name}-feature.xml") includeProject = false;

feature {
	name        = 'iotapp'
	description = 'iot message processing'
	
	configurations 'mqtt', 'iot'
            feature 'scr'
   }

} }

When I run the gradle generateFeatures it generates the following feature xml:

scr mvn:org.eclipse.paho/org.eclipse.paho.client.mqttv3/1.1.1 mvn:com.iot/com.iot.provider/unspecified mvn:com.iot/com.iot.application/unspecified

as you can see in the last two bundles no version is added.

elpinjo avatar Sep 08 '17 19:09 elpinjo

Do you have a sample project to share ? that would speed up my investigation :)

lburgazzoli avatar Sep 11 '17 09:09 lburgazzoli

I have created a sample project. You can clone it from: https://github.com/elpinjo/featureSample.git

elpinjo avatar Sep 13 '17 22:09 elpinjo

I never tested the plugin against bnd stuffs so it may require more time to check if there is any bug but what I've noticed is that your projects do not have aversion defined, could you do so and test it again ?

lburgazzoli avatar Sep 15 '17 06:09 lburgazzoli

Explicitly setting the version in gradle.properties works, however, this version will not endup in my OSGI bundles as bnd uses its version from the workspace. I'm trying to get these to link together, but don't know how yet as my experience is lacking a bit in the field of bnd and gradle.

elpinjo avatar Sep 17 '17 19:09 elpinjo

The plugin relies on gradles's dependency resolution so if gradle doesn't know the version the plugin doesn't too.

Unfortunately I never worked with such combination so I can't help much.

If you find a way I'd really be happy if you can send a PR to the readme so others can benefit.

lburgazzoli avatar Sep 18 '17 08:09 lburgazzoli