lburgazzoli / gradle-karaf-features-plugin

Apache License 2.0
4 stars 13 forks source link

No clear way to install or upload features.xml to maven repo #21

Open vhusainov opened 8 years ago

vhusainov commented 8 years ago

I'm using maven plugin to deploy artifacts to our maven repo.

I'm forced to use java plugin to be able to upload features to repo, but java plugin also generates jar, which is empty.

To make everything work correct I've added following lines:

configurations.archives.artifacts.clear()

artifacts {
  archives karafFeatures.featuresXmlFile
}

install.dependsOn generateKarafFeatures
uploadArchives.dependsOn generateKarafFeatures

first block removes jar, this makes java plugin to skip compiling classes and creation of jar artifacts

second block adds features.xml as artifact

last block makes generateKarafFeatures task to work before install or upload

This works fine, but maybe there is a better way to do this simple task?

lburgazzoli commented 8 years ago

Maybe jar task can be skipped using a subproject and declaring custom configuration for project dependencies, I need to check. or maybe the jar task can be removed (i.e. configurations.archives.artifacts.removeAll { it.archiveTask.is jar } )

vhusainov commented 8 years ago

I don't understand, why maven plugin is unable to install/upload artifacts without java plugin.

Shouldn't this plugin to integrate into lifecycle and add artifacts by default?

Maybe I don't understand, but how do you use generated features.xml without uploading it to maven?

At first I'm generating features, then deploy it to maven and after it' I refresh features in karaf.

lburgazzoli commented 8 years ago

This plugin is a little young and it does not integrate in lifecycle by default at the moment, I will work on it in the next weeks.

vhusainov commented 8 years ago

For now it does great thing. And with couple workarounds it does everything needed for me. Thank you.