Skip to content

Commit 5a60fb3

Browse files
hsudbrockcdjackson
authored andcommitted
Add module to maven build that creates a p2 repository with built bundles (#330)
* Add module to maven build that creates a p2 repository containing the built OSGi bundles The p2 repository will be created in folder releng/p2repo/target/repository if the maven profile 'p2repo' is active. This p2 repository can be useful when building OSGi applications like the openhab ZigBee binding with maven. Signed-off-by: Henning Sudbrock <[email protected]> * Do not exclude p2repo module if p2repo profile is not enabled Rather only activate its build steps if the p2repo profile is enabled. Signed-off-by: Henning Sudbrock <[email protected]>
1 parent ada3ef2 commit 5a60fb3

File tree

3 files changed

+105
-0
lines changed

3 files changed

+105
-0
lines changed

pom.xml

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
<module>com.zsmartsystems.zigbee.console.telegesis</module>
4444
<module>com.zsmartsystems.zigbee.serial</module>
4545
<module>com.zsmartsystems.zigbee.test</module>
46+
<module>releng/p2repo</module>
4647
</modules>
4748

4849
<reporting>

releng/p2repo/assembly.xml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<assembly
2+
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
5+
6+
<id>bin</id>
7+
8+
<formats>
9+
<format>dir</format>
10+
</formats>
11+
12+
<includeBaseDirectory>false</includeBaseDirectory>
13+
14+
<moduleSets>
15+
<moduleSet>
16+
17+
<!-- Enable access to all projects in the current multimodule build! -->
18+
<useAllReactorProjects>true</useAllReactorProjects>
19+
20+
<!-- Now, select which artifacts to include in this module-set. -->
21+
<excludes>
22+
<exclude>com.zsmartsystems.zigbee:com.zsmartsystems.zigbee.console.main</exclude>
23+
<exclude>com.zsmartsystems.zigbee:com.zsmartsystems.zigbee.test</exclude>
24+
<exclude>com.zsmartsystems.zigbee:com.zsmartsystems.zigbee.autocode</exclude>
25+
</excludes>
26+
27+
<!-- And put all selected files to a plugins directory -->
28+
<binaries>
29+
<outputDirectory>plugins</outputDirectory>
30+
<unpack>false</unpack>
31+
<includeDependencies>false</includeDependencies>
32+
</binaries>
33+
34+
</moduleSet>
35+
</moduleSets>
36+
</assembly>
37+

releng/p2repo/pom.xml

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
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/maven-v4_0_0.xsd">
3+
4+
<modelVersion>4.0.0</modelVersion>
5+
6+
<groupId>com.zsmartsystems.zigbee</groupId>
7+
<artifactId>com.zsmartsystems.zigbee.p2repo</artifactId>
8+
<packaging>pom</packaging>
9+
10+
<parent>
11+
<groupId>com.zsmartsystems</groupId>
12+
<artifactId>zigbee</artifactId>
13+
<version>1.0.13-SNAPSHOT</version>
14+
</parent>
15+
16+
<profiles>
17+
<profile>
18+
<!-- Profile generates p2 repo for built artifacts in releng/p2repo/target/repository -->
19+
<id>p2repo</id>
20+
21+
<build>
22+
<plugins>
23+
24+
<plugin>
25+
<artifactId>maven-assembly-plugin</artifactId>
26+
<version>2.6</version>
27+
<executions>
28+
<execution>
29+
<id>aggregate</id>
30+
<phase>package</phase>
31+
<goals>
32+
<goal>single</goal>
33+
</goals>
34+
<configuration>
35+
<appendAssemblyId>false</appendAssemblyId>
36+
<finalName>bundles</finalName>
37+
<descriptors>
38+
<descriptor>assembly.xml</descriptor>
39+
</descriptors>
40+
</configuration>
41+
</execution>
42+
</executions>
43+
</plugin>
44+
45+
<plugin>
46+
<groupId>org.eclipse.tycho.extras</groupId>
47+
<artifactId>tycho-p2-extras-plugin</artifactId>
48+
<version>1.0.0</version>
49+
<executions>
50+
<execution>
51+
<id>p2</id>
52+
<goals>
53+
<goal>publish-features-and-bundles</goal>
54+
</goals>
55+
<phase>package</phase>
56+
</execution>
57+
</executions>
58+
<configuration>
59+
<sourceLocation>${project.build.directory}/bundles</sourceLocation>
60+
</configuration>
61+
</plugin>
62+
</plugins>
63+
</build>
64+
</profile>
65+
</profiles>
66+
67+
</project>

0 commit comments

Comments
 (0)