pom.xml 6.3 KB

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