pom.xml 27.7 KB
Newer Older
K
kohsuke 已提交
1 2 3
<!--
The MIT License

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

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.
-->
24
<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 已提交
25
  <modelVersion>4.0.0</modelVersion>
26

K
kohsuke 已提交
27
  <parent>
28
    <groupId>org.jenkins-ci.main</groupId>
29
    <artifactId>jenkins-parent</artifactId>
30
    <version>2.253</version>
K
kohsuke 已提交
31
  </parent>
32

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

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

  <properties>
    <JENKINS_HOME>${basedir}/work</JENKINS_HOME>
41
    <contextPath>/jenkins</contextPath><!-- context path during test -->
42
    <host>localhost</host><!-- HTTP listener host/interface -->
43
    <port>8080</port><!-- HTTP listener port -->
44
    <node.version>12.14.1</node.version>
45
    <yarn.version>1.21.1</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>
J
James Nord 已提交
84 85 86 87
        <exclusion>
          <groupId>com.google.code.findbugs</groupId>
          <artifactId>jsr305</artifactId>
        </exclusion>
88 89 90 91 92
      </exclusions>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>remoting</artifactId>
93
      <!-- specified in the parent -->
94
    </dependency>
95 96 97 98 99 100 101
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>cli</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <!--
S
Stephen Connolly 已提交
102
        not actually used by test but used by dependency plugin to include it inside the war.
103 104 105
      -->
      <groupId>org.jenkins-ci</groupId>
      <artifactId>winstone</artifactId>
106
      <version>5.10</version>
107 108 109 110 111
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.modules</groupId>
      <artifactId>instance-identity</artifactId>
112
    </dependency>
113
    <dependency>
114 115
      <groupId>org.jenkins-ci.modules</groupId>
      <artifactId>ssh-cli-auth</artifactId>
116 117 118 119
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.modules</groupId>
      <artifactId>slave-installer</artifactId>
120
    </dependency>
K
Kohsuke Kawaguchi 已提交
121 122 123 124
    <dependency>
      <groupId>org.jenkins-ci.modules</groupId>
      <artifactId>windows-slave-installer</artifactId>
    </dependency>
125 126 127
    <dependency>
      <groupId>org.jenkins-ci.modules</groupId>
      <artifactId>launchd-slave-installer</artifactId>
K
Kohsuke Kawaguchi 已提交
128 129 130 131
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.modules</groupId>
      <artifactId>upstart-slave-installer</artifactId>
132
    </dependency>
133 134 135 136
    <dependency>
      <groupId>org.jenkins-ci.modules</groupId>
      <artifactId>systemd-slave-installer</artifactId>
    </dependency>
137 138 139 140
    <dependency>
      <groupId>org.jenkins-ci.modules</groupId>
      <artifactId>sshd</artifactId>
    </dependency>
141 142 143
    <dependency>
      <groupId>org.jenkins-ci.ui</groupId>
      <artifactId>jquery-detached</artifactId>
144
      <version>1.2.1</version>
145 146 147 148 149
      <classifier>core-assets</classifier>
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.ui</groupId>
      <artifactId>bootstrap</artifactId>
150
      <version>1.3.2</version>
151
      <classifier>core-assets</classifier>
152 153 154 155 156 157
      <exclusions>
        <exclusion>
          <groupId>org.jenkins-ci.ui</groupId>
          <artifactId>jquery-detached</artifactId>
        </exclusion>
      </exclusions>
158 159 160 161
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.ui</groupId>
      <artifactId>handlebars</artifactId>
162
      <version>1.1.1</version>
163 164
      <classifier>core-assets</classifier>
    </dependency>
165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186
    <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>

187
    <!-- offline profiler API when we need it -->
188
    <!--dependency
189 190 191 192 193 194 195 196
      <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 已提交
197
  <build>
K
Kohsuke Kawaguchi 已提交
198
    <finalName>jenkins</finalName>
K
kohsuke 已提交
199 200 201
    <plugins>
      <plugin>
        <artifactId>maven-war-plugin</artifactId>
202
        <!-- version specified in grandparent pom -->
K
kohsuke 已提交
203
        <configuration>
J
jieryn 已提交
204
          <filteringDeploymentDescriptors>true</filteringDeploymentDescriptors>
K
kohsuke 已提交
205 206
          <!-- for putting Main-Class into war -->
          <archive>
J
jglick 已提交
207
            <manifest>
K
kohsuke 已提交
208 209
              <mainClass>Main</mainClass>
            </manifest>
210 211
            <manifestEntries>
              <Implementation-Version>${project.version}</Implementation-Version>
212
              <Hudson-Version>1.395</Hudson-Version>
213
              <Jenkins-Version>${project.version}</Jenkins-Version>
214 215
              <Remoting-Embedded-Version>${remoting.version}</Remoting-Embedded-Version>
              <Remoting-Minimum-Supported-Version>${remoting.minimum.supported.version}</Remoting-Minimum-Supported-Version>
216
            </manifestEntries>
K
kohsuke 已提交
217
          </archive>
218
          <!--outputFileNameMapping>@{artifactId}@.@{extension}@</outputFileNameMapping-->
K
kohsuke 已提交
219 220
        </configuration>
      </plugin>
221 222
      <plugin>
        <artifactId>maven-dependency-plugin</artifactId>
223
        <!-- version specified in grandparent pom -->
224 225
        <executions>
          <execution>
226
            <id>list-dependencies</id>
227 228 229 230 231
            <phase>generate-resources</phase>
            <goals>
              <goal>list</goal>
            </goals>
            <configuration>
S
Stephen Connolly 已提交
232
              <outputFile>${project.build.outputDirectory}/dependencies.txt</outputFile>
233 234
            </configuration>
          </execution>
235 236 237 238 239 240 241 242 243 244 245 246
          <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>
247
              <outputDirectory>${project.build.directory}/${project.build.finalName}</outputDirectory>
S
Stephen Connolly 已提交
248 249 250 251 252 253 254 255 256 257 258 259 260 261
            </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>org.jenkins-ci</groupId>
                  <artifactId>winstone</artifactId>
262
                  <outputDirectory>${project.build.directory}/${project.build.finalName}</outputDirectory>
S
Stephen Connolly 已提交
263 264
                  <destFileName>winstone.jar</destFileName>
                </artifactItem>
265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283
              </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 已提交
284
                <artifactItem>
K
oops  
Kohsuke Kawaguchi 已提交
285
                  <groupId>org.jenkins-ci.plugins</groupId>
S
Stephen Connolly 已提交
286
                  <artifactId>cvs</artifactId>
J
Jesse Glick 已提交
287
                  <version>2.11</version>
S
Stephen Connolly 已提交
288 289
                  <type>hpi</type>
                </artifactItem>
290 291 292
                <artifactItem>
                  <groupId>org.jenkins-ci.plugins</groupId>
                  <artifactId>ant</artifactId>
293
                  <version>1.8</version>
294 295
                  <type>hpi</type>
                </artifactItem>
296 297 298
                <artifactItem>
                  <groupId>org.jenkins-ci.plugins</groupId>
                  <artifactId>javadoc</artifactId>
J
Jesse Glick 已提交
299
                  <version>1.1</version>
300 301
                  <type>hpi</type>
                </artifactItem>
302 303 304
                <artifactItem>
                  <groupId>org.jenkins-ci.plugins</groupId>
                  <artifactId>external-monitor-job</artifactId>
305
                  <version>1.4</version>
306 307
                  <type>hpi</type>
                </artifactItem>
308 309 310
                <artifactItem>
                  <groupId>org.jenkins-ci.plugins</groupId>
                  <artifactId>ldap</artifactId>
311
                  <version>1.22</version>
312 313 314 315 316
                  <type>hpi</type>
                </artifactItem>
                <artifactItem>
                  <groupId>org.jenkins-ci.plugins</groupId>
                  <artifactId>pam-auth</artifactId>
317
                  <version>1.5.1</version>
318 319
                  <type>hpi</type>
                </artifactItem>
320 321 322 323 324 325
                <artifactItem>
                  <groupId>org.jenkins-ci.plugins</groupId>
                  <artifactId>display-url-api</artifactId>
                  <version>2.0</version>
                  <type>hpi</type>
                </artifactItem>
O
Oliver Gondža 已提交
326 327 328
                <artifactItem>
                  <groupId>org.jenkins-ci.plugins</groupId>
                  <artifactId>mailer</artifactId>
329
                  <version>1.21</version>
O
Oliver Gondža 已提交
330 331
                  <type>hpi</type>
                </artifactItem>
J
Jesse Glick 已提交
332 333 334
                <artifactItem>
                  <groupId>org.jenkins-ci.plugins</groupId>
                  <artifactId>matrix-auth</artifactId>
335
                  <version>${matrix-auth.version}</version>
J
Jesse Glick 已提交
336 337
                  <type>hpi</type>
                </artifactItem>
J
Jesse Glick 已提交
338 339 340 341 342 343
                <artifactItem>
                  <groupId>org.jenkins-ci.plugins</groupId>
                  <artifactId>windows-slaves</artifactId>
                  <version>1.0</version>
                  <type>hpi</type>
                </artifactItem>
344 345 346
                <artifactItem>
                  <groupId>org.jenkins-ci.plugins</groupId>
                  <artifactId>antisamy-markup-formatter</artifactId>
J
Jesse Glick 已提交
347
                  <version>1.1</version>
348 349
                  <type>hpi</type>
                </artifactItem>
350 351 352
                <artifactItem>
                  <groupId>org.jenkins-ci.plugins</groupId>
                  <artifactId>matrix-project</artifactId>
353
                  <version>${matrix-project.version}</version>
354 355 356 357 358
                  <type>hpi</type>
                </artifactItem>
                <artifactItem>
                  <groupId>org.jenkins-ci.plugins</groupId>
                  <artifactId>script-security</artifactId>
359
                  <version>1.73</version>
360 361
                  <type>hpi</type>
                </artifactItem>
362 363 364
                <artifactItem>
                  <groupId>org.jenkins-ci.plugins</groupId>
                  <artifactId>junit</artifactId>
365
                  <version>1.29</version>
366 367 368 369 370 371
                  <type>hpi</type>
                </artifactItem>
                <artifactItem>
                  <!-- dependency of junit -->
                  <groupId>org.jenkins-ci.plugins.workflow</groupId>
                  <artifactId>workflow-api</artifactId>
372
                  <version>2.40</version>
373 374 375 376 377 378
                  <type>hpi</type>
                </artifactItem>
                <artifactItem>
                  <!-- dependency of junit -->
                  <groupId>org.jenkins-ci.plugins.workflow</groupId>
                  <artifactId>workflow-step-api</artifactId>
379
                  <version>2.22</version>
380 381 382 383 384 385 386 387 388 389 390 391 392
                  <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>
393
                  <version>1.20</version>
394 395
                  <type>hpi</type>
                </artifactItem>
396 397 398
                <artifactItem>
                  <groupId>org.jenkins-ci.plugins</groupId>
                  <artifactId>bouncycastle-api</artifactId>
399
                  <version>2.16.0</version>
400 401
                  <type>hpi</type>
                </artifactItem>
402 403 404
                <artifactItem>
                  <groupId>org.jenkins-ci.plugins</groupId>
                  <artifactId>command-launcher</artifactId>
405
                  <version>1.2</version>
406 407
                  <type>hpi</type>
                </artifactItem>
408 409 410 411 412 413
                <artifactItem>
                  <groupId>org.jenkins-ci.plugins</groupId>
                  <artifactId>jdk-tool</artifactId>
                  <version>1.0</version>
                  <type>hpi</type>
                </artifactItem>
414 415 416 417 418 419
                <artifactItem>
                  <groupId>io.jenkins.plugins</groupId>
                  <artifactId>jaxb</artifactId>
                  <version>2.3.0</version>
                  <type>hpi</type>
                </artifactItem>
420 421 422
                <artifactItem>
                  <groupId>org.jenkins-ci.plugins</groupId>
                  <artifactId>trilead-api</artifactId>
423
                  <version>1.0.4</version>
424 425
                  <type>hpi</type>
                </artifactItem>
S
Stephen Connolly 已提交
426
              </artifactItems>
427
              <outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/detached-plugins</outputDirectory>
S
Stephen Connolly 已提交
428
              <stripVersion>true</stripVersion>
429 430 431
              <overWriteIfNewer>true</overWriteIfNewer>
              <overWriteReleases>false</overWriteReleases>
              <overWriteSnapshots>true</overWriteSnapshots>
432 433
            </configuration>
          </execution>
434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454
          <execution> <!-- see jetty-maven-plugin config and WebAppMain -->
            <id>support-log-formatter</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>copy</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>io.jenkins.lib</groupId>
                  <artifactId>support-log-formatter</artifactId>
                  <version>1.0</version>
                </artifactItem>
              </artifactItems>
              <outputDirectory>${project.build.directory}</outputDirectory>
              <stripVersion>true</stripVersion>
              <overWriteIfNewer>true</overWriteIfNewer>
              <overWriteReleases>false</overWriteReleases>
              <overWriteSnapshots>true</overWriteSnapshots>
            </configuration>
          </execution>
455 456
        </executions>
      </plugin>
457 458 459
      <plugin><!-- generate licenses.xml -->
        <groupId>com.cloudbees</groupId>
        <artifactId>maven-license-plugin</artifactId>
460
        <!-- version specified in grandparent pom -->
461
        <configuration>
S
Stephen Connolly 已提交
462
          <generateLicenseXml>${project.build.outputDirectory}/META-INF/licenses.xml</generateLicenseXml>
463 464
          <generateLicenseHtml>${project.build.outputDirectory}/META-INF/licenses.html</generateLicenseHtml>
          <attach>true</attach>
465 466 467 468 469 470 471 472 473 474 475
          <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 已提交
476
      <plugin>
477 478 479
        <groupId>org.eclipse.jetty</groupId>
        <artifactId>jetty-maven-plugin</artifactId>
        <version>9.4.22.v20191022</version>
K
kohsuke 已提交
480
        <configuration>
481 482 483 484
          <!--
            Reload webapp when you hit ENTER. (See JETTY-282 for more)
          -->
          <reload>manual</reload>
485
          <httpConnector>
486 487
            <host>${host}</host>
            <port>${port}</port>
488
          </httpConnector>
489 490
          <loginServices>
            <loginService implementation="org.eclipse.jetty.security.HashLoginService">
491
              <name>default</name>
492
              <config>${basedir}/src/realm.properties</config>
493 494
            </loginService>
          </loginServices>
K
kohsuke 已提交
495 496
          <systemProperties>
            <systemProperty>
K
Kohsuke Kawaguchi 已提交
497 498
              <name>JENKINS_HOME</name>
              <value>${JENKINS_HOME}</value>
K
kohsuke 已提交
499 500 501 502
            </systemProperty>
            <systemProperty>
              <!-- always reload views during debugging -->
              <name>stapler.jelly.noCache</name>
503 504
              <value>true</value>
            </systemProperty>
505 506 507 508 509
            <systemProperty>
              <!-- show the stapler evaluation during execution -->
              <name>stapler.trace</name>
              <value>true</value>
            </systemProperty>
J
Jeff Thompson 已提交
510 511 512 513 514
            <systemProperty>
              <!-- show the full stack trace on errors (the oops page) -->
              <name>jenkins.model.Jenkins.SHOW_STACK_TRACE</name>
              <value>true</value>
            </systemProperty>
K
kohsuke 已提交
515 516 517 518 519
            <systemProperty>
              <!-- always reload scripts during debugging -->
              <name>hudson.script.noCache</name>
              <value>true</value>
            </systemProperty>
520 521 522
            <systemProperty>
              <!-- load view resources from the source directly, again for real time change -->
              <name>stapler.resourcePath</name>
W
wjprakash 已提交
523 524 525
              <value>
                  ../core/src/main/resources;
              </value>
K
kohsuke 已提交
526
            </systemProperty>
527
            <systemProperty>
528
              <!-- enable the plugins in main by default -->
529
              <name>hudson.bundled.plugins</name>
530
              <value><!-- run "mvn install" once will generate the.hpl -->
531
                  ${project.build.directory}/${project.build.finalName}/WEB-INF/plugins/*.hpi
W
wjprakash 已提交
532
              </value>
533
            </systemProperty>
534 535 536 537 538
            <systemProperty>
              <!-- stat collection pointless -->
              <name>hudson.model.UsageStatistics.disabled</name>
              <value>true</value>
            </systemProperty>
539 540 541 542
            <systemProperty>
              <name>hudson.Main.development</name>
              <value>true</value>
            </systemProperty>
K
kohsuke 已提交
543
          </systemProperties>
544
          <webApp>
545 546
            <!-- Allows resources to be reloaded, and enable nicer console logging. -->
            <extraClasspath>${project.basedir}/../core/src/main/resources,${project.basedir}/../core/target/classes,${project.build.directory}/support-log-formatter.jar</extraClasspath>
547
            <contextPath>${contextPath}</contextPath>
548
            <configurationDiscovered>false</configurationDiscovered>
549
            <webInfIncludeJarPattern>NONE</webInfIncludeJarPattern><!-- see https://wiki.eclipse.org/Jetty/Howto/Avoid_slow_deployment -->
550
          </webApp>
K
kohsuke 已提交
551 552
        </configuration>
      </plugin>
K
kohsuke 已提交
553 554
    </plugins>
  </build>
K
kohsuke 已提交
555

556
  <profiles>
557 558 559 560 561 562
    <profile>
      <!-- sign war -->
      <id>sign</id>
      <build>
        <plugins>
          <plugin>
S
Stephen Connolly 已提交
563
            <artifactId>maven-jarsigner-plugin</artifactId>
564 565 566
            <executions>
              <execution>
                <id>signWar</id>
567
                <phase>pre-integration-test</phase>
568
                <goals>
S
Stephen Connolly 已提交
569
                  <goal>sign</goal>
570 571
                </goals>
                <configuration>
572
                  <archive>${project.build.directory}/${project.build.finalName}.war</archive>
573 574
                  <arguments>
                    <argument>-tsa</argument>
575
                    <argument>http://timestamp.digicert.com</argument>
576
                  </arguments>
577 578 579 580 581 582 583
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
584 585 586


    <!--
587
        The following profiles are required to integration the node/yarn build into this maven build.
588 589
        Hopefully we can push these profiles down into a parent pom.
    -->
590
    <profile>
591
      <id>yarn-execution</id>
592 593
      <activation>
        <file>
594
          <exists>package.json</exists>
595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612
        </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>
613 614 615 616
                    <requireJavaVersion>
                      <!-- let's encrypt certs used for https://updates.jenkins.io -->
                      <version>[1.8.0-101,]</version>
                    </requireJavaVersion>
617 618 619 620 621 622 623 624
                  </rules>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>com.github.eirslett</groupId>
            <artifactId>frontend-maven-plugin</artifactId>
625
            <version>1.6</version>
626
            <executions>
627

628 629
              <execution>
                <phase>initialize</phase>
630
                <id>install node and yarn</id>
631
                <goals>
632
                  <goal>install-node-and-yarn</goal>
633 634 635
                </goals>
                <configuration>
                  <nodeVersion>v${node.version}</nodeVersion>
636
                  <yarnVersion>v${yarn.version}</yarnVersion>
J
Jesse Glick 已提交
637
                  <nodeDownloadRoot>https://repo.jenkins-ci.org/nodejs-dist/</nodeDownloadRoot>
638
                  <!-- tried to create a mirror for yarnDownloadRoot but it did not work -->
639 640
                </configuration>
              </execution>
641

642 643
              <execution>
                <phase>initialize</phase>
644
                <id>yarn install</id>
645
                <goals>
646
                  <goal>yarn</goal>
647 648
                </goals>
                <configuration>
649 650 651
                  <!-- 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>
652 653
                </configuration>
              </execution>
654

655 656
              <execution>
                <phase>generate-sources</phase>
657
                <id>yarn build</id>
658
                <goals>
659
                  <goal>yarn</goal>
660 661
                </goals>
                <configuration>
662
                  <arguments>build</arguments>
663 664
                </configuration>
              </execution>
665

666 667
              <execution>
                <phase>test</phase>
F
Félix Queiruga 已提交
668
                <id>yarn test</id>
669
                <goals>
F
Félix Queiruga 已提交
670
                  <goal>yarn</goal>
671 672
                </goals>
                <configuration>
F
Félix Queiruga 已提交
673
                  <arguments>test</arguments>
674 675 676
                  <skip>${skipTests}</skip>
                </configuration>
              </execution>
677

678 679 680 681 682 683 684 685 686 687 688
              <execution>
                <phase>test</phase>
                <id>yarn lint</id>
                <goals>
                  <goal>yarn</goal>
                </goals>
                <configuration>
                  <arguments>lint</arguments>
                  <skip>${skipTests}</skip>
                </configuration>
              </execution>
689 690 691 692
            </executions>
          </plugin>
        </plugins>
      </build>
693
    </profile>
694 695

    <profile>
696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724
      <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>
725
    </profile>
726
  </profiles>
727
</project>