-
Notifications
You must be signed in to change notification settings - Fork 0
/
pom.xml
345 lines (327 loc) · 10.3 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
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
<?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>com.redhat.demo</groupId>
<artifactId>xpaas</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>bundle</packaging>
<name>Fabric8 :: Quickstarts :: Karaf :: Camel Log</name>
<description>A simple 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>
<!-- 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.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>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</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>
<repositories>
<repository>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>fuse-public-repository</id>
<name>FuseSource Community Release Repository</name>
<url>https://repo.fusesource.com/nexus/content/groups/public</url>
</repository>
<repository>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>red-hat-ga-repository</id>
<name>Red Hat GA Repository</name>
<url>https://maven.repository.redhat.com/ga</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>fuse-public-repository</id>
<name>FuseSource Community Release Repository</name>
<url>https://repo.fusesource.com/nexus/content/groups/public</url>
</pluginRepository>
<pluginRepository>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>red-hat-ga-repository</id>
<name>Red Hat GA Repository</name>
<url>https://maven.repository.redhat.com/ga</url>
</pluginRepository>
</pluginRepositories>
<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>
</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>
</build>
</image>
</images>
</configuration>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.camel</groupId>
<artifactId>camel-maven-plugin</artifactId>
<version>2.15.1.redhat-621084</version>
<configuration>
<useBlueprint>true</useBlueprint>
</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>