pom.xml 6.5 KB

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