---
title: 'Using Gradle to create OSGi bundles with DS annotations'
url: 'https://www.twelvetone.tv/docs/operating-systems/vaandroid/vaandroid-developer-guide/tutorials/creating-an-osgi-bundle'
markdown: 'https://www.twelvetone.tv/docs/operating-systems/vaandroid/vaandroid-developer-guide/tutorials/creating-an-osgi-bundle.md'
date: '2026-09-25'
taxonomy:
  category:
    - docs
---

[](#)  [ Home ](https://www.twelvetone.tv/docs/)     [ Operating Systems ](https://www.twelvetone.tv/docs/operating-systems)     [ Vaandroid ](https://www.twelvetone.tv/docs/operating-systems/vaandroid)     [ Vaandroid Developer Guide ](https://www.twelvetone.tv/docs/operating-systems/vaandroid/vaandroid-developer-guide)     [ Tutorials ](https://www.twelvetone.tv/docs/operating-systems/vaandroid/vaandroid-developer-guide/tutorials)      Using Gradle to create OSGi bundles with DS annotations    

# Using Gradle to create OSGi bundles with DS annotations

# BND Plugin Approach

<https://github.com/bndtools/bnd/blob/master/biz.aQute.bnd.gradle/README.md#gradle-plugin-for-non-workspace-builds>

OSGi Plugin with Annotated Declarative Services

```
buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'biz.aQute.bnd:biz.aQute.bnd.gradle:3.2.0'
    }
}

apply plugin: 'biz.aQute.bnd.builder'

dependencies {
    compileOnly 'org.osgi:org.osgi.service.component.annotations:1.3.0'
}
```

# OSGi Plugin Approach

```
buildscript {
    repositories {
        maven {
            ur<x>l "https://plugins.gradle.org/m2/"
        }
    }
    dependencies {
        classpath 'org.jayware:gradle-osgi-ds:0.5.1'
    }
}

apply plugin: 'java'
apply plugin: 'osgi'
apply plugin: 'osgi-ds'

dependencies {
    compileOnly 'org.osgi:org.osgi.service.component.annotations:1.3.0'
}

jar {
    manifest {
        instruction "Service-Component", "OSGI-INF/*.xml"
    }
}
```

 [ ](https://www.twelvetone.tv/docs/operating-systems/vaandroid/vaandroid-developer-guide/tutorials/running-the-server) [](https://www.twelvetone.tv/docs/operating-systems/vaandroid/vaandroid-developer-guide/tutorials/developer-install-guide)

---

## Navigation

- Parent: [Tutorials](https://www.twelvetone.tv/docs/operating-systems/vaandroid/vaandroid-developer-guide/tutorials.md)
- Previous: [Running The Server](https://www.twelvetone.tv/docs/operating-systems/vaandroid/vaandroid-developer-guide/tutorials/running-the-server.md)
- Next: [Developer Install Guide](https://www.twelvetone.tv/docs/operating-systems/vaandroid/vaandroid-developer-guide/tutorials/developer-install-guide.md)
