blob: 84ce8494faa9c74607d62bb7d10f1aea37009013 [file] [log] [blame]
Carsten Ziegelerb61fe0e2008-01-03 09:24:12 +00001<!--
2 Licensed to the Apache Software Foundation (ASF) under one
3 or more contributor license agreements. See the NOTICE file
4 distributed with this work for additional information
5 regarding copyright ownership. The ASF licenses this file
6 to you under the Apache License, Version 2.0 (the
7 "License"); you may not use this file except in compliance
8 with the License. You may obtain a copy of the License at
9
10 http://www.apache.org/licenses/LICENSE-2.0
11
12 Unless required by applicable law or agreed to in writing,
13 software distributed under the License is distributed on an
14 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 KIND, either express or implied. See the License for the
16 specific language governing permissions and limitations
17 under the License.
18-->
Carsten Ziegeler4fec0962008-01-11 16:13:31 +000019<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/maven-v4_0_0.xsd">
Karl Pauls589e2b32007-07-11 18:29:29 +000020 <parent>
21 <groupId>org.apache.felix</groupId>
Felix Meschbergera4ad70a2009-04-27 13:12:37 +000022 <artifactId>felix-parent</artifactId>
Felix Meschberger3229b522011-10-11 18:10:07 +000023 <version>2.1</version>
Karl Pauls589e2b32007-07-11 18:29:29 +000024 <relativePath>../pom/pom.xml</relativePath>
25 </parent>
26 <modelVersion>4.0.0</modelVersion>
27 <packaging>bundle</packaging>
28 <name>Apache Felix Declarative Services</name>
29 <description>
Felix Meschberger39d6c582010-05-28 20:28:18 +000030 Implementation of the Declarative Services specification 1.1
Karl Pauls589e2b32007-07-11 18:29:29 +000031 </description>
32 <artifactId>org.apache.felix.scr</artifactId>
Felix Meschberger38dd63b2010-08-10 12:19:28 +000033 <version>1.6.1-SNAPSHOT</version>
Felix Meschberger4753fcb2009-04-29 08:46:06 +000034 <scm>
Felix Meschberger38dd63b2010-08-10 12:19:28 +000035 <connection>scm:svn:https://svn.apache.org/repos/asf/felix/trunk/scr</connection>
36 <developerConnection>scm:svn:https://svn.apache.org/repos/asf/felix/trunk/scr</developerConnection>
37 <url>scm:svn:https://svn.apache.org/repos/asf/felix/trunk/scr</url>
Felix Meschberger4753fcb2009-04-29 08:46:06 +000038 </scm>
Felix Meschberger55e3b972009-10-12 07:16:08 +000039
40 <!--
41 A Note on Testing
42 =================
43
44 This project contains two kinds of tests: regular unit tests running
45 in the test phase and integration tests based on PAX Exam running
46 in the integration-test phase.
47
48 Basically the complete project is build using Java 1.3 source and target
49 compatibility (as inherited from the parent pom). The exception are the
50 unit tests in the "integration" packages. These have to be compiled with
51 Java 5 source and target compatibility because the employ annotations
52 and generics.
53
54 For running the integration tests from the console using Maven nothing
55 special has to be done as the tests run automatically. To run the tests
56 in your IDE, the project has to be built to the "package" phase with
57 the profile "ide" enabled:
58
59 $ mvn -Pide clean package
60
61 This creates the scr.jar file in the target folder, which is used by
62 the integration tests when run from the IDE. Alternatively the
63 "project.bundle.file" system property may be set to the bundle JAR
64 in the IDE launcher.
65 -->
Felix Meschbergerc17fdbd2009-10-12 07:25:39 +000066 <properties>
Felix Meschberger6c63b752009-10-12 08:11:27 +000067 <bundle.build.name>
68 ${basedir}/target
69 </bundle.build.name>
Felix Meschbergere130b0b2009-10-12 07:51:50 +000070 <bundle.file.name>
Felix Meschberger6c63b752009-10-12 08:11:27 +000071 ${bundle.build.name}/${project.build.finalName}.jar
Felix Meschbergere130b0b2009-10-12 07:51:50 +000072 </bundle.file.name>
Felix Meschbergerc17fdbd2009-10-12 07:25:39 +000073 </properties>
74
Felix Meschberger55e3b972009-10-12 07:16:08 +000075
Karl Pauls589e2b32007-07-11 18:29:29 +000076 <dependencies>
77 <dependency>
Felix Meschbergerca797922009-10-07 08:38:18 +000078 <groupId>org.osgi</groupId>
Karl Pauls589e2b32007-07-11 18:29:29 +000079 <artifactId>org.osgi.core</artifactId>
Felix Meschbergerca797922009-10-07 08:38:18 +000080 <version>4.1.0</version>
Felix Meschbergerbbd1e9d2009-10-11 08:18:18 +000081 <scope>provided</scope>
Karl Pauls589e2b32007-07-11 18:29:29 +000082 </dependency>
83 <dependency>
Felix Meschbergerca797922009-10-07 08:38:18 +000084 <groupId>org.osgi</groupId>
Karl Pauls589e2b32007-07-11 18:29:29 +000085 <artifactId>org.osgi.compendium</artifactId>
Felix Meschbergerca797922009-10-07 08:38:18 +000086 <version>4.2.0</version>
Felix Meschbergerbbd1e9d2009-10-11 08:18:18 +000087 <scope>provided</scope>
Karl Pauls589e2b32007-07-11 18:29:29 +000088 </dependency>
89 <dependency>
Felix Meschberger02fd53d2011-04-06 15:02:42 +000090 <groupId>${project.groupId}</groupId>
Felix Meschbergerd25a63d2007-11-23 13:02:49 +000091 <artifactId>org.apache.felix.shell</artifactId>
92 <version>1.0.0</version>
Felix Meschbergerbbd1e9d2009-10-11 08:18:18 +000093 <scope>provided</scope>
Felix Meschberger6c63b752009-10-12 08:11:27 +000094 <exclusions>
95 <exclusion>
96 <groupId>org.apache.felix</groupId>
97 <artifactId>org.osgi.core</artifactId>
98 </exclusion>
99 </exclusions>
Felix Meschbergerd25a63d2007-11-23 13:02:49 +0000100 </dependency>
101 <dependency>
Felix Meschberger44add772010-12-23 18:13:24 +0000102 <groupId>org.apache.felix</groupId>
103 <artifactId>org.apache.felix.gogo.runtime</artifactId>
104 <version>0.6.1</version>
105 <scope>provided</scope>
106 </dependency>
107 <dependency>
Karl Pauls589e2b32007-07-11 18:29:29 +0000108 <groupId>net.sf.kxml</groupId>
109 <artifactId>kxml2</artifactId>
110 <version>2.2.2</version>
Felix Meschbergerbbd1e9d2009-10-11 08:18:18 +0000111 <scope>provided</scope>
Karl Pauls589e2b32007-07-11 18:29:29 +0000112 </dependency>
Felix Meschberger47eb0372009-07-28 13:48:28 +0000113
114 <!-- Integration Testing with Pax Exam -->
115 <dependency>
116 <groupId>junit</groupId>
117 <artifactId>junit</artifactId>
118 <version>4.6</version>
Felix Meschbergerbbd1e9d2009-10-11 08:18:18 +0000119 <scope>test</scope>
Felix Meschberger47eb0372009-07-28 13:48:28 +0000120 </dependency>
121 <dependency>
122 <groupId>org.ops4j.pax.exam</groupId>
123 <artifactId>pax-exam</artifactId>
124 <version>0.6.0</version>
125 <scope>test</scope>
126 </dependency>
127 <dependency>
128 <groupId>org.ops4j.pax.exam</groupId>
129 <artifactId>pax-exam-junit</artifactId>
130 <version>0.6.0</version>
131 <scope>test</scope>
132 </dependency>
133 <dependency>
134 <groupId>org.ops4j.pax.exam</groupId>
135 <artifactId>pax-exam-container-default</artifactId>
136 <version>0.6.0</version>
137 <scope>test</scope>
138 </dependency>
139 <dependency>
140 <groupId>org.ops4j.pax.swissbox</groupId>
141 <artifactId>pax-swissbox-tinybundles</artifactId>
Felix Meschberger5245d482011-08-29 08:38:39 +0000142 <version>1.1.0</version>
Felix Meschberger47eb0372009-07-28 13:48:28 +0000143 <scope>test</scope>
144 </dependency>
Karl Pauls589e2b32007-07-11 18:29:29 +0000145 </dependencies>
146 <build>
Felix Meschberger6c63b752009-10-12 08:11:27 +0000147 <directory>${bundle.build.name}</directory>
Karl Pauls589e2b32007-07-11 18:29:29 +0000148 <plugins>
149 <plugin>
150 <groupId>org.apache.felix</groupId>
151 <artifactId>maven-bundle-plugin</artifactId>
Felix Meschberger02fd53d2011-04-06 15:02:42 +0000152 <version>2.3.4</version>
Karl Pauls589e2b32007-07-11 18:29:29 +0000153 <extensions>true</extensions>
154 <configuration>
155 <instructions>
Felix Meschberger5ac763d2011-02-04 06:24:05 +0000156 <Bundle-Category>osgi</Bundle-Category>
Karl Pauls589e2b32007-07-11 18:29:29 +0000157 <Bundle-SymbolicName>
Felix Meschberger02fd53d2011-04-06 15:02:42 +0000158 ${project.artifactId}
Karl Pauls589e2b32007-07-11 18:29:29 +0000159 </Bundle-SymbolicName>
Carsten Ziegelercf6e51b2008-04-17 06:33:59 +0000160 <Bundle-Vendor>The Apache Software Foundation</Bundle-Vendor>
Felix Meschberger40d3e602009-10-11 12:25:14 +0000161 <Bundle-DocURL>
162 http://felix.apache.org/site/apache-felix-service-component-runtime.html
163 </Bundle-DocURL>
Karl Pauls589e2b32007-07-11 18:29:29 +0000164 <Bundle-Activator>
Felix Meschbergerd25a63d2007-11-23 13:02:49 +0000165 org.apache.felix.scr.impl.Activator
Karl Pauls589e2b32007-07-11 18:29:29 +0000166 </Bundle-Activator>
167 <Export-Package>
Felix Meschberger0da1bab2010-08-03 08:55:21 +0000168 org.apache.felix.scr;version=1.6,
Felix Meschbergerca797922009-10-07 08:38:18 +0000169 org.osgi.service.component
Karl Pauls589e2b32007-07-11 18:29:29 +0000170 </Export-Package>
171 <Private-Package>
Felix Meschberger9b4e0232009-07-09 12:34:12 +0000172 org.apache.felix.scr.impl.*,
173 org.osgi.util.tracker
Karl Pauls589e2b32007-07-11 18:29:29 +0000174 </Private-Package>
Felix Meschbergerd25a63d2007-11-23 13:02:49 +0000175 <Import-Package>
Felix Meschbergerca797922009-10-07 08:38:18 +0000176 <!--
Felix Meschberger44add772010-12-23 18:13:24 +0000177 optional import for Gogo annotations
178 -->
179 org.apache.felix.service.command;resolution:=optional,
180
181 <!--
Felix Meschbergerca797922009-10-07 08:38:18 +0000182 The Felix Shell support is optional
183 -->
Felix Meschberger95f21262011-11-17 08:24:49 +0000184 org.apache.felix.shell;provide:=true;resolution:=optional,
Felix Meschbergerca797922009-10-07 08:38:18 +0000185
186 <!--
Felix Meschberger8a8c6332009-10-29 13:48:37 +0000187 Framework version 1.4 (from R4.1) is required
188 because we depend on ServiceReference being
189 Comparable and Bundle.getBundleContext method
190 being available.
Felix Meschbergerca797922009-10-07 08:38:18 +0000191 -->
Felix Meschberger8a8c6332009-10-29 13:48:37 +0000192 org.osgi.framework;version="[1.4,2)",
Felix Meschbergerca797922009-10-07 08:38:18 +0000193
194 <!--
Felix Meschbergerd854a922009-10-29 12:28:50 +0000195 LogService is optional but if present the
196 R4.0 version 1.3 is sufficient.
197 -->
198 org.osgi.service.log;version="[1.3,2)";resolution:=optional,
199
200 <!--
Felix Meschberger08aaff62010-08-05 13:26:31 +0000201 PackageAdmin is used to find reference types if
Felix Meschberger95f21262011-11-17 08:24:49 +0000202 the component's bundle does not import it.
203 See BindMethod.getParameterClass(Class) for details.
204 R4.0 version 1.2 is sufficient.
Felix Meschberger08aaff62010-08-05 13:26:31 +0000205 -->
206 org.osgi.service.packageadmin;version="[1.2,2)";resolution:=optional,
207
208 <!--
Felix Meschbergerf6066cb2009-10-29 11:05:31 +0000209 SCR API is required (we also export it) and must
Felix Meschberger95f21262011-11-17 08:24:49 +0000210 be of the same minor version as we export, because
211 we implement that exact version. This import is
212 only used if the framework decides to wire the
213 bundle to another API provider.
Felix Meschbergerf6066cb2009-10-29 11:05:31 +0000214 -->
Felix Meschberger95f21262011-11-17 08:24:49 +0000215 org.osgi.service.component;provide:=true,
216
217 <!--
218 SCR Admin API is required (we also export it) and
219 must be of the same minor version as we export,
220 because we implement that exact version. This
221 import is only used if the framework decides to
222 wire the bundle to another API provider.
223 -->
224 org.apache.felix.scr;provide:=true
Felix Meschbergerd25a63d2007-11-23 13:02:49 +0000225 </Import-Package>
Felix Meschbergerf873dbe2011-02-04 10:50:18 +0000226 <DynamicImport-Package>
227 <!--
228 Configuration Admin version 1.2 (from R4.0) is enough
229 -->
230 org.osgi.service.cm;version="[1.2,2)",
231
232 <!--
233 Metatype is optional and if it is
234 present, version 1.1 (from R4.1) is enough
235 -->
236 org.osgi.service.metatype;version="[1.1,2)"
237 </DynamicImport-Package>
Felix Meschberger9b4e0232009-07-09 12:34:12 +0000238 <Embed-Dependency>
Felix Meschberger02fd53d2011-04-06 15:02:42 +0000239 kxml2;inline=org/kxml2/io/KXmlParser.class|org/xmlpull/v1/XmlPull**
Felix Meschberger9b4e0232009-07-09 12:34:12 +0000240 </Embed-Dependency>
Karl Pauls589e2b32007-07-11 18:29:29 +0000241 </instructions>
242 </configuration>
243 </plugin>
Felix Meschberger47eb0372009-07-28 13:48:28 +0000244
245 <!--
Felix Meschberger44add772010-12-23 18:13:24 +0000246 Configure default compilation for Java 1.3 and integration
Felix Meschberger47eb0372009-07-28 13:48:28 +0000247 test compilation for Java 5 (since integration tests use
Felix Meschberger44add772010-12-23 18:13:24 +0000248 Java Annotations for Pax Exam).
249 Also configure the compilation of the Gogo Command class
250 (using Java 5 annotations) with Java 5 target.
Felix Meschberger47eb0372009-07-28 13:48:28 +0000251 -->
252 <plugin>
253 <artifactId>maven-compiler-plugin</artifactId>
254 <executions>
255 <execution>
Felix Meschberger44add772010-12-23 18:13:24 +0000256 <id>compile-java5</id>
257 <goals>
258 <goal>compile</goal>
259 </goals>
260 <configuration>
261 <source>1.5</source>
262 <target>1.5</target>
263 <excludes>
264 <exclude>dummy-to-overwrite-global-config</exclude>
265 </excludes>
266 <includes>
267 <include>**/ScrGogoCommand.java</include>
268 </includes>
269 </configuration>
270 </execution>
271 <execution>
Felix Meschberger47eb0372009-07-28 13:48:28 +0000272 <id>test-compile-java5</id>
273 <goals>
274 <goal>testCompile</goal>
275 </goals>
276 <configuration>
277 <source>1.5</source>
278 <target>1.5</target>
279 <testIncludes>
280 <testInclude>**/integration/**</testInclude>
281 </testIncludes>
282 <testExcludes>
283 <testExclude>**/impl/**</testExclude>
284 </testExcludes>
285 </configuration>
286 </execution>
287 </executions>
288 <configuration>
289 <testExcludes>
290 <testExclude>**/integration/**</testExclude>
291 </testExcludes>
Felix Meschberger44add772010-12-23 18:13:24 +0000292 <excludes>
293 <exclude>**/ScrGogoCommand.java</exclude>
294 </excludes>
Felix Meschberger47eb0372009-07-28 13:48:28 +0000295 </configuration>
296 </plugin>
297
298 <!--
299 Exclude Integration tests in (default) unit tests and
300 conversely enable integration tests for integration testing
301 only. Helper classes are completely excluded from testing.
302 -->
303 <plugin>
304 <artifactId>maven-surefire-plugin</artifactId>
305 <executions>
306 <execution>
307 <id>surefire-it</id>
308 <phase>integration-test</phase>
309 <goals>
310 <goal>test</goal>
311 </goals>
312 <configuration>
Felix Meschberger55e3b972009-10-12 07:16:08 +0000313 <systemProperties>
314 <property>
315 <name>project.bundle.file</name>
Felix Meschbergere130b0b2009-10-12 07:51:50 +0000316 <value>${bundle.file.name}</value>
Felix Meschberger55e3b972009-10-12 07:16:08 +0000317 </property>
318 </systemProperties>
Felix Meschberger47eb0372009-07-28 13:48:28 +0000319 <excludes>
320 <exclude>**/components/**</exclude>
321 </excludes>
322 <includes>
323 <include>**/integration/*</include>
324 </includes>
325 </configuration>
326 </execution>
327 </executions>
328 <configuration>
329 <excludes>
330 <exclude>**/integration/**</exclude>
331 <exclude>**/components/**</exclude>
332 <exclude>**/instances/**</exclude>
333 <exclude>**/instances2/**</exclude>
334 </excludes>
335 </configuration>
336 </plugin>
Felix Meschbergerdf922662011-02-04 23:09:29 +0000337 <plugin>
338 <groupId>org.apache.maven.plugins</groupId>
339 <artifactId>maven-javadoc-plugin</artifactId>
340 <configuration>
341 <encoding>${project.build.sourceEncoding}</encoding>
342 <excludePackageNames>*.impl</excludePackageNames>
343 </configuration>
344 </plugin>
Karl Pauls589e2b32007-07-11 18:29:29 +0000345 </plugins>
346 </build>
Felix Meschberger55e3b972009-10-12 07:16:08 +0000347
348 <profiles>
349 <!--
350 copy the package such that IDEs may easily use it without
351 setting the system property
352 -->
353 <profile>
354 <id>ide</id>
355 <build>
356 <plugins>
357 <plugin>
358 <artifactId>maven-antrun-plugin</artifactId>
Felix Meschberger55e3b972009-10-12 07:16:08 +0000359 <executions>
360 <execution>
361 <id>scr-file-create</id>
362 <phase>package</phase>
363 <goals>
364 <goal>run</goal>
365 </goals>
366 <configuration>
Felix Meschberger3229b522011-10-11 18:10:07 +0000367 <target>
Felix Meschberger9afc4d72009-11-02 22:28:37 +0000368 <copy file="${project.build.directory}/${project.build.finalName}.jar" tofile="${project.build.directory}/scr.jar" />
Felix Meschberger3229b522011-10-11 18:10:07 +0000369 </target>
Felix Meschberger55e3b972009-10-12 07:16:08 +0000370 </configuration>
371 </execution>
372 </executions>
373 </plugin>
374 </plugins>
375 </build>
376 </profile>
377 </profiles>
378
Felix Meschberger47eb0372009-07-28 13:48:28 +0000379 <!-- repositories for Pax Exam and BND tool -->
380 <repositories>
381 <repository>
382 <id>ops4j</id>
383 <name>ops4j</name>
384 <url>http://repository.ops4j.org/maven2</url>
385 <snapshots>
386 <enabled>false</enabled>
387 </snapshots>
388 </repository>
Felix Meschberger47eb0372009-07-28 13:48:28 +0000389 </repositories>
Karl Pauls589e2b32007-07-11 18:29:29 +0000390</project>