pom.xml 5.9 KB

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