I have a basic OSGI project in Eclipse. When I created a class Activator and imported the BundleActivator, Eclipse changed the MANIFEST.MF adding these lines:
Export-Package: my.package.name;uses:="org.osgi.framework";version="0.0.1.SNAPSHOT" Import-Package: org.osgi.framework;version="[1.8,2)" Now Eclipse ("problems view") prompts this error message:
Unsatisfied constraint: 'Import-Package: org.osgi.framework; version="[1.8.0,2.0.0)"' Plug-in Problem MANIFEST.MF I have imported the newest Apache Felix runtime and it can be found as a Maven dependency, but that does not solve the problem, when running from within Eclipse.
What do I need to change to solve the dependency? Why does it print versions 1.8.0,2.0.0?
Update
Plugin part of pom.xml:
<plugin> <groupId>org.apache.felix</groupId> <artifactId>maven-bundle-plugin</artifactId> <version>2.3.7</version> <configuration> <manifestLocation>src/main/resources/META-INF</manifestLocation> <rebuildBundle>true</rebuildBundle> <instructions> <Bundle-Activator>my.package.name.Activator</Bundle-Activator> <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName> <Bundle-RequiredExecutionEnvironment>JavaSE-1.7</Bundle-RequiredExecutionEnvironment> </instructions> </configuration> <!-- EXECUTION --> <extensions>true</extensions> <executions> <execution> <id>set_failok</id> <goals> <goal>manifest</goal> </goals> <configuration> <instructions> <_failok>true</_failok> </instructions> </configuration> </execution> </executions> </plugin> Dependency part of pom.xml (import works well):
<dependency> <groupId>org.apache.felix</groupId> <artifactId>org.apache.felix.framework</artifactId> <version>5.0.0</version> </dependency>
pom.xml? How are you trying to use OSGi?[1.8.0,2.0.0)means "any version from 1.8.0 (inclusive) to 2.0.0 (exclusive). This is how OSGi versioning works.