pom.xml 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  3. <modelVersion>4.0.0</modelVersion>
  4. <parent>
  5. <artifactId>jsr330activator</artifactId>
  6. <groupId>no.steria.osgi.jsr330activator</groupId>
  7. <version>1.0.2</version>
  8. </parent>
  9. <artifactId>jsr330activator.testbundle1</artifactId>
  10. <packaging>bundle</packaging>
  11. <name>jsr330activator.testbundle1 OSGi Bundle</name>
  12. <properties>
  13. <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  14. </properties>
  15. <dependencies>
  16. <dependency>
  17. <groupId>org.osgi</groupId>
  18. <artifactId>org.osgi.core</artifactId>
  19. <version>4.3.0</version>
  20. <scope>provided</scope>
  21. </dependency>
  22. <dependency>
  23. <groupId>no.steria.osgi.jsr330activator</groupId>
  24. <artifactId>jsr330activator.implementation</artifactId>
  25. <version>${project.version}</version>
  26. </dependency>
  27. <dependency>
  28. <groupId>org.apache.servicemix.bundles</groupId>
  29. <artifactId>org.apache.servicemix.bundles.javax-inject</artifactId>
  30. <version>1_2</version>
  31. <scope>provided</scope>
  32. </dependency>
  33. </dependencies>
  34. <build>
  35. <plugins>
  36. <plugin>
  37. <groupId>org.apache.felix</groupId>
  38. <artifactId>maven-bundle-plugin</artifactId>
  39. <version>2.3.7</version>
  40. <extensions>true</extensions>
  41. <configuration>
  42. <instructions>
  43. <Bundle-Activator>no.steria.osgi.jsr330activator.Jsr330Activator</Bundle-Activator>
  44. <Export-Package>no.steria.osgi.jsr330activator.testbundle1</Export-Package>
  45. </instructions>
  46. </configuration>
  47. </plugin>
  48. </plugins>
  49. </build>
  50. <profiles>
  51. <profile>
  52. <id>build-for-felix</id>
  53. <dependencies>
  54. <dependency>
  55. <groupId>org.apache.felix</groupId>
  56. <artifactId>org.apache.felix.main</artifactId>
  57. <version>4.0.3</version>
  58. <scope>provided</scope>
  59. </dependency>
  60. <!-- To include a shell:
  61. <dependency>
  62. <groupId>org.apache.felix</groupId>
  63. <artifactId>org.apache.felix.gogo.shell</artifactId>
  64. <version>0.10.0</version>
  65. </dependency>
  66. -->
  67. </dependencies>
  68. <build>
  69. <plugins>
  70. <plugin>
  71. <groupId>org.apache.maven.plugins</groupId>
  72. <artifactId>maven-antrun-plugin</artifactId>
  73. <version>1.7</version>
  74. <executions>
  75. <execution>
  76. <id>compile</id>
  77. <phase>package</phase>
  78. <goals>
  79. <goal>run</goal>
  80. </goals>
  81. <configuration>
  82. <target>
  83. <pathconvert property="plugins.jars" pathsep="${path.separator}">
  84. <path refid="maven.runtime.classpath" />
  85. <map from="${project.build.directory}${file.separator}classes" to="" />
  86. </pathconvert>
  87. <pathconvert pathsep=" " property="bundles">
  88. <path path="${plugins.jars}" />
  89. <mapper>
  90. <chainedmapper>
  91. <flattenmapper />
  92. <globmapper from="*" to="file:modules/*" casesensitive="no" />
  93. </chainedmapper>
  94. </mapper>
  95. </pathconvert>
  96. <propertyfile file="${project.build.directory}/config.properties">
  97. <entry key="felix.auto.start" value="${bundles} file:modules/${project.build.finalName}.jar" />
  98. <entry key="org.osgi.framework.bootdelegation" value="*" />
  99. </propertyfile>
  100. <copy file="${maven.dependency.org.apache.felix.org.apache.felix.main.jar.path}" tofile="${project.build.directory}/felix.jar" />
  101. </target>
  102. </configuration>
  103. </execution>
  104. </executions>
  105. </plugin>
  106. <plugin>
  107. <groupId>org.apache.maven.plugins</groupId>
  108. <artifactId>maven-assembly-plugin</artifactId>
  109. <version>2.3</version>
  110. <executions>
  111. <execution>
  112. <id>create-executable-jar</id>
  113. <phase>package</phase>
  114. <goals>
  115. <goal>single</goal>
  116. </goals>
  117. <configuration>
  118. <descriptors>
  119. <descriptor>${basedir}/src/main/assembly/felix.xml</descriptor>
  120. </descriptors>
  121. <finalName>${project.build.finalName}</finalName>
  122. </configuration>
  123. </execution>
  124. </executions>
  125. </plugin>
  126. </plugins>
  127. </build>
  128. </profile>
  129. <profile>
  130. <id>run-on-felix</id>
  131. <dependencies>
  132. <dependency>
  133. <groupId>org.apache.felix</groupId>
  134. <artifactId>org.apache.felix.main</artifactId>
  135. <version>4.0.3</version>
  136. <scope>provided</scope>
  137. </dependency>
  138. <!-- org.apache.felix:org.apache.felix.gogo.shell:0.6.1 useless from Maven since stdin is swallowed -->
  139. </dependencies>
  140. <build>
  141. <plugins>
  142. <plugin>
  143. <groupId>org.apache.maven.plugins</groupId>
  144. <artifactId>maven-antrun-plugin</artifactId>
  145. <version>1.7</version>
  146. <configuration>
  147. <target>
  148. <property name="vm.args" value="" />
  149. <pathconvert property="plugins.jars" pathsep="${path.separator}">
  150. <path refid="maven.runtime.classpath" />
  151. <map from="${project.build.directory}${file.separator}classes" to="" />
  152. </pathconvert>
  153. <makeurl property="urls" separator=" ">
  154. <path path="${plugins.jars}" />
  155. <path location="${project.build.directory}/${project.build.finalName}.jar" />
  156. </makeurl>
  157. <propertyfile file="${project.build.directory}/run.properties">
  158. <entry key="felix.auto.start" value="${urls}" />
  159. <entry key="felix.auto.deploy.action" value="uninstall,install,update,start" />
  160. <entry key="org.osgi.framework.storage" value="${project.build.directory}${file.separator}felix-cache" />
  161. <entry key="org.osgi.framework.bootdelegation" value="*" />
  162. </propertyfile>
  163. <makeurl property="run.properties.url" file="${project.build.directory}/run.properties" />
  164. <java fork="true" jar="${maven.dependency.org.apache.felix.org.apache.felix.main.jar.path}">
  165. <sysproperty key="felix.config.properties" value="${run.properties.url}" />
  166. <jvmarg line="${vm.args}" />
  167. </java>
  168. </target>
  169. </configuration>
  170. </plugin>
  171. </plugins>
  172. </build>
  173. </profile>
  174. </profiles>
  175. </project>