4
Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi, Stephen Connolly, Tom Huybrechts, Yahoo! Inc.
6
Permission is hereby granted, free of charge, to any person obtaining a copy
7
of this software and associated documentation files (the "Software"), to deal
8
in the Software without restriction, including without limitation the rights
9
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
copies of the Software, and to permit persons to whom the Software is
11
furnished to do so, subject to the following conditions:
13
The above copyright notice and this permission notice shall be included in
14
all copies or substantial portions of the Software.
16
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25
<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">
26
<modelVersion>4.0.0</modelVersion>
29
<groupId>org.jenkins-ci.main</groupId>
30
<artifactId>pom</artifactId>
31
<version>1.509.2</version>
32
<relativePath>../pom.xml</relativePath>
35
<artifactId>jenkins-war</artifactId>
36
<packaging>war</packaging>
38
<name>Jenkins war</name>
40
Creates a war file. Also includes additional static web resources, such as images, CSS, JavaScript, and
45
<JENKINS_HOME>${basedir}/work</JENKINS_HOME>
46
<contextPath>/jenkins</contextPath><!-- context path during test -->
47
<port>8080</port><!-- HTTP listener port -->
52
<groupId>org.jenkins-ci</groupId>
53
<artifactId>executable-war</artifactId>
54
<version>1.28</version>
55
<scope>provided</scope>
59
<groupId>org.jenkins-ci.main</groupId>
60
<artifactId>jenkins-core</artifactId>
61
<version>${project.version}</version>
64
jars that are not needed in war. most of the exclusions should happen in the core, to make IDEs happy, not here.
67
<groupId>javax.servlet</groupId>
68
<artifactId>servlet-api</artifactId>
71
<groupId>javax.servlet</groupId>
72
<artifactId>jsp-api</artifactId>
74
<!-- Stapler 1.195 fails to declare this as optional, and the 1.1 version lacks a license: -->
76
<artifactId>metainf-services</artifactId>
77
<groupId>org.kohsuke.metainf-services</groupId>
81
<!-- declare this in reactors, so i can use now directly : mvn install -pl war -am to get the war -->
82
<!-- TO REMOVE when maven-plugin won't be anymore a bundle plugin -->
84
<groupId>${project.groupId}</groupId>
85
<artifactId>maven-plugin</artifactId>
86
<version>${project.version}</version>
87
<scope>provided</scope>
90
<groupId>${project.groupId}</groupId>
91
<artifactId>remoting</artifactId>
92
<!-- specified in the parent -->
95
<groupId>${project.groupId}</groupId>
96
<artifactId>cli</artifactId>
97
<classifier>jar-with-dependencies</classifier>
98
<version>${project.version}</version>
99
<scope>provided</scope>
103
not actually used by test but used by dependency plugin to include it inside the war.
105
<groupId>org.jenkins-ci</groupId>
106
<artifactId>winstone</artifactId>
107
<version>0.9.10-jenkins-44</version>
111
<groupId>org.jenkins-ci.modules</groupId>
112
<artifactId>instance-identity</artifactId>
113
<version>1.3</version>
116
<groupId>org.jenkins-ci.modules</groupId>
117
<artifactId>ssh-cli-auth</artifactId>
118
<version>1.2</version>
121
<groupId>org.jenkins-ci.modules</groupId>
122
<artifactId>slave-installer</artifactId>
123
<version>1.2</version>
126
<groupId>org.jenkins-ci.modules</groupId>
127
<artifactId>windows-slave-installer</artifactId>
128
<version>1.2</version>
131
<groupId>org.jenkins-ci.modules</groupId>
132
<artifactId>launchd-slave-installer</artifactId>
133
<version>1.2</version>
136
<groupId>org.jenkins-ci.modules</groupId>
137
<artifactId>upstart-slave-installer</artifactId>
138
<version>1.1</version>
141
<groupId>org.jenkins-ci.modules</groupId>
142
<artifactId>sshd</artifactId>
143
<version>1.5</version>
147
We bundle slf4j binding since we got some components (sshd for example)
150
The problem with not shipping any binding in the war is that if the
151
servlet container does use slf4j in itself, then we got a classloader
152
constraint violation (see JENKINS-12334) as we try to load StaticLoggerBinder
153
which resides in the binding jar (this jar would be from container implementation,
154
which relies on slf4j api in the container, when we have our own slf4j API jar
155
statically depending on the binding jar.)
157
We also get tickets like JENKINS-12650 for not reporting logs at all
158
(although this is a non-fatal problem.)
160
The downside of adding a jar is that we can potentially get "multiple binding jar"
161
warning like http://www.slf4j.org/codes.html, but that's at least non-fatal.
163
<groupId>org.slf4j</groupId>
164
<artifactId>slf4j-jdk14</artifactId>
168
<!-- offline profiler API when we need it -->
171
<groupId>com.yourkit.api</groupId>
172
<artifactId>yjp</artifactId>
173
<version>dontcare</version>
174
<scope>system</scope>
175
<systemPath>/usr/local/yjp/lib/yjp.jar</systemPath>
180
<finalName>jenkins</finalName>
183
<artifactId>maven-war-plugin</artifactId>
184
<!-- version specified in grandparent pom -->
186
<filteringDeploymentDescriptors>true</filteringDeploymentDescriptors>
187
<!-- for putting Main-Class into war -->
190
<mainClass>Main</mainClass>
193
<Implementation-Version>${project.version}</Implementation-Version>
194
<Hudson-Version>1.395</Hudson-Version>
195
<Jenkins-Version>${project.version}</Jenkins-Version>
198
<!--outputFileNameMapping>@{artifactId}@.@{extension}@</outputFileNameMapping-->
202
<artifactId>maven-dependency-plugin</artifactId>
203
<!-- version specified in grandparent pom -->
206
<id>list-dependencies</id>
207
<phase>generate-resources</phase>
212
<outputFile>${project.build.outputDirectory}/dependencies.txt</outputFile>
216
<!-- put executable war header -->
217
<id>executable-war-header</id>
218
<phase>generate-resources</phase>
220
<goal>unpack-dependencies</goal>
223
<includeGroupIds>org.jenkins-ci</includeGroupIds>
224
<includeArtifactIds>executable-war</includeArtifactIds>
225
<includeScope>provided</includeScope>
226
<includes>**/*.class</includes>
227
<outputDirectory>${project.build.directory}/${project.build.finalName}</outputDirectory>
232
<phase>generate-resources</phase>
238
<!-- dependencies that goes to unusual locations -->
240
<groupId>${project.groupId}</groupId>
241
<artifactId>remoting</artifactId>
242
<outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF</outputDirectory>
243
<destFileName>remoting.jar</destFileName>
246
<groupId>${project.groupId}</groupId>
247
<artifactId>remoting</artifactId>
248
<outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF</outputDirectory>
249
<destFileName>slave.jar</destFileName>
252
<groupId>${project.groupId}</groupId>
253
<artifactId>cli</artifactId>
254
<classifier>jar-with-dependencies</classifier>
255
<outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF</outputDirectory>
256
<destFileName>jenkins-cli.jar</destFileName>
259
<groupId>org.jenkins-ci</groupId>
260
<artifactId>winstone</artifactId>
261
<outputDirectory>${project.build.directory}/${project.build.finalName}</outputDirectory>
262
<destFileName>winstone.jar</destFileName>
264
<!-- bundled plugins -->
266
<groupId>${project.groupId}</groupId>
267
<artifactId>maven-plugin</artifactId>
271
<groupId>org.jenkins-ci.plugins</groupId>
272
<artifactId>ssh-slaves</artifactId>
273
<version>0.25</version>
277
<groupId>org.jenkins-ci.plugins</groupId>
278
<artifactId>credentials</artifactId>
279
<version>1.3.1</version>
283
<groupId>org.jenkins-ci.plugins</groupId>
284
<artifactId>ssh-credentials</artifactId>
285
<version>0.2</version>
289
<groupId>org.jenkins-ci.plugins</groupId>
290
<artifactId>subversion</artifactId>
291
<version>1.39</version>
295
<groupId>org.jenkins-ci.plugins</groupId>
296
<artifactId>cvs</artifactId>
297
<version>1.6</version>
301
<groupId>org.jenkins-ci.plugins</groupId>
302
<artifactId>ant</artifactId>
303
<version>1.1</version>
307
<groupId>org.jenkins-ci.plugins</groupId>
308
<artifactId>javadoc</artifactId>
309
<version>1.0</version>
313
<groupId>org.jenkins-ci.plugins</groupId>
314
<artifactId>translation</artifactId>
315
<version>1.10</version>
319
<groupId>org.jenkins-ci.plugins</groupId>
320
<artifactId>external-monitor-job</artifactId>
321
<version>1.1</version>
325
<groupId>org.jenkins-ci.plugins</groupId>
326
<artifactId>ldap</artifactId>
327
<version>1.1</version>
331
<groupId>org.jenkins-ci.plugins</groupId>
332
<artifactId>pam-auth</artifactId>
333
<version>1.0</version>
337
<groupId>org.jenkins-ci.plugins</groupId>
338
<artifactId>mailer</artifactId>
339
<version>1.4</version>
343
<outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/plugins</outputDirectory>
344
<stripVersion>true</stripVersion>
345
<overWriteIfNewer>true</overWriteIfNewer>
346
<overWriteReleases>false</overWriteReleases>
347
<overWriteSnapshots>true</overWriteSnapshots>
353
<groupId>org.codehaus.mojo</groupId>
354
<artifactId>build-helper-maven-plugin</artifactId>
357
<!-- deploy the war as a jar, so that the tests can pull this into the classpath -->
358
<id>deploy-war-for-test</id>
359
<phase>package</phase>
361
<goal>attach-artifact</goal>
366
<file>${project.build.directory}/${project.build.finalName}.war</file>
368
<classifier>war-for-test</classifier>
375
<plugin><!-- generate licenses.xml -->
376
<groupId>com.cloudbees</groupId>
377
<artifactId>maven-license-plugin</artifactId>
378
<!-- version specified in grandparent pom -->
380
<generateLicenseXml>${project.build.outputDirectory}/META-INF/licenses.xml</generateLicenseXml>
381
<generateLicenseHtml>${project.build.outputDirectory}/META-INF/licenses.html</generateLicenseHtml>
382
<attach>true</attach>
385
// add Winstone since we are bundling it.
386
def d = project.dependencies.find { it.artifactId=="winstone" };
387
def a = mojo.artifactFactory.createProjectArtifact(d.groupId,d.artifactId,d.version);
388
def p = mojo.projectBuilder.buildFromRepository(a, project.getRemoteArtifactRepositories(), mojo.localRepository)
395
<!-- this is really just a patched version of maven-jetty-plugin to workaround issue #932 -->
396
<groupId>org.jenkins-ci.tools</groupId>
397
<artifactId>maven-jenkins-dev-plugin</artifactId>
398
<!-- version specified in grandparent pom -->
401
Reload webapp when you hit ENTER. (See JETTY-282 for more)
403
<reload>manual</reload>
405
<connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
409
<additionalClassesDirectories>
410
<!-- load resoures straight from source -->
411
<additionalClassesDirectory>../core/src/main/resources</additionalClassesDirectory>
414
read directly from core module's output directory,
415
so that changes are picked up right away without running mvn.
417
<additionalClassesDirectory>../core/target/classes</additionalClassesDirectory>
418
</additionalClassesDirectories>
420
<loginService implementation="org.eclipse.jetty.security.HashLoginService">
422
<config>${basedir}/src/realm.properties</config>
427
<name>JENKINS_HOME</name>
428
<value>${JENKINS_HOME}</value>
431
<!-- always reload views during debugging -->
432
<name>stapler.jelly.noCache</name>
436
<!-- show the stapler evaluation during execution -->
437
<name>stapler.trace</name>
441
<!-- always reload scripts during debugging -->
442
<name>hudson.script.noCache</name>
446
<!-- load view resources from the source directly, again for real time change -->
447
<name>stapler.resourcePath</name>
449
../core/src/main/resources;
450
../ui-samples-plugin/src/main/resources;
451
../maven-plugin/src/main/resources
455
<!-- enable the plugins in main by default -->
456
<name>hudson.bundled.plugins</name>
457
<value><!-- run "mvn install" once will generate the.hpl -->
458
${basedir}/../maven-plugin/target/test-classes/the.hpl,
459
${basedir}/../ui-samples-plugin/target/test-classes/the.hpl,
460
${project.build.directory}/${project.build.finalName}/WEB-INF/plugins/*.hpi
464
<!-- stat collection pointless -->
465
<name>hudson.model.UsageStatistics.disabled</name>
469
<name>hudson.Main.development</name>
473
<!-- this adds 3 sec to the shutdown, and most likely pointless, too -->
474
<name>hudson.DNSMultiCast.disabled</name>
479
<contextPath>${contextPath}</contextPath>
480
<configurationDiscovered>false</configurationDiscovered>
489
<!-- profile for creating Jenkins IPS package -->
494
<groupId>org.jvnet.updatecenter2</groupId>
495
<artifactId>maven-makepkgs-plugin</artifactId>
496
<!-- version specified in grandparent pom -->
505
<python>python2.5</python>
506
<proto>../ips/proto.py</proto>
507
<attach>false</attach>
519
<artifactId>maven-jarsigner-plugin</artifactId>
523
<phase>verify</phase>
528
<archive>${project.build.directory}/${project.build.finalName}.war</archive>