pom.xml 26.9 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
    <host>localhost</host><!-- HTTP listener host/interface -->
44
    <port>8080</port><!-- HTTP listener port -->
45
    <node.version>12.14.1</node.version>
46
    <yarn.version>1.21.1</yarn.version>
47 48
  </properties>

49 50 51 52 53 54 55 56 57 58 59 60
  <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>

61
  <dependencies>
62 63 64
    <dependency>
      <groupId>org.jenkins-ci</groupId>
      <artifactId>executable-war</artifactId>
65
      <version>1.45</version>
66 67
      <scope>provided</scope>
    </dependency>
68 69 70 71 72 73 74 75 76
    <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>
77 78
          <groupId>javax.servlet.jsp</groupId>
          <artifactId>javax.servlet.jsp-api</artifactId>
79
        </exclusion>
80 81 82 83 84
        <!-- 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>
85 86 87 88 89
      </exclusions>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>remoting</artifactId>
90
      <!-- specified in the parent -->
91
    </dependency>
92 93 94 95 96 97 98
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>cli</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <!--
S
Stephen Connolly 已提交
99
        not actually used by test but used by dependency plugin to include it inside the war.
100 101 102
      -->
      <groupId>org.jenkins-ci</groupId>
      <artifactId>winstone</artifactId>
103
      <version>5.9</version>
104 105 106 107 108
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.modules</groupId>
      <artifactId>instance-identity</artifactId>
109
      <version>2.2</version>
110
    </dependency>
111
    <dependency>
112 113
      <groupId>org.jenkins-ci.modules</groupId>
      <artifactId>ssh-cli-auth</artifactId>
T
Tim Jacomb 已提交
114
      <version>1.8</version>
115 116 117 118
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.modules</groupId>
      <artifactId>slave-installer</artifactId>
119
      <version>1.7</version>
120
    </dependency>
K
Kohsuke Kawaguchi 已提交
121 122 123
    <dependency>
      <groupId>org.jenkins-ci.modules</groupId>
      <artifactId>windows-slave-installer</artifactId>
124
      <version>1.12</version>
K
Kohsuke Kawaguchi 已提交
125
    </dependency>
126 127 128
    <dependency>
      <groupId>org.jenkins-ci.modules</groupId>
      <artifactId>launchd-slave-installer</artifactId>
129
      <version>1.2</version>
K
Kohsuke Kawaguchi 已提交
130 131 132 133
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.modules</groupId>
      <artifactId>upstart-slave-installer</artifactId>
134
      <version>1.1</version>
135
    </dependency>
136 137 138
    <dependency>
      <groupId>org.jenkins-ci.modules</groupId>
      <artifactId>systemd-slave-installer</artifactId>
139
      <version>1.1</version>
140
    </dependency>
141 142 143
    <dependency>
      <groupId>org.jenkins-ci.modules</groupId>
      <artifactId>sshd</artifactId>
144
      <version>2.6</version>
145
    </dependency>
146 147 148
    <dependency>
      <groupId>org.jenkins-ci.ui</groupId>
      <artifactId>jquery-detached</artifactId>
149
      <version>1.2.1</version>
150 151 152 153 154
      <classifier>core-assets</classifier>
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.ui</groupId>
      <artifactId>bootstrap</artifactId>
155
      <version>1.3.2</version>
156
      <classifier>core-assets</classifier>
157 158 159 160 161 162
      <exclusions>
        <exclusion>
          <groupId>org.jenkins-ci.ui</groupId>
          <artifactId>jquery-detached</artifactId>
        </exclusion>
      </exclusions>
163 164 165 166
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.ui</groupId>
      <artifactId>handlebars</artifactId>
167
      <version>1.1.1</version>
168 169
      <classifier>core-assets</classifier>
    </dependency>
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191
    <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>

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

540
  <profiles>
541 542 543 544 545 546
    <profile>
      <!-- sign war -->
      <id>sign</id>
      <build>
        <plugins>
          <plugin>
S
Stephen Connolly 已提交
547
            <artifactId>maven-jarsigner-plugin</artifactId>
548 549 550
            <executions>
              <execution>
                <id>signWar</id>
551
                <phase>pre-integration-test</phase>
552
                <goals>
S
Stephen Connolly 已提交
553
                  <goal>sign</goal>
554 555
                </goals>
                <configuration>
556
                  <archive>${project.build.directory}/${project.build.finalName}.war</archive>
557 558 559 560
                  <arguments>
                    <argument>-tsa</argument>
                    <argument>http://timestamp.comodoca.com/rfc3161</argument>
                  </arguments>
561 562 563 564 565 566 567
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
568 569 570


    <!--
571
        The following profiles are required to integration the node/yarn build into this maven build.
572 573
        Hopefully we can push these profiles down into a parent pom.
    -->
574
    <profile>
575
      <id>yarn-execution</id>
576 577
      <activation>
        <file>
578
          <exists>package.json</exists>
579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596
        </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>
597 598 599 600
                    <requireJavaVersion>
                      <!-- let's encrypt certs used for https://updates.jenkins.io -->
                      <version>[1.8.0-101,]</version>
                    </requireJavaVersion>
601 602 603 604 605 606 607 608
                  </rules>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>com.github.eirslett</groupId>
            <artifactId>frontend-maven-plugin</artifactId>
609
            <version>1.6</version>
610
            <executions>
611

612 613
              <execution>
                <phase>initialize</phase>
614
                <id>install node and yarn</id>
615
                <goals>
616
                  <goal>install-node-and-yarn</goal>
617 618 619
                </goals>
                <configuration>
                  <nodeVersion>v${node.version}</nodeVersion>
620
                  <yarnVersion>v${yarn.version}</yarnVersion>
J
Jesse Glick 已提交
621
                  <nodeDownloadRoot>https://repo.jenkins-ci.org/nodejs-dist/</nodeDownloadRoot>
622
                  <!-- tried to create a mirror for yarnDownloadRoot but it did not work -->
623 624
                </configuration>
              </execution>
625

626 627
              <execution>
                <phase>initialize</phase>
628
                <id>yarn install</id>
629
                <goals>
630
                  <goal>yarn</goal>
631 632
                </goals>
                <configuration>
633 634 635
                  <!-- 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>
636 637
                </configuration>
              </execution>
638

639 640
              <execution>
                <phase>generate-sources</phase>
641
                <id>yarn build</id>
642
                <goals>
643
                  <goal>yarn</goal>
644 645
                </goals>
                <configuration>
646
                  <arguments>build</arguments>
647 648
                </configuration>
              </execution>
649

650 651
              <execution>
                <phase>test</phase>
F
Félix Queiruga 已提交
652
                <id>yarn test</id>
653
                <goals>
F
Félix Queiruga 已提交
654
                  <goal>yarn</goal>
655 656
                </goals>
                <configuration>
F
Félix Queiruga 已提交
657
                  <arguments>test</arguments>
658 659 660
                  <skip>${skipTests}</skip>
                </configuration>
              </execution>
661

662 663 664 665 666 667 668 669 670 671 672
              <execution>
                <phase>test</phase>
                <id>yarn lint</id>
                <goals>
                  <goal>yarn</goal>
                </goals>
                <configuration>
                  <arguments>lint</arguments>
                  <skip>${skipTests}</skip>
                </configuration>
              </execution>
673 674 675 676
            </executions>
          </plugin>
        </plugins>
      </build>
677
    </profile>
678 679

    <profile>
680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708
      <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>
709
    </profile>
710
  </profiles>
711
</project>