forked from abouchama/karaf-camel-rest-ose
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpom.xml
277 lines (259 loc) · 9.7 KB
/
pom.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<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">
<modelVersion>4.0.0</modelVersion>
<groupId>io.fabric8</groupId>
<artifactId>karaf-camel-rest-ose</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>bundle</packaging>
<name>Karaf :: Camel :: Rest</name>
<description>A simple Rest Camel route in Karaf container</description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<version.maven-bundle-plugin>2.3.7</version.maven-bundle-plugin>
<http.port>9191</http.port>
<!-- versions for use in mvn plugins as we cannot inherit them from a BOM -->
<fuse.version>6.2.1.redhat-084</fuse.version>
<fabric8.version>2.2.0.redhat-079</fabric8.version>
<docker.maven.plugin.version>0.13.6</docker.maven.plugin.version>
<karaf.plugin.version>4.0.2.redhat-621079</karaf.plugin.version>
<docker.from>jboss-fuse-6/fis-karaf-openshift:1.0</docker.from>
<fabric8.dockerUser>fabric8/</fabric8.dockerUser>
<docker.image>${fabric8.dockerUser}quickstart-karaf-camellog:${project.version}</docker.image>
<docker.assemblyDescriptor>${basedir}/src/main/fabric8/assembly.xml</docker.assemblyDescriptor>
<docker.port.container.jolokia>8778</docker.port.container.jolokia>
<docker.port.container.http>8181</docker.port.container.http>
<fabric8.service.name>karaf-camel-rest-ose</fabric8.service.name>
<fabric8.service.port>80</fabric8.service.port>
<fabric8.service.containerPort>${http.port}</fabric8.service.containerPort>
<fabric8.label.component>${project.artifactId}</fabric8.label.component>
<fabric8.label.container>karaf</fabric8.label.container>
<fabric8.label.group>quickstarts</fabric8.label.group>
<fabric8.iconRef>camel</fabric8.iconRef>
</properties>
<dependencyManagement>
<dependencies>
<!-- fabric8 bom must be before fabric8 bom -->
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>fabric8-project-bom-with-platform-deps</artifactId>
<version>${fabric8.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.jboss.fuse.bom</groupId>
<artifactId>jboss-fuse-parent</artifactId>
<version>${fuse.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-blueprint</artifactId>
</dependency>
<!-- Karaf microcontainer dependencies -->
<dependency>
<!-- scope is compile so all features (there is only one) are installed into startup.properties,
and the feature repo itself is not added in etc/org.apache.karaf.features.cfg file -->
<groupId>org.jboss.fuse</groupId>
<artifactId>fuse-karaf-framework</artifactId>
<version>${fuse.version}</version>
<type>kar</type>
<!-- no need to download kar dependencies -->
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<!-- Compiler plugin enforces Java 1.7 compatibility and activates annotation processors -->
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>${version.maven-bundle-plugin}</version>
<extensions>true</extensions>
</plugin>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>fabric8-maven-plugin</artifactId>
<version>${fabric8.version}</version>
<executions>
<execution>
<id>json</id>
<phase>generate-resources</phase>
<goals>
<goal>json</goal>
</goals>
</execution>
<execution>
<id>attach</id>
<phase>package</phase>
<goals>
<goal>attach</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- plugin goals have to be executed in order -->
<!-- 1. install the bundle -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
<executions>
<execution>
<id>install-bundle</id>
<goals>
<goal>install</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- 2. create karaf assembly -->
<!-- karaf-maven-plugin creates custom microservice distribution -->
<plugin>
<groupId>org.apache.karaf.tooling</groupId>
<artifactId>karaf-maven-plugin</artifactId>
<version>${karaf.plugin.version}</version>
<extensions>true</extensions>
<executions>
<execution>
<id>karaf-assembly</id>
<goals>
<goal>assembly</goal>
</goals>
<phase>install</phase>
</execution>
<execution>
<id>karaf-archive</id>
<goals>
<goal>archive</goal>
</goals>
<phase>install</phase>
</execution>
</executions>
<configuration>
<!-- we are using karaf 2.4.x -->
<karafVersion>v24</karafVersion>
<useReferenceUrls>true</useReferenceUrls>
<!-- do not include build output directory -->
<includeBuildOutputDirectory>false</includeBuildOutputDirectory>
<!-- no startupFeatures -->
<startupFeatures>
<feature>karaf-framework</feature>
<feature>shell</feature>
<feature>jaas</feature>
<feature>aries-blueprint</feature>
<feature>camel-blueprint</feature>
<feature>camel-cxf</feature>
<feature>camel-jetty</feature>
<feature>camel-jackson</feature>
<feature>camel-websocket</feature>
</startupFeatures>
<startupBundles>
<bundle>mvn:${project.groupId}/${project.artifactId}/${project.version}</bundle>
</startupBundles>
</configuration>
</plugin>
<!-- 3. create docker image -->
<plugin>
<groupId>org.jolokia</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>${docker.maven.plugin.version}</version>
<configuration>
<images>
<image>
<name>${docker.image}</name>
<build>
<from>${docker.from}</from>
<assembly>
<basedir>/deployments</basedir>
<user>jboss:jboss:jboss</user>
<inline xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2" xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<id>${project.artifactId}</id>
<files>
<!-- copy karaf archive -->
<file>
<source>${project.build.directory}/${project.artifactId}-${project.version}.tar.gz</source>
<outputDirectory>/</outputDirectory>
</file>
</files>
</inline>
</assembly>
<cmd>
<shell>/deployments/deploy-and-run.sh</shell>
</cmd>
<env>
<HTTP_PORT>${http.port}</HTTP_PORT>
</env>
<ports>
<port>${http.port}</port>
</ports>
</build>
</image>
</images>
</configuration>
</plugin>
</plugins>
</build>
<!--
Default sample commands:
mvn -Pf8-build ... build Docker images and create OpenShift deployment configs
mvn -Pf8-deploy ... f8-build + push to Docker registry + applying deployment config to OpenShift
mvn -Pf8-local-deploy ... deployment for a single node setup without pushing to a registry
For individual goal usage please consult the fabric8 documentation
-->
<profiles>
<profile>
<id>f8-build</id>
<build>
<defaultGoal>clean install docker:build fabric8:json</defaultGoal>
</build>
</profile>
<profile>
<id>f8-deploy</id>
<properties>
<fabric8.imagePullPolicySnapshot>Always</fabric8.imagePullPolicySnapshot>
<fabric8.recreate>true</fabric8.recreate>
</properties>
<build>
<defaultGoal>clean install docker:build docker:push fabric8:json fabric8:apply</defaultGoal>
</build>
</profile>
<profile>
<id>f8-local-deploy</id>
<properties>
<fabric8.recreate>true</fabric8.recreate>
</properties>
<build>
<defaultGoal>clean install docker:build fabric8:json fabric8:apply</defaultGoal>
</build>
</profile>
</profiles>
</project>