Skip to content

Commit f81a907

Browse files
committed
Provide an way to build the JAR without the the "osgi.ee" requirement.
Closes dropbox#20
1 parent 6b006bd commit f81a907

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

ReadMe.md

+23
Original file line numberDiff line numberDiff line change
@@ -136,3 +136,26 @@ Assume "{sdk}" represents the top-level folder of this SDK.
136136
- Click *Next*
137137
3. Clicking *Next* on the rest of the dialogs.
138138
4. On the last dialog, you can change *Project name* if you want **but make sure** you set *Project file location* back to "{sdk}/intellij".
139+
140+
## FAQ
141+
142+
### When I use the bundle JAR with some OSGi containers within an OSGi subsystem, I get a "Missing required capability" error.
143+
144+
The JAR's manifest has the following line:
145+
146+
```
147+
Require-Capability: osgi.ee;filter="(&(osgi.ee=JavaSE)(version=1.6))"
148+
```
149+
150+
OSGi containers running on Java 1.6 or above should provide this capability. Unfortunately, some OSGi containers don't do this correctly and will reject the bundle JAR in the OSGi subsystem context.
151+
152+
As a workaround, you can build your own version of the JAR that omits the "osgi.ee" capability by running:
153+
154+
```
155+
mvn clean
156+
mvn package -Dosgi.bnd.noee=true
157+
```
158+
159+
(This is equivalent to passing the "-noee" option to the OSGi "bnd" tool.)
160+
161+
Another workaround is to tell your OSGi container to provide that requirement: [StackOverflow answer](http://stackoverflow.com/a/24673359/163832).

pom.xml

+6
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
<properties>
4141
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
4242
<skipTests>true</skipTests>
43+
<osgi.bnd.noee>false</osgi.bnd.noee>
4344
</properties>
4445

4546
<dependencies>
@@ -211,6 +212,11 @@
211212
<artifactId>maven-bundle-plugin</artifactId>
212213
<version>2.5.0</version>
213214
<extensions>true</extensions>
215+
<configuration>
216+
<instructions>
217+
<_noee>${osgi.bnd.noee}</_noee>
218+
</instructions>
219+
</configuration>
214220
<executions>
215221
<execution>
216222
<id>bundle-manifest</id>

0 commit comments

Comments
 (0)