pom.xml 6.3 KB

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