gradle-karaf-features-plugin


License

License

Categories

Categories

Gradle Build Tools
GroupId

GroupId

com.github.lburgazzoli
ArtifactId

ArtifactId

gradle-karaf-features-plugin
Last Version

Last Version

2.9.10
Release Date

Release Date

Type

Type

jar
Description

Description

gradle-karaf-features-plugin
gradle-karaf-features-plugin
Project URL

Project URL

https://github.com/lburgazzoli/gradle-karaf-features-plugin
Source Code Management

Source Code Management

https://github.com/lburgazzoli/gradle-karaf-features-plugin

Download gradle-karaf-features-plugin

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.lburgazzoli/gradle-karaf-features-plugin/ -->
<dependency>
    <groupId>com.github.lburgazzoli</groupId>
    <artifactId>gradle-karaf-features-plugin</artifactId>
    <version>2.9.10</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.lburgazzoli/gradle-karaf-features-plugin/
implementation 'com.github.lburgazzoli:gradle-karaf-features-plugin:2.9.10'
// https://jarcasting.com/artifacts/com.github.lburgazzoli/gradle-karaf-features-plugin/
implementation ("com.github.lburgazzoli:gradle-karaf-features-plugin:2.9.10")
'com.github.lburgazzoli:gradle-karaf-features-plugin:jar:2.9.10'
<dependency org="com.github.lburgazzoli" name="gradle-karaf-features-plugin" rev="2.9.10">
  <artifact name="gradle-karaf-features-plugin" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.lburgazzoli', module='gradle-karaf-features-plugin', version='2.9.10')
)
libraryDependencies += "com.github.lburgazzoli" % "gradle-karaf-features-plugin" % "2.9.10"
[com.github.lburgazzoli/gradle-karaf-features-plugin "2.9.10"]

Dependencies

test (1)

Group / Artifact Type Version
org.spockframework : spock-core jar 1.0-groovy-2.4

Project Modules

There are no modules declared in this project.

gradle-karaf-features-plugin

Build Status Maven Central License

This plugin is not more maintaned and its features have been incuded in https://github.com/lburgazzoli/gradle-karaf-plugin

How to use

build.gradle

// Gradle 2.1+
plugins {
  id "com.github.lburgazzoli.karaf.features" version "2.9.4"
}

group = 'com.github'
version = '1.0.0'
//name is 'project1'

configuration {
    myAdditionalDepList 
}

project(':subproject1') {
  dependencies {
    compile 'commons-lang:commons-lang:2.6'
    myAdditionalDepList 'com.google.guava:guava:18.0'        
    myAdditionalDepList "com.squareup.retrofit:retrofit:1.9.0"
    myAdditionalDepList "com.squareup.retrofit:converter-jackson:1.9.0"
  }
}

project(':subproject2') {
  dependencies {
    compile 'commons-io:commons-io:2.4'
  }
}

karafFeatures {
  name = 'featuresName'
  
  features {
    mainFeature {
      name = 'main-feature-name'      
      description = 'Some useful description'
      
      repository('mvn:group/dependent-feature/1.2.3/xml/features')
      feature('dependent-feature')
      
      
      project(':subproject1')
      project(':subproject2') {
        dependencies {
          transitive = false                  //true by default
        }
        artifactId = "newSubProject2"         // project name by default
      }
      
      bundlesFrom(project.configurations.myAdditionalDepList)
      bundle('com.squareup.retrofit:converter-jackson') {
        include = false
      }
    }
    testFeature {
      name = 'test-feature-name'
      description = 'Another useful description'
      feature(karafFeatures.features.mainFeature)
    }
  }
}

To generate feature just run

gradle generateKarafFeatures

generated file build/karafFeatures/project1-1.0.0-karaf.xml will look like below

<features xmlns='http://karaf.apache.org/xmlns/features/v1.2.0' name='featuresName'>
  <repository>mvn:group/dependent-feature/1.2.3/xml/features</repository>
  <feature name='main-feature-name' description='Some useful description' version='1.0.0'>
    <feature>dependent-feature</feature>
    <bundle>mvn:commons-lang/commons-lang/2.6</bundle>
    <bundle>wrap:mvn:com.squareup.retrofit/retrofit/1.9.0</bundle>
    <bundle>mvn:com.github/subproject1/1.0.0</bundle>
    <bundle>mvn:com.github/newSubProject2/1.0.0</bundle>
  </feature>
  <feature name='test-feature-name' description='Another useful description' version='1.0.0'>
    <feature>main-feature-name</feature>
  </feature>
</features>

Karaf 4 Support

Karaf 4 features xsd v1.3.0 partially supported

<feature version="1.2.3" dependency="true">dependent-feature</feature>

To generate this stuff

  1. Set xsdVersion to 1.3.0
  2. Use dependency with configuration closure
karafFeatures {
  name = 'featuresName'
  xsdVersion = '1.3.0'
  outputFile = file("${project.buildDir}/karafFeatures/${project.name}-feature.xml")
  features {
    mainFeature {
      name = 'main-feature-name'
      feature('dependent-feature') {
        dependency = true              //false by default
        version = "1.2.3"              //empty by default
      }
    }
  }
}

generated file build/karafFeatures/project1-feature.xml will look like below

<features xmlns='http://karaf.apache.org/xmlns/features/v1.3.0' name='featuresName'>
  <feature name='main-feature-name' version='1.0.0'>
    <feature version="1.2.3" dependency="true">dependent-feature</feature>
  </feature>
</features>

Versions

Version
2.9.10
2.9.6
2.9.4
2.9.3
2.9.1
2.7.2
2.7.1
2.7.0
2.0.3
2.0.2
2.0.1
2.0.0