Issue #26: Profile for OSGI bundles
- Added profile based on the Maven Bundle Plugin
- Profile stages META-INF and OSGI-INF in places where Eclipse PDE expects them so Eclipse would recognize them as bundles
- These locations are also cleaned up on a "clean"
diff --git a/pom.xml b/pom.xml
index d8240ee..52aef1a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -2176,6 +2176,85 @@
<!-- * Build OSGi bundle * -->
<!-- ********************************** -->
<profile>
+ <id>osgi-bundle</id>
+ <activation>
+ <file>
+ <exists>marker-file-identifying-osgi-bundle</exists>
+ </file>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <version>5.1.6</version>
+ <extensions>true</extensions>
+ <configuration>
+ <instructions>
+ <Bundle-RequiredExecutionEnvironment>JavaSE-1.8</Bundle-RequiredExecutionEnvironment>
+ <_dsannotations>*</_dsannotations>
+ <_metatypeannotations>*</_metatypeannotations>
+ </instructions>
+ </configuration>
+ <executions>
+ <execution>
+ <id>bundle-manifest</id>
+ <phase>process-classes</phase>
+ <goals>
+ <goal>manifest</goal>
+ </goals>
+ <configuration>
+ <niceManifest>true</niceManifest>
+ <exportScr>true</exportScr>
+ <scrLocation>${project.basedir}/OSGI-INF/..</scrLocation>
+ <manifestLocation>${project.basedir}/META-INF</manifestLocation>
+ <!--
+ - Enabling this currently seems to cause spurious exceptions in Eclipse
+ <supportIncrementalBuild>true</supportIncrementalBuild>
+ -->
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-clean-plugin</artifactId>
+ <version>3.2.0</version>
+ <executions>
+ <execution>
+ <phase>clean</phase>
+ <goals>
+ <goal>clean</goal>
+ </goals>
+ <id>clean-manifest-and-osgiinf</id>
+ <configuration>
+ <filesets>
+ <fileset>
+ <directory>${project.basedir}/META-INF</directory>
+ <includes>
+ <include>**</include>
+ </includes>
+ </fileset>
+ <fileset>
+ <directory>${project.basedir}/OSGI-INF</directory>
+ <includes>
+ <include>**</include>
+ </includes>
+ </fileset>
+ </filesets>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <!-- ********************************** -->
+ <!-- * Build OSGi bundle (old) * -->
+ <!-- ********************************** -->
+ <profile>
<id>build OSGi bundle for annotator</id>
<activation>
<file>