pom.xml 29.0 KB
Newer Older
1
<?xml version="1.0" encoding="UTF-8"?>
K
kohsuke 已提交
2 3 4
<!--
The MIT License

5
Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi, Stephen Connolly, Tom Huybrechts, Yahoo! Inc.
K
kohsuke 已提交
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
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">
K
kohsuke 已提交
26
  <modelVersion>4.0.0</modelVersion>
27

K
kohsuke 已提交
28
  <parent>
29
    <groupId>org.jenkins-ci.main</groupId>
30
    <artifactId>jenkins-parent</artifactId>
31
    <version>${revision}${changelist}</version>
K
kohsuke 已提交
32
  </parent>
33

K
Kohsuke Kawaguchi 已提交
34
  <artifactId>jenkins-war</artifactId>
K
kohsuke 已提交
35
  <packaging>war</packaging>
36

37
  <name>Jenkins war</name>
38
  <description>Creates a war file. Also includes additional static web resources, such as images, CSS, JavaScript, and some HTML files.</description>
39 40 41

  <properties>
    <JENKINS_HOME>${basedir}/work</JENKINS_HOME>
42
    <contextPath>/jenkins</contextPath><!-- context path during test -->
43
    <port>8080</port><!-- HTTP listener port -->
44
    <node.version>6.10.2</node.version>
45
    <yarn.version>0.24.5</yarn.version>
46 47
  </properties>

48 49 50 51 52 53 54 55 56 57 58 59
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.jenkins-ci.main</groupId>
        <artifactId>jenkins-bom</artifactId>
        <version>${project.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

60
  <dependencies>
61 62 63
    <dependency>
      <groupId>org.jenkins-ci</groupId>
      <artifactId>executable-war</artifactId>
64
      <version>1.45</version>
65 66
      <scope>provided</scope>
    </dependency>
67 68 69 70 71 72 73 74 75
    <dependency>
      <groupId>org.jenkins-ci.main</groupId>
      <artifactId>jenkins-core</artifactId>
      <version>${project.version}</version>
      <exclusions>
        <!--
          jars that are not needed in war. most of the exclusions should happen in the core, to make IDEs happy, not here.
        -->
        <exclusion>
76 77
          <groupId>javax.servlet.jsp</groupId>
          <artifactId>javax.servlet.jsp-api</artifactId>
78
        </exclusion>
79 80 81 82 83
        <!-- Stapler 1.195 fails to declare this as optional, and the 1.1 version lacks a license: -->
        <exclusion>
          <artifactId>metainf-services</artifactId>
          <groupId>org.kohsuke.metainf-services</groupId>
        </exclusion>
84 85 86 87 88
      </exclusions>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>remoting</artifactId>
89
      <!-- specified in the parent -->
90
    </dependency>
91 92 93 94 95 96 97 98 99
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>cli</artifactId>
      <classifier>jar-with-dependencies</classifier>
      <version>${project.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <!--
S
Stephen Connolly 已提交
100
        not actually used by test but used by dependency plugin to include it inside the war.
101 102 103
      -->
      <groupId>org.jenkins-ci</groupId>
      <artifactId>winstone</artifactId>
104
      <version>5.3</version>
105 106 107 108 109
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.modules</groupId>
      <artifactId>instance-identity</artifactId>
110
      <version>2.2</version>
111
    </dependency>
112
    <dependency>
113 114
      <groupId>org.jenkins-ci.modules</groupId>
      <artifactId>ssh-cli-auth</artifactId>
115
      <version>1.7</version>
116 117 118 119
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.modules</groupId>
      <artifactId>slave-installer</artifactId>
120
      <version>1.6</version>
121
    </dependency>
K
Kohsuke Kawaguchi 已提交
122 123 124
    <dependency>
      <groupId>org.jenkins-ci.modules</groupId>
      <artifactId>windows-slave-installer</artifactId>
125
      <version>1.12</version>
K
Kohsuke Kawaguchi 已提交
126
    </dependency>
127 128 129
    <dependency>
      <groupId>org.jenkins-ci.modules</groupId>
      <artifactId>launchd-slave-installer</artifactId>
130
      <version>1.2</version>
K
Kohsuke Kawaguchi 已提交
131 132 133 134
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.modules</groupId>
      <artifactId>upstart-slave-installer</artifactId>
135
      <version>1.1</version>
136
    </dependency>
137 138 139
    <dependency>
      <groupId>org.jenkins-ci.modules</groupId>
      <artifactId>systemd-slave-installer</artifactId>
140
      <version>1.1</version>
141
    </dependency>
142 143 144
    <dependency>
      <groupId>org.jenkins-ci.modules</groupId>
      <artifactId>sshd</artifactId>
145
      <version>2.6</version>
146
    </dependency>
147 148 149
    <dependency>
      <groupId>org.jenkins-ci.ui</groupId>
      <artifactId>jquery-detached</artifactId>
150
      <version>1.2.1</version>
151 152 153 154 155
      <classifier>core-assets</classifier>
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.ui</groupId>
      <artifactId>bootstrap</artifactId>
156
      <version>1.3.2</version>
157
      <classifier>core-assets</classifier>
158 159 160 161 162 163
      <exclusions>
        <exclusion>
          <groupId>org.jenkins-ci.ui</groupId>
          <artifactId>jquery-detached</artifactId>
        </exclusion>
      </exclusions>
164 165 166 167
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.ui</groupId>
      <artifactId>handlebars</artifactId>
168
      <version>1.1.1</version>
169 170
      <classifier>core-assets</classifier>
    </dependency>
171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192
    <dependency>
      <!--
        We bundle slf4j binding since we got some components (sshd for example)
        that uses slf4j.

        The problem with not shipping any binding in the war is that if the
        servlet container does use slf4j in itself, then we got a classloader
        constraint violation (see JENKINS-12334) as we try to load StaticLoggerBinder
        which resides in the binding jar (this jar would be from container implementation,
        which relies on slf4j api in the container, when we have our own slf4j API jar
        statically depending on the binding jar.)

        We also get tickets like JENKINS-12650 for not reporting logs at all
        (although this is a non-fatal problem.)

        The downside of adding a jar is that we can potentially get "multiple binding jar"
        warning like http://www.slf4j.org/codes.html, but that's at least non-fatal.
      -->
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-jdk14</artifactId>
    </dependency>

193
    <!-- offline profiler API when we need it -->
194
    <!--dependency
195 196 197 198 199 200 201 202
      <groupId>com.yourkit.api</groupId>
      <artifactId>yjp</artifactId>
      <version>dontcare</version>
      <scope>system</scope>
      <systemPath>/usr/local/yjp/lib/yjp.jar</systemPath>
    </dependency-->
  </dependencies>

K
kohsuke 已提交
203
  <build>
K
Kohsuke Kawaguchi 已提交
204
    <finalName>jenkins</finalName>
K
kohsuke 已提交
205 206 207
    <plugins>
      <plugin>
        <artifactId>maven-war-plugin</artifactId>
208
        <!-- version specified in grandparent pom -->
K
kohsuke 已提交
209
        <configuration>
J
jieryn 已提交
210
          <filteringDeploymentDescriptors>true</filteringDeploymentDescriptors>
K
kohsuke 已提交
211 212
          <!-- for putting Main-Class into war -->
          <archive>
J
jglick 已提交
213
            <manifest>
K
kohsuke 已提交
214 215
              <mainClass>Main</mainClass>
            </manifest>
216 217
            <manifestEntries>
              <Implementation-Version>${project.version}</Implementation-Version>
218
              <Hudson-Version>1.395</Hudson-Version>
219
              <Jenkins-Version>${project.version}</Jenkins-Version>
220 221
              <Remoting-Embedded-Version>${remoting.version}</Remoting-Embedded-Version>
              <Remoting-Minimum-Supported-Version>${remoting.minimum.supported.version}</Remoting-Minimum-Supported-Version>
222
            </manifestEntries>
K
kohsuke 已提交
223
          </archive>
224
          <!--outputFileNameMapping>@{artifactId}@.@{extension}@</outputFileNameMapping-->
K
kohsuke 已提交
225 226
        </configuration>
      </plugin>
227 228
      <plugin>
        <artifactId>maven-dependency-plugin</artifactId>
229
        <!-- version specified in grandparent pom -->
230 231
        <executions>
          <execution>
232
            <id>list-dependencies</id>
233 234 235 236 237
            <phase>generate-resources</phase>
            <goals>
              <goal>list</goal>
            </goals>
            <configuration>
S
Stephen Connolly 已提交
238
              <outputFile>${project.build.outputDirectory}/dependencies.txt</outputFile>
239 240
            </configuration>
          </execution>
241 242 243 244 245 246 247 248 249 250 251 252
          <execution>
            <!-- put executable war header -->
            <id>executable-war-header</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>unpack-dependencies</goal>
            </goals>
            <configuration>
              <includeGroupIds>org.jenkins-ci</includeGroupIds>
              <includeArtifactIds>executable-war</includeArtifactIds>
              <includeScope>provided</includeScope>
              <includes>**/*.class</includes>
253
              <outputDirectory>${project.build.directory}/${project.build.finalName}</outputDirectory>
S
Stephen Connolly 已提交
254 255 256 257 258 259 260 261 262 263 264 265 266 267 268
            </configuration>
          </execution>
          <execution>
            <id>resgen</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>copy</goal>
            </goals>
            <configuration>
              <artifactItems>
                <!-- dependencies that goes to unusual locations -->
                <artifactItem>
                  <groupId>${project.groupId}</groupId>
                  <artifactId>cli</artifactId>
                  <classifier>jar-with-dependencies</classifier>
269
                  <outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF</outputDirectory>
S
Stephen Connolly 已提交
270 271 272 273 274
                  <destFileName>jenkins-cli.jar</destFileName>
                </artifactItem>
                <artifactItem>
                  <groupId>org.jenkins-ci</groupId>
                  <artifactId>winstone</artifactId>
275
                  <outputDirectory>${project.build.directory}/${project.build.finalName}</outputDirectory>
S
Stephen Connolly 已提交
276 277
                  <destFileName>winstone.jar</destFileName>
                </artifactItem>
278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296
              </artifactItems>
              <outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/plugins</outputDirectory>
              <stripVersion>true</stripVersion>
              <overWriteIfNewer>true</overWriteIfNewer>
              <overWriteReleases>false</overWriteReleases>
              <overWriteSnapshots>true</overWriteSnapshots>
            </configuration>
          </execution>
          <execution>
            <id>detached-plugins</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>copy</goal>
            </goals>
            <configuration>
              <artifactItems>
                <!--
                    Detached plugins and their dependencies - detached plugins that used to be bundled plugins
                -->
S
Stephen Connolly 已提交
297 298 299
                <artifactItem>
                  <groupId>${project.groupId}</groupId>
                  <artifactId>maven-plugin</artifactId>
300
                  <version>${maven-plugin.version}</version>
S
Stephen Connolly 已提交
301 302 303 304 305
                  <type>hpi</type>
                </artifactItem>
                <artifactItem>
                  <groupId>org.jenkins-ci.plugins</groupId>
                  <artifactId>ssh-slaves</artifactId>
306
                  <version>1.15</version>
K
Kohsuke Kawaguchi 已提交
307 308 309 310 311
                  <type>hpi</type>
                </artifactItem>
                <artifactItem>
                  <groupId>org.jenkins-ci.plugins</groupId>
                  <artifactId>credentials</artifactId>
312
                  <version>2.1.2</version>
K
Kohsuke Kawaguchi 已提交
313 314 315 316 317
                  <type>hpi</type>
                </artifactItem>
                <artifactItem>
                  <groupId>org.jenkins-ci.plugins</groupId>
                  <artifactId>ssh-credentials</artifactId>
318
                  <version>1.10</version>
S
Stephen Connolly 已提交
319 320 321 322 323
                  <type>hpi</type>
                </artifactItem>
                <artifactItem>
                  <groupId>org.jenkins-ci.plugins</groupId>
                  <artifactId>subversion</artifactId>
J
Jesse Glick 已提交
324
                  <version>1.54</version>
S
Stephen Connolly 已提交
325 326 327
                  <type>hpi</type>
                </artifactItem>
                <artifactItem>
K
oops  
Kohsuke Kawaguchi 已提交
328
                  <groupId>org.jenkins-ci.plugins</groupId>
S
Stephen Connolly 已提交
329
                  <artifactId>cvs</artifactId>
J
Jesse Glick 已提交
330
                  <version>2.11</version>
S
Stephen Connolly 已提交
331 332
                  <type>hpi</type>
                </artifactItem>
333 334 335
                <artifactItem>
                  <groupId>org.jenkins-ci.plugins</groupId>
                  <artifactId>ant</artifactId>
J
Jesse Glick 已提交
336
                  <version>1.2</version>
337 338
                  <type>hpi</type>
                </artifactItem>
339 340 341
                <artifactItem>
                  <groupId>org.jenkins-ci.plugins</groupId>
                  <artifactId>javadoc</artifactId>
J
Jesse Glick 已提交
342
                  <version>1.1</version>
343 344
                  <type>hpi</type>
                </artifactItem>
345 346 347
                <artifactItem>
                  <groupId>org.jenkins-ci.plugins</groupId>
                  <artifactId>translation</artifactId>
348
                  <version>1.10</version>
349 350
                  <type>hpi</type>
                </artifactItem>
351 352 353
                <artifactItem>
                  <groupId>org.jenkins-ci.plugins</groupId>
                  <artifactId>external-monitor-job</artifactId>
354
                  <version>1.4</version>
355 356
                  <type>hpi</type>
                </artifactItem>
357 358 359
                <artifactItem>
                  <groupId>org.jenkins-ci.plugins</groupId>
                  <artifactId>ldap</artifactId>
360
                  <version>1.11</version>
361 362 363 364 365
                  <type>hpi</type>
                </artifactItem>
                <artifactItem>
                  <groupId>org.jenkins-ci.plugins</groupId>
                  <artifactId>pam-auth</artifactId>
J
Jesse Glick 已提交
366
                  <version>1.1</version>
367 368
                  <type>hpi</type>
                </artifactItem>
369 370 371 372 373 374
                <artifactItem>
                  <groupId>org.jenkins-ci.plugins</groupId>
                  <artifactId>display-url-api</artifactId>
                  <version>2.0</version>
                  <type>hpi</type>
                </artifactItem>
O
Oliver Gondža 已提交
375 376 377
                <artifactItem>
                  <groupId>org.jenkins-ci.plugins</groupId>
                  <artifactId>mailer</artifactId>
378
                  <version>1.20</version>
O
Oliver Gondža 已提交
379 380
                  <type>hpi</type>
                </artifactItem>
J
Jesse Glick 已提交
381 382 383
                <artifactItem>
                  <groupId>org.jenkins-ci.plugins</groupId>
                  <artifactId>matrix-auth</artifactId>
384
                  <version>${matrix-auth.version}</version>
J
Jesse Glick 已提交
385 386
                  <type>hpi</type>
                </artifactItem>
J
Jesse Glick 已提交
387 388 389 390 391 392
                <artifactItem>
                  <groupId>org.jenkins-ci.plugins</groupId>
                  <artifactId>windows-slaves</artifactId>
                  <version>1.0</version>
                  <type>hpi</type>
                </artifactItem>
393 394 395
                <artifactItem>
                  <groupId>org.jenkins-ci.plugins</groupId>
                  <artifactId>antisamy-markup-formatter</artifactId>
J
Jesse Glick 已提交
396
                  <version>1.1</version>
397 398
                  <type>hpi</type>
                </artifactItem>
399 400 401
                <artifactItem>
                  <groupId>org.jenkins-ci.plugins</groupId>
                  <artifactId>matrix-project</artifactId>
402
                  <version>${matrix-project.version}</version>
403 404 405 406 407
                  <type>hpi</type>
                </artifactItem>
                <artifactItem>
                  <groupId>org.jenkins-ci.plugins</groupId>
                  <artifactId>script-security</artifactId>
408
                  <version>1.56</version>
409 410
                  <type>hpi</type>
                </artifactItem>
411 412 413
                <artifactItem>
                  <groupId>org.jenkins-ci.plugins</groupId>
                  <artifactId>junit</artifactId>
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
                  <version>1.26.1</version>
                  <type>hpi</type>
                </artifactItem>
                <artifactItem>
                  <!-- dependency of junit -->
                  <groupId>org.jenkins-ci.plugins.workflow</groupId>
                  <artifactId>workflow-api</artifactId>
                  <version>2.35</version>
                  <type>hpi</type>
                </artifactItem>
                <artifactItem>
                  <!-- dependency of junit -->
                  <groupId>org.jenkins-ci.plugins.workflow</groupId>
                  <artifactId>workflow-step-api</artifactId>
                  <version>2.20</version>
                  <type>hpi</type>
                </artifactItem>
                <artifactItem>
                  <!-- dependency of workflow-api -->
                  <groupId>org.jenkins-ci.plugins</groupId>
                  <artifactId>scm-api</artifactId>
                  <version>2.4.1</version>
                  <type>hpi</type>
                </artifactItem>
                <artifactItem>
                  <!-- dependency of junit -->
                  <groupId>org.jenkins-ci.plugins</groupId>
                  <artifactId>structs</artifactId>
                  <version>1.18</version>
443 444
                  <type>hpi</type>
                </artifactItem>
445 446 447
                <artifactItem>
                  <groupId>org.jenkins-ci.plugins</groupId>
                  <artifactId>bouncycastle-api</artifactId>
448
                  <version>2.16.0</version>
449 450
                  <type>hpi</type>
                </artifactItem>
451 452 453
                <artifactItem>
                  <groupId>org.jenkins-ci.plugins</groupId>
                  <artifactId>command-launcher</artifactId>
454
                  <version>1.2</version>
455 456
                  <type>hpi</type>
                </artifactItem>
457 458 459 460 461 462
                <artifactItem>
                  <groupId>org.jenkins-ci.plugins</groupId>
                  <artifactId>jdk-tool</artifactId>
                  <version>1.0</version>
                  <type>hpi</type>
                </artifactItem>
463 464 465 466 467 468
                <artifactItem>
                  <groupId>io.jenkins.plugins</groupId>
                  <artifactId>jaxb</artifactId>
                  <version>2.3.0</version>
                  <type>hpi</type>
                </artifactItem>
469 470 471
                <artifactItem>
                  <groupId>org.jenkins-ci.plugins</groupId>
                  <artifactId>trilead-api</artifactId>
472
                  <version>1.0.4</version>
473 474
                  <type>hpi</type>
                </artifactItem>
S
Stephen Connolly 已提交
475
              </artifactItems>
476
              <outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/detached-plugins</outputDirectory>
S
Stephen Connolly 已提交
477
              <stripVersion>true</stripVersion>
478 479 480
              <overWriteIfNewer>true</overWriteIfNewer>
              <overWriteReleases>false</overWriteReleases>
              <overWriteSnapshots>true</overWriteSnapshots>
481 482
            </configuration>
          </execution>
483 484
        </executions>
      </plugin>
485 486 487
      <plugin><!-- generate licenses.xml -->
        <groupId>com.cloudbees</groupId>
        <artifactId>maven-license-plugin</artifactId>
488
        <!-- version specified in grandparent pom -->
489
        <configuration>
S
Stephen Connolly 已提交
490
          <generateLicenseXml>${project.build.outputDirectory}/META-INF/licenses.xml</generateLicenseXml>
491 492
          <generateLicenseHtml>${project.build.outputDirectory}/META-INF/licenses.html</generateLicenseHtml>
          <attach>true</attach>
493 494 495 496 497 498 499 500 501 502 503
          <inlineScript>
            filter {
                // add Winstone since we are bundling it.
                def d = project.dependencies.find { it.artifactId=="winstone" };
                def a = mojo.artifactFactory.createProjectArtifact(d.groupId,d.artifactId,d.version);
                def p = mojo.projectBuilder.buildFromRepository(a, project.getRemoteArtifactRepositories(), mojo.localRepository)
                models.put(a,p);
            }
          </inlineScript>
        </configuration>
      </plugin>
K
kohsuke 已提交
504
      <plugin>
505
        <!-- this is really just a patched version of maven-jetty-plugin to workaround issue #932 -->
506 507
        <groupId>org.jenkins-ci.tools</groupId>
        <artifactId>maven-jenkins-dev-plugin</artifactId>
508
        <!-- version specified in grandparent pom -->
K
kohsuke 已提交
509
        <configuration>
510 511 512 513
          <!--
            Reload webapp when you hit ENTER. (See JETTY-282 for more)
          -->
          <reload>manual</reload>
514 515 516
          <httpConnector>
              <port>${port}</port>
          </httpConnector>
517
          <additionalClassesDirectories>
518
            <!-- load resources straight from source -->
519
            <additionalClassesDirectory>../core/src/main/resources</additionalClassesDirectory>
520

521 522 523 524 525 526
            <!--
              read directly from core module's output directory,
              so that changes are picked up right away without running mvn.
            -->
            <additionalClassesDirectory>../core/target/classes</additionalClassesDirectory>
          </additionalClassesDirectories>
527 528
          <loginServices>
            <loginService implementation="org.eclipse.jetty.security.HashLoginService">
529
              <name>default</name>
530
              <config>${basedir}/src/realm.properties</config>
531 532
            </loginService>
          </loginServices>
K
kohsuke 已提交
533 534
          <systemProperties>
            <systemProperty>
K
Kohsuke Kawaguchi 已提交
535 536
              <name>JENKINS_HOME</name>
              <value>${JENKINS_HOME}</value>
K
kohsuke 已提交
537 538 539 540
            </systemProperty>
            <systemProperty>
              <!-- always reload views during debugging -->
              <name>stapler.jelly.noCache</name>
541 542
              <value>true</value>
            </systemProperty>
543 544 545 546 547
            <systemProperty>
              <!-- show the stapler evaluation during execution -->
              <name>stapler.trace</name>
              <value>true</value>
            </systemProperty>
K
kohsuke 已提交
548 549 550 551 552
            <systemProperty>
              <!-- always reload scripts during debugging -->
              <name>hudson.script.noCache</name>
              <value>true</value>
            </systemProperty>
553 554 555
            <systemProperty>
              <!-- load view resources from the source directly, again for real time change -->
              <name>stapler.resourcePath</name>
W
wjprakash 已提交
556 557 558
              <value>
                  ../core/src/main/resources;
              </value>
K
kohsuke 已提交
559
            </systemProperty>
560
            <systemProperty>
561
              <!-- enable the plugins in main by default -->
562
              <name>hudson.bundled.plugins</name>
563
              <value><!-- run "mvn install" once will generate the.hpl -->
564
                  ${project.build.directory}/${project.build.finalName}/WEB-INF/plugins/*.hpi
W
wjprakash 已提交
565
              </value>
566
            </systemProperty>
567 568 569 570 571
            <systemProperty>
              <!-- stat collection pointless -->
              <name>hudson.model.UsageStatistics.disabled</name>
              <value>true</value>
            </systemProperty>
572 573 574 575
            <systemProperty>
              <name>hudson.Main.development</name>
              <value>true</value>
            </systemProperty>
576 577 578 579 580
            <systemProperty>
              <!-- this adds 3 sec to the shutdown, and most likely pointless, too -->
              <name>hudson.DNSMultiCast.disabled</name>
              <value>true</value>
            </systemProperty>
K
kohsuke 已提交
581
          </systemProperties>
582
          <webApp>
583
            <contextPath>${contextPath}</contextPath>
584
            <configurationDiscovered>false</configurationDiscovered>
585
            <webInfIncludeJarPattern>NONE</webInfIncludeJarPattern><!-- see https://wiki.eclipse.org/Jetty/Howto/Avoid_slow_deployment -->
586
          </webApp>
K
kohsuke 已提交
587 588
        </configuration>
      </plugin>
K
kohsuke 已提交
589 590
    </plugins>
  </build>
K
kohsuke 已提交
591

592
  <profiles>
593 594 595 596 597 598
    <profile>
      <!-- sign war -->
      <id>sign</id>
      <build>
        <plugins>
          <plugin>
S
Stephen Connolly 已提交
599
            <artifactId>maven-jarsigner-plugin</artifactId>
600 601 602
            <executions>
              <execution>
                <id>signWar</id>
603
                <phase>pre-integration-test</phase>
604
                <goals>
S
Stephen Connolly 已提交
605
                  <goal>sign</goal>
606 607
                </goals>
                <configuration>
608
                  <archive>${project.build.directory}/${project.build.finalName}.war</archive>
609 610 611 612
                  <arguments>
                    <argument>-tsa</argument>
                    <argument>http://timestamp.comodoca.com/rfc3161</argument>
                  </arguments>
613 614 615 616 617 618 619
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
620 621 622 623 624 625 626 627


    <!--
        The following profiles are required to integration the node/gulp build into this maven build.
        Hopefully we can push these profiles down into a parent pom.
        See https://github.com/tfennelly/jenkins-js-builder#maven-integration
    -->

628
    <profile>
629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650
      <id>gulp-execution</id>
      <activation>
        <file>
          <exists>gulpfile.js</exists>
        </file>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-enforcer-plugin</artifactId>
            <executions>
              <execution>
                <id>enforce-versions</id>
                <goals>
                  <goal>enforce</goal>
                </goals>
                <configuration>
                  <rules>
                    <requireMavenVersion>
                      <version>3.1.0</version>
                    </requireMavenVersion>
651 652 653 654
                    <requireJavaVersion>
                      <!-- let's encrypt certs used for https://updates.jenkins.io -->
                      <version>[1.8.0-101,]</version>
                    </requireJavaVersion>
655 656 657 658 659 660 661 662
                  </rules>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>com.github.eirslett</groupId>
            <artifactId>frontend-maven-plugin</artifactId>
663
            <version>1.6</version>
664
            <executions>
665

666 667
              <execution>
                <phase>initialize</phase>
668
                <id>install node and yarn</id>
669
                <goals>
670
                  <goal>install-node-and-yarn</goal>
671 672 673
                </goals>
                <configuration>
                  <nodeVersion>v${node.version}</nodeVersion>
674
                  <yarnVersion>v${yarn.version}</yarnVersion>
J
Jesse Glick 已提交
675
                  <nodeDownloadRoot>https://repo.jenkins-ci.org/nodejs-dist/</nodeDownloadRoot>
676
                  <!-- tried to create a mirror for yarnDownloadRoot but it did not work -->
677 678
                </configuration>
              </execution>
679

680 681
              <execution>
                <phase>initialize</phase>
682
                <id>yarn install</id>
683
                <goals>
684
                  <goal>yarn</goal>
685 686
                </goals>
                <configuration>
687 688 689
                  <!-- ensure only one concurrent 'yarn install' -->
                  <!-- when yarn cache is empty, multiple yarns performing network fetches frequently results in opaque errors -->
                  <arguments>--mutex network</arguments>
690 691
                </configuration>
              </execution>
692

693 694 695 696 697 698 699
              <execution>
                <phase>generate-sources</phase>
                <id>gulp bundle</id>
                <goals>
                  <goal>gulp</goal>
                </goals>
                <configuration>
700
                  <arguments>jshint bundle</arguments>
701 702
                </configuration>
              </execution>
703

704 705 706 707 708 709 710 711 712 713 714
              <execution>
                <phase>test</phase>
                <id>gulp test</id>
                <goals>
                  <goal>gulp</goal>
                </goals>
                <configuration>
                  <arguments>bundle test</arguments>
                  <skip>${skipTests}</skip>
                </configuration>
              </execution>
715

716 717 718 719
            </executions>
          </plugin>
        </plugins>
      </build>
720
    </profile>
721 722

    <profile>
723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751
      <id>clean-node</id>
      <activation>
        <file>
          <exists>package.json</exists>
        </file>
        <property>
          <name>cleanNode</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-clean-plugin</artifactId>
            <configuration>
              <filesets>
                <fileset>
                  <directory>node</directory>
                  <followSymlinks>false</followSymlinks>
                </fileset>
                <fileset>
                  <directory>node_modules</directory>
                  <followSymlinks>false</followSymlinks>
                </fileset>
              </filesets>
            </configuration>
          </plugin>
        </plugins>
      </build>
752
    </profile>
753
  </profiles>
754
</project>