Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: e8720f3d470d735c6e3f02f9ff23cbc081ed1818 (plain) (blame)
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
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
<!-- **************************************************************************
#
# Copyright (c) 2004-2012 Oracle Corporation.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html
#
# Contributors: 
#
#    Kohsuke Kawaguchi, Stephen Connolly, Tom Huybrechts, Winston Prakash
#        
#************************************************************************** --> 

<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>
    <parent>
        <groupId>org.eclipse.hudson</groupId>
        <artifactId>hudson-parent</artifactId>
        <version>3.0.0-RC3</version>
        <relativePath>../pom.xml</relativePath>
    </parent>
  
    <artifactId>hudson-war</artifactId>
    <packaging>war</packaging>
    <name>Hudson :: War</name>

    <description>
        Creates a war file. Also includes additional static web resources, such as images, CSS, JavaScript, and
        some HTML files.
    </description>

    <properties>
        <HUDSON_HOME>${basedir}/work</HUDSON_HOME>
        <contextPath>/</contextPath><!-- context path during test -->
        <port>8080</port><!-- HTTP listener port -->
        <netbeans.hint.deploy.server>gfv3ee6</netbeans.hint.deploy.server>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.1.1</version>
                <configuration>
                    <filteringDeploymentDescriptors>true</filteringDeploymentDescriptors>
                    
                    <webResources>
                        <resource>
                            <directory>${project.build.directory}/classes</directory>
                        </resource>
                        <resource>
                            <directory>${project.build.directory}/generated-resources</directory>
                        </resource>
                    </webResources>
                    <!-- Main bootstrap Class to make war executable -->
                    <archive>
                        <manifest>
                            <mainClass>org.eclipse.hudson.war.Executable</mainClass>
                        </manifest>
                        <manifestEntries>
                            <Implementation-Version>${project.version}</Implementation-Version>
                            <Hudson-Version>${project.version}</Hudson-Version>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>
    
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.3</version>
                <executions>
                   
                    <execution>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>list</goal>
                        </goals>
                            <!-- used by org.jvnet.hudson:executable-war to find JNA and Akuma versions -->
                        <configuration>
                            <outputFile>${basedir}/target/classes/dependencies.txt</outputFile>
                        </configuration>
                    </execution>
                    
                    <execution>
                        <id>unpackExecWar</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                         
                        <configuration>
                            <!-- Copy only the bootstrap class -->
                            <includes>
                                **/Executable*
                            </includes>
                            <artifactItems>                   
                                <artifactItem>
                                    <groupId>${project.groupId}</groupId>
                                    <artifactId>hudson-jetty-war-executable</artifactId>
                                    <version>${project.version}</version>
                                    <type>jar</type>
                                    <overWrite>true</overWrite>
                                    <outputDirectory>target/generated-resources</outputDirectory>
                                </artifactItem>
                                
                            </artifactItems>
                        </configuration>
                    </execution>
                    
                    <execution>
                        <id>copyResources</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                
                                <!-- Jetty war executable libraries -->
                                 
                                <artifactItem>
                                    <groupId>${project.groupId}</groupId>
                                    <artifactId>hudson-jetty-war-executable</artifactId>
                                    <version>${project.version}</version>
                                    <type>jar</type>
                                    <overWrite>true</overWrite>
                                    <outputDirectory>target/generated-resources/libs</outputDirectory>
                                    <destFileName>hudson-jetty-war-executable.jar</destFileName>
                                </artifactItem>
                                
                                <artifactItem>
                                    <groupId>org.mortbay.jetty</groupId>
                                    <artifactId>jetty</artifactId>
                                    <version>6.1.26</version>
                                    <overWrite>true</overWrite>
                                    <outputDirectory>target/generated-resources/libs</outputDirectory>
                                    <destFileName>jetty.jar</destFileName>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.mortbay.jetty</groupId>
                                    <artifactId>jetty-util</artifactId>
                                    <version>6.1.26</version>
                                    <overWrite>true</overWrite>
                                    <outputDirectory>target/generated-resources/libs</outputDirectory>
                                    <destFileName>jetty-util.jar</destFileName>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.mortbay.jetty</groupId>
                                    <artifactId>servlet-api</artifactId>
                                    <version>2.5-20081211</version>
                                    <overWrite>true</overWrite>
                                    <outputDirectory>target/generated-resources/libs</outputDirectory>
                                    <destFileName>jetty-servlet-api.jar</destFileName>
                                </artifactItem>
                                
                                <!-- dependencies that goes to WEB-INF for unusual usage -->
                                
                                <artifactItem>
                                    <groupId>org.eclipse.hudson.main</groupId>
                                    <artifactId>hudson-remoting</artifactId>
                                    <version>${hudson-remoting.version}</version>
                                    <type>jar</type>
                                    <overWrite>true</overWrite>
                                    <outputDirectory>target/generated-resources/WEB-INF</outputDirectory>
                                    <destFileName>slave.jar</destFileName>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.eclipse.hudson.main</groupId>
                                    <artifactId>hudson-remoting</artifactId>
                                    <version>${hudson-remoting.version}</version>
                                    <type>jar</type>
                                    <overWrite>true</overWrite>
                                    <outputDirectory>target/generated-resources/WEB-INF</outputDirectory>
                                    <destFileName>remoting.jar</destFileName>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>${project.groupId}</groupId>
                                    <artifactId>hudson-cli</artifactId>
                                    <version>${project.version}</version>
                                    <classifier>jar-with-dependencies</classifier>
                                    <overWrite>true</overWrite>
                                    <outputDirectory>target/generated-resources/WEB-INF</outputDirectory>
                                    <destFileName>hudson-cli.jar</destFileName>
                                </artifactItem>
                                
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>wagon-maven-plugin</artifactId>
                <version>1.0-beta-4</version>
                <executions>
                    <execution>
                        <id>download-update-center</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>download-single</goal>
                        </goals>
                        <configuration>
                            <url>http://hudson-ci.org</url>
                            <fromFile>update-center3/update-center.json</fromFile>
                            <toDir>target/generated-resources/WEB-INF</toDir>
                        </configuration>
                    </execution>
                </executions>
            </plugin>


            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <id>fixDependenciesTxt</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <tasks>
                                <!-- fix Akuma groupId so it can still be found by pre-split org.jvnet.hudson:executable-war:1.17 -->
                                <replace file="${basedir}/target/classes/dependencies.txt" token="org.kohsuke:akuma" value="com.sun.akuma:akuma" />
                            </tasks>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <version>2.5</version>
                <executions>
                    <execution>
                        <!--
                          Some plugins uses old gif images. Copy them from the compatibility folder
                        -->
                        <id>copyCompatibilityResources</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${basedir}/target/generated-resources/</outputDirectory>
                            <resources>          
                                <resource>
                                    <directory>${basedir}/compat/</directory>
                                    <filtering>true</filtering>
                                </resource>
                            </resources>              
                        </configuration>            
                    </execution>
                </executions>
            </plugin>
            
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>1.7</version>
                <executions>
                    <execution>
                        <id>attach-artifacts</id>
                        <phase>package</phase>
                        <goals>
                            <goal>attach-artifact</goal>
                        </goals>
                        <configuration>
                            <artifacts>
                                <artifact>
                                    <file>${project.build.directory}/${project.artifactId}-${project.version}.war</file>
                                    <type>jar</type>
                                    <classifier>war-for-test</classifier>
                                </artifact>
                            </artifacts>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.mortbay.jetty</groupId>
                <artifactId>jetty-maven-plugin</artifactId>
                <configuration>
                    <contextPath>${contextPath}</contextPath>
                    <!--
                    <connectors>
                        <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
                            <port>${port}</port>
                        </connector>
                    </connectors>
                    -->
                    
                    <connectors>
                        <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
                            <port>${port}</port>
                            <maxIdleTime>60000</maxIdleTime>
                        </connector>
                    </connectors>
                    
                    <stopPort>9966</stopPort> 
                    <stopKey>jetty-stop</stopKey>
                        <!--
                        <scanIntervalSeconds>10</scanIntervalSeconds>
                        -->
                    
                    <!--
                      read directly from core module's output directory,
                      so that changes are picked up right away without running mvn.
                    -->
                    <classesDirectory>../hudson-core/target/classes</classesDirectory>
                    <!-- use the test classpath for loading resources, since this takes priority -->
                    <testClassesDirectory>../hudson-core/src/main/resources</testClassesDirectory>
                    <useTestClasspath>true</useTestClasspath>
                    <!--
                      Reload webapp when you hit ENTER. (See JETTY-282 for more)
                    -->
                    <consoleForceReload>true</consoleForceReload>
                    
                    <loginServices>
                        <loginService implementation="org.eclipse.jetty.security.HashLoginService">
                            <name>default</name>
                            <config>${basedir}/src/realm.properties</config>
                        </loginService>
                    </loginServices>
                    <systemProperties>
                        <systemProperty>
                            <name>HUDSON_HOME</name>
                            <value>${HUDSON_HOME}</value>
                        </systemProperty>
                        <systemProperty>
                            <!-- always reload views during debugging -->
                            <name>stapler.jelly.noCache</name>
                            <value>true</value>
                        </systemProperty>
                        
                        <systemProperty>
                            <name>executable-war</name>
                            <value>${project.build.directory}/${project.artifactId}-${project.version}.war</value>
                        </systemProperty>
                        
                        <systemProperty>
                            <!-- show the stapler evaluation during execution -->
                            <name>stapler.trace</name>
                            <value>true</value>
                        </systemProperty>
                        <systemProperty>
                            <!-- always reload scripts during debugging -->
                            <name>hudson.script.noCache</name>
                            <value>true</value>
                        </systemProperty>
                        <systemProperty>
                            <!-- load view resources from the source directly, again for real time change -->
                            <name>stapler.resourcePath</name>
                            <value>
                                ../hudson-core/src/main/resources
                            </value>
                        </systemProperty>
                        <systemProperty>
                            <!-- stat collection pointless -->
                            <name>hudson.model.UsageStatistics.disabled</name>
                            <value>true</value>
                        </systemProperty>
                        <systemProperty>
                            <name>hudson.Main.development</name>
                            <value>true</value>
                        </systemProperty>
                        <systemProperty>
                            <!-- this adds 3 sec to the shutdown, and most likely pointless, too -->
                            <name>hudson.DNSMultiCast.disabled</name>
                            <value>true</value>
                        </systemProperty>
                    </systemProperties>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>hudson-core</artifactId>
            <exclusions>
                <!--
                  jars that are not needed in war. most of the exclusions should happen in the core, to make IDEs happy, not here.
                -->
                <exclusion>
                    <groupId>javax.servlet</groupId>
                    <artifactId>servlet-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>javax.servlet</groupId>
                    <artifactId>jsp-api</artifactId>
                </exclusion>
                <exclusion>
                    <artifactId>jaxb-impl</artifactId>
                    <groupId>com.sun.xml.bind</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>hudson-inject</artifactId>
        </dependency>

        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>hudson-service</artifactId>
        </dependency>

        <dependency>
            <groupId>org.eclipse.hudson.main</groupId>
            <artifactId>hudson-remoting</artifactId>
            <version>${hudson-remoting.version}</version>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-jdk14</artifactId>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>jcl-over-slf4j</artifactId>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>log4j-over-slf4j</artifactId>
        </dependency>

        <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
            <version>${commons-logging.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>${log4j.version}</version>
            <scope>provided</scope>
        </dependency>

    </dependencies>

    <profiles>
        <profile>
            <!-- profile for creating Hudson IPS package -->
            <id>ips</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.jvnet.updatecenter2</groupId>
                        <artifactId>maven-makepkgs-plugin</artifactId>
                        <version>0.3</version>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>package</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <python>python2.5</python>
                            <proto>../ips/proto.py</proto>
                            <attach>false</attach>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <!-- sign war -->
            <id>sign</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <executions>
                            <!-- sign the war -->
                            <execution>
                                <id>signWar</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                                <configuration>
                                    <tasks>
                                        <!--
                                          during the development, debug profile defined in ../pom.xml will cause
                                          the jars to be signed by a self-certified dummy public key.

                                          For release, you should define the real values in ~/.m2/settings.xml
                                        -->
                                        <signjar jar="target/hudson.war" alias="${hudson.sign.alias}" keystore="${hudson.sign.keystore}" storepass="${hudson.sign.storepass}" />
                                    </tasks>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>

Back to the top