Skip to main content
summaryrefslogtreecommitdiffstats
blob: adef978f46562465280793b7cc72da4e99c655f7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
<html><head>
      <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
   <title>Configuring the Jetty Maven Plugin</title><link rel="stylesheet" type="text/css" href="css/docbook.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"><meta name="keywords" content="jetty, servlet, servlet-api, cometd, http, websocket, eclipse, maven, java, server, software"><link rel="home" href="index.html" title="Jetty"><link rel="up" href="maven-and-jetty.html" title="Chapter&nbsp;23.&nbsp;Maven and Jetty"><link rel="prev" href="maven-and-jetty.html" title="Chapter&nbsp;23.&nbsp;Maven and Jetty"><link rel="next" href="jetty-maven-scanning.html" title="Files Scanned by the Jetty Maven Plugin"><link xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times" rel="shortcut icon" href="images/favicon.ico"><link rel="stylesheet" href="css/highlighter/foundation.css"><script src="js/highlight.pack.js"></script><script>
      hljs.initHighlightingOnLoad();
    </script><link type="text/css" rel="stylesheet" href="css/font-awesome/font-awesome.min.css"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><tr><td style="width: 25%"><a href="http://www.eclipse.org/jetty"><img src="images/jetty-header-logo.png" alt="Jetty Logo"></a><br><span style="font-size: small">
            Version: 9.4.0-SNAPSHOT</span></td><td style="width: 50%"><script type="text/javascript">  (function() {
            var cx = '016459005284625897022:obd4lsai2ds';
            var gcse = document.createElement('script');
            gcse.type = 'text/javascript';
            gcse.async = true;
            gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
            '//www.google.com/cse/cse.js?cx=' + cx;
            var s = document.getElementsByTagName('script')[0];
            s.parentNode.insertBefore(gcse, s);
            })();
          </script><gcse:search></gcse:search></td></tr></table><div xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times" class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Configuring the Jetty Maven Plugin</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="maven-and-jetty.html"><i class="fa fa-chevron-left" aria-hidden="true"></i> Previous</a>&nbsp;</td><th width="60%" align="center">Chapter&nbsp;23.&nbsp;Maven and Jetty<br><a accesskey="p" href="index.html"><i class="fa fa-home" aria-hidden="true"></i> Home</a></th><td width="20%" align="right">&nbsp;<a accesskey="n" href="jetty-maven-scanning.html">Next <i class="fa fa-chevron-right" aria-hidden="true"></i></a></td></tr></table><hr></div><div xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times" class="jetty-callout"><h5 class="callout"><a href="http://www.webtide.com/">Contact the core Jetty developers at
          <span class="website">www.webtide.com</span></a></h5><p>
 private support for your internal/customer projects ... custom extensions and distributions ... versioned snapshots for indefinite support ...
 scalability guidance for your apps and Ajax/Comet projects ... development services for sponsored feature development
      </p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="jetty-maven-plugin"></a>Configuring the Jetty Maven Plugin</h2></div></div></div><div class="toc"><dl class="toc"><dt><span class="section"><a href="jetty-maven-plugin.html#get-up-and-running">Quick Start: Get Up and Running</a></span></dt><dt><span class="section"><a href="jetty-maven-plugin.html#running-and-deploying">Supported Goals</a></span></dt><dt><span class="section"><a href="jetty-maven-plugin.html#configuring-jetty-container">Configuring the Jetty Container</a></span></dt><dt><span class="section"><a href="jetty-maven-plugin.html#configuring-your-webapp">Configuring Your WebApp</a></span></dt><dt><span class="section"><a href="jetty-maven-plugin.html#jetty-run-goal">jetty:run</a></span></dt><dt><span class="section"><a href="jetty-maven-plugin.html#running-assembled-webapp-as-war">jetty:run-war</a></span></dt><dt><span class="section"><a href="jetty-maven-plugin.html#running-assembled-webapp-as-expanded-war">jetty:run-exploded</a></span></dt><dt><span class="section"><a href="jetty-maven-plugin.html#deploy-war-running-pre-assembled-war">jetty:deploy-war</a></span></dt><dt><span class="section"><a href="jetty-maven-plugin.html#jetty-run-forked-goal">jetty:run-forked</a></span></dt><dt><span class="section"><a href="jetty-maven-plugin.html#jetty-start-goal">jetty:start</a></span></dt><dt><span class="section"><a href="jetty-maven-plugin.html#jetty-stop-goal">jetty:stop</a></span></dt><dt><span class="section"><a href="jetty-maven-plugin.html#jetty-effective-web-xml">jetty:effective-web-xml</a></span></dt><dt><span class="section"><a href="jetty-maven-plugin.html#using-overlaid-wars">Using Overlaid wars</a></span></dt><dt><span class="section"><a href="jetty-maven-plugin.html#configuring-security-settings">Configuring Security Settings</a></span></dt><dt><span class="section"><a href="jetty-maven-plugin.html#using-multiple-webapp-root-directories">Using Multiple Webapp Root Directories</a></span></dt><dt><span class="section"><a href="jetty-maven-plugin.html#running-more-than-one-webapp">Running More than One Webapp</a></span></dt><dt><span class="section"><a href="jetty-maven-plugin.html#setting-system-properties">Setting System Properties</a></span></dt></dl></div><p>The Jetty Maven plugin is useful for rapid development and testing.
You can add it to any webapp project that is structured according to the Maven defaults.
The plugin can then periodically scan your project for changes and automatically redeploy the webapp if any are found.
This makes the development cycle more productive by eliminating the build and deploy steps: you use your IDE to make changes to the project, and the running web container automatically picks them up, allowing you to test them straight away.</p><div class="blockquote"><blockquote class="blockquote"><div xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times" class="important" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title"><i class="fa fa-plus" aria-hidden="true"></i> Important</h3><p>You should use Maven 3.3+ for this plugin.</p></div></blockquote></div><p>While the Jetty Maven Plugin can be very useful for development we do not recommend its use in a production capacity.
In order for the plugin to work it needs to leverage many internal Maven apis and Maven itself it not a production deployment tool.
We recommend either the traditional distribution deployment approach or using <a class="link" href="advanced-embedding.html" title="Chapter&nbsp;21.&nbsp;Embedding">embedded Jetty.</a></p><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="get-up-and-running"></a>Quick Start: Get Up and Running</h3></div></div></div><p>First, add <code class="literal">jetty-maven-plugin</code> to your <code class="literal">pom.xml</code> definition:</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>&lt;plugin&gt;
  &lt;groupId&gt;org.eclipse.jetty&lt;/groupId&gt;
  &lt;artifactId&gt;jetty-maven-plugin&lt;/artifactId&gt;
  &lt;version&gt;9.4.0-SNAPSHOT&lt;/version&gt;
&lt;/plugin&gt;</code></pre><p>Then, from the same directory as your root <code class="literal">pom.xml</code>, type:</p><div class="screenexample"><pre class="screen">mvn jetty:run</pre></div><p>This starts Jetty and serves up your project on <a class="link" href="http://localhost:8080/" target="_top">http://localhost:8080/</a>.</p><p>Jetty will continue to run until you stop it.
While it runs it periodically scans for changes to your project files
If you save changes and recompile your class files, Jetty redeploys your webapp, and you can instantly test the changes that were just made.</p><p>You can terminate the plugin with a <code class="literal">ctrl-c</code> in the terminal window where it is running.</p><div class="blockquote"><blockquote class="blockquote"><div xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times" class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title"><i class="fa fa-asterisk" aria-hidden="true"></i> Note</h3><p>The classpath of the running Jetty instance and its deployed webapp are managed by Maven, and may not be exactly what you expect.
For example: a webapp&#8217;s dependent jars might be referenced via the local repository, not the <code class="literal">WEB-INF/lib</code> directory.</p></div></blockquote></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="running-and-deploying"></a>Supported Goals</h3></div></div></div><p>The Jetty Maven plugin has a number of distinct Maven goals.
Arguably the most useful is the <code class="literal">run</code> goal which runs Jetty on an unassembled webapp.
There are other goals which help you accomplish different tasks.
For example, you might need to run your webapp in a forked instance of Jetty rather than within the process running Maven; or you may need finer grained control over the maven lifecycle stage in which you wish to deploy your webapp.
There are different goals to accomplish these tasks, as well as several others.</p><p>To see a list of all goals supported by the Jetty Maven plugin, do:</p><div class="screenexample"><pre class="screen">mvn jetty:help</pre></div><p>To see the detailed list of parameters that can be configured for a particular goal, in addition to its description, do:</p><div class="screenexample"><pre class="screen">mvn jetty:help -Ddetail=true -Dgoal= &lt;goal name&gt;</pre></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="configuring-jetty-container"></a>Configuring the Jetty Container</h3></div></div></div><p>These configuration elements set up the Jetty environment in which your webapp executes.
They are common to most goals:</p><div class="variablelist"><dl class="variablelist"><dt><span class="term">httpConnector</span></dt><dd><p class="simpara">Optional.
If not specified, Jetty will create a <a class="link" href="http://download.eclipse.org/jetty/stable-9/apidocs/org/eclipse/jetty/server/ServerConnector.html" target="_top">ServerConnector</a> instance listening on port 8080.
You can change this default port number by using the system property <code class="literal">jetty.http.port</code> on the command line, for example, <code class="literal">mvn -Djetty.http.port=9999 jetty:run</code>.
Alternatively, you can use this configuration element to set up the information for the ServerConnector.
The following are the valid configuration sub-elements:</p><div class="variablelist"><dl class="variablelist"><dt><span class="term">port</span></dt><dd>The port number for the connector to listen on.
By default it is 8080.</dd><dt><span class="term">host</span></dt><dd>The particular interface for the connector to listen on.
By default, all interfaces.</dd><dt><span class="term">name</span></dt><dd>The name of the connector, which is useful for <a class="link" href="serving-webapp-from-particular-port.html" title="Serving a WebApp from a Particular Port/Connector">configuring contexts to respond only on particular connectors</a>.</dd><dt><span class="term">idleTimeout</span></dt><dd>Maximum idle time for a connection.</dd><dt><span class="term">soLinger</span></dt><dd><p class="simpara">The socket linger time.</p><p class="simpara">You could instead configure the connectors in a standard <a class="link" href="jetty-xml-config.html" title="jetty.xml">jetty xml config file</a> and put its location into the ` jettyXml` parameter.
Note that since jetty-9.0 it is no longer possible to configure a <a class="link" href="jetty-maven-plugin.html#maven-config-https" title="Configuring a Https Connector">https connector</a> directly in the pom.xml: you need to <a class="link" href="jetty-maven-plugin.html#maven-config-https" title="Configuring a Https Connector">use jetty xml config files to do it</a>.</p></dd></dl></div></dd><dt><span class="term">jettyXml</span></dt><dd>Optional.
A comma separated list of locations of <code class="literal">jetty xml</code> files to apply in addition to any plugin configuration parameters.
You might use it if you have other webapps, handlers, specific types of connectors etc., to deploy, or if you have other Jetty objects that you cannot configure from the plugin.</dd><dt><span class="term">scanIntervalSeconds</span></dt><dd>The pause in seconds between sweeps of the webapp to check for changes and automatically hot redeploy if any are detected.
<span class="strong"><strong>By default this is 0, which disables hot deployment scanning.</strong></span>
A number greater than 0 enables it.</dd><dt><span class="term">reload</span></dt><dd>Default value is "automatic", used in conjunction with a non-zero <span class="strong"><strong><span class="emphasis"><em>`scanIntervalSeconds`</em></span></strong></span> causes automatic hot redeploy when changes are detected.
Set to "manual" instead to trigger scanning by typing a linefeed in the console running the plugin.
This might be useful when you are doing a series of changes that you want to ignore until you&#8217;re done.
In that use, use the <code class="literal">reload</code> parameter.</dd><dt><span class="term">dumpOnStart</span></dt><dd>Optional.
Default value is false.
If true, then jetty will dump out the server structure on start.</dd><dt><span class="term">loginServices</span></dt><dd>Optional.
A list of <code class="literal">org.eclipse.jetty.security.LoginService</code> implementations. Note that there is no default realm.
If you use a realm in your <code class="literal">web.xml</code> you can specify a corresponding realm here.
You could instead configure the login services in a jetty xml file and add its location to the <code class="literal">jettyXml</code> parameter.</dd><dt><span class="term">requestLog</span></dt><dd><p class="simpara">Optional.
An implementation of the <code class="literal">org.eclipse.jetty.server.RequestLog</code> request log interface.
An implementation that respects the NCSA format is available as <code class="literal">org.eclipse.jetty.server.NCSARequestLog</code>.
There are three other ways to configure the RequestLog:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">In a jetty xml config file, as specified in the <code class="literal">jettyXml</code> parameter.</li><li class="listitem">In a context xml config file, as specified in the <code class="literal">contextXml</code> parameter.</li><li class="listitem">In the <code class="literal">webApp</code> element.</li></ul></div><p class="simpara">See <a class="link" href="configuring-jetty-request-logs.html" title="Configuring Jetty Request Logs">Configuring Request Logs</a> for more information.</p></dd><dt><span class="term">server</span></dt><dd>Optional as of Jetty 9.3.1.
This would configure an instance of the <a class="link" href="/opt/jenkins/workspace/nightlies/jetty-9.4-snapshot/jetty-documentation/../jetty-server/src/main/java/org/eclipse/jetty/server/Server.java" target="_top"><code class="literal">org.eclipse.jetty.server.Server</code></a> for the plugin to use, however it is usually NOT necessary to configure this, as the plugin will automatically configure one for you.
In particular, if you use the jettyXml element, then you generally DON&#8217;T want to define this element, as you are probably using the jettyXml file to configure up a Server with a special constructor argument, such as a custom threadpool.
If you define both a server element AND use a jetty xml element which points to a config file that has a line like <code class="literal">&lt;Configure id="Server" class="org.eclipse.jetty.server.Server"&gt;</code> then the the xml configuration will override what you configure for the server in the <code class="literal">pom.xml</code>.</dd><dt><span class="term">stopPort</span></dt><dd>Optional.
Port to listen on for stop commands.
Useful to use in conjunction with the <a class="link" href="jetty-maven-plugin.html#jetty-stop-goal" title="jetty:stop">stop</a> or <a class="link" href="jetty-maven-plugin.html#jetty-run-forked-goal" title="jetty:run-forked">run-forked</a> goals.</dd><dt><span class="term">stopKey</span></dt><dd>Optional.
Used in conjunction with stopPort for stopping jetty.
Useful when used in conjunction with the stop or run-forked goals.</dd><dt><span class="term">systemProperties</span></dt><dd>Optional.
Allows you to configure System properties for the execution of the plugin.
For more information, see Setting System Properties.</dd><dt><span class="term">systemPropertiesFile</span></dt><dd>Optional.
A file containing System properties to set for the execution of the plugin.
By default, settings that you make here <span class="strong"><strong>do not</strong></span> override any system properties already set on the command line, by the JVM, or in the POM via <code class="literal">systemProperties</code>.
Read Setting System Properties for how to force overrides.</dd><dt><span class="term">skip</span></dt><dd>Default is false.
If true, the execution of the plugin exits.
Same as setting the SystemProperty <code class="literal">-Djetty.skip</code> on the command line.
This is most useful when configuring Jetty for execution during integration testing and you want to skip the tests.</dd><dt><span class="term">useProvidedScope</span></dt><dd>Default value is <code class="literal">false</code>.
If true, the dependencies with <code class="literal">&lt;scope&gt;provided&lt;/scope&gt;</code> are placed onto the <span class="emphasis"><em>container classpath</em></span>.
Be aware that this is NOT the webapp classpath, as "provided" indicates that these dependencies would normally be expected to be provided by the container.
You should very rarely ever need to use this.
Instead, you should copy the provided dependencies as explicit dependencies of the <code class="literal">plugin</code> instead.</dd><dt><span class="term">excludedGoals</span></dt><dd>Optional.
A list of Jetty plugin goal names that will cause the plugin to print an informative message and exit.
Useful if you want to prevent users from executing goals that you know cannot work with your project.</dd></dl></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="maven-config-https"></a>Configuring a Https Connector</h4></div></div></div><p>In order to configure an HTTPS connector, you need to use jetty xml configuration files.
This example uses files copied directly from the jetty distribution etc/ directory, although you can of course make up your own xml file or files.
We will use the following files:</p><div class="variablelist"><dl class="variablelist"><dt><span class="term">jetty.xml</span></dt><dd><p class="simpara">Sets up various characteristics of the <a class="link" href="/opt/jenkins/workspace/nightlies/jetty-9.4-snapshot/jetty-documentation/../jetty-server/src/main/java/org/eclipse/jetty/server/Server.java" target="_top"><code class="literal">org.eclipse.jetty.server.Server</code></a> instance for the plugin to use.
Importantly, it sets up the <a class="link" href="/opt/jenkins/workspace/nightlies/jetty-9.4-snapshot/jetty-documentation/../jetty-server/src/main/java/org/eclipse/jetty/server/HttpConfiguration.java" target="_top"><code class="literal">org.eclipse.jetty.server.HttpConfiguration</code></a> element that we can refer to in subsequent xml files that configure the connectors.
Here&#8217;s the relevant section:</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>    &lt;New id="httpConfig" class="org.eclipse.jetty.server.HttpConfiguration"&gt;
      &lt;Set name="secureScheme"&gt;https&lt;/Set&gt;
      &lt;Set name="securePort"&gt;&lt;Property name="jetty.secure.port" default="8443" /&gt;&lt;/Set&gt;
      &lt;Set name="outputBufferSize"&gt;32768&lt;/Set&gt;
      &lt;Set name="requestHeaderSize"&gt;8192&lt;/Set&gt;
      &lt;Set name="responseHeaderSize"&gt;8192&lt;/Set&gt;
      &lt;Set name="sendServerVersion"&gt;true&lt;/Set&gt;
      &lt;Set name="sendDateHeader"&gt;false&lt;/Set&gt;
      &lt;Set name="headerCacheSize"&gt;512&lt;/Set&gt;

      &lt;!-- Uncomment to enable handling of X-Forwarded- style headers
      &lt;Call name="addCustomizer"&gt;
        &lt;Arg&gt;&lt;New class="org.eclipse.jetty.server.ForwardedRequestCustomizer"/&gt;&lt;/Arg&gt;
      &lt;/Call&gt;
      --&gt;
    &lt;/New&gt;</code></pre></dd><dt><span class="term">jetty-ssl.xml</span></dt><dd><p class="simpara">Set up ssl which will be used by the https connector.
Here&#8217;s the <code class="literal">jetty-ssl.xml</code> file from the jetty-distribution:</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>&lt;?xml version="1.0"?&gt;
&lt;!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_3.dtd"&gt;

&lt;!-- ============================================================= --&gt;
&lt;!-- Base SSL configuration                                        --&gt;
&lt;!-- This configuration needs to be used together with 1 or more   --&gt;
&lt;!-- of jetty-https.xml or jetty-http2.xml                         --&gt;
&lt;!-- ============================================================= --&gt;
&lt;Configure id="Server" class="org.eclipse.jetty.server.Server"&gt;

  &lt;!-- =========================================================== --&gt;
  &lt;!-- Add a SSL Connector with no protocol factories              --&gt;
  &lt;!-- =========================================================== --&gt;
  &lt;Call  name="addConnector"&gt;
    &lt;Arg&gt;
      &lt;New id="sslConnector" class="org.eclipse.jetty.server.ServerConnector"&gt;
        &lt;Arg name="server"&gt;&lt;Ref refid="Server" /&gt;&lt;/Arg&gt;
        &lt;Arg name="acceptors" type="int"&gt;&lt;Property name="jetty.ssl.acceptors" deprecated="ssl.acceptors" default="-1"/&gt;&lt;/Arg&gt;
        &lt;Arg name="selectors" type="int"&gt;&lt;Property name="jetty.ssl.selectors" deprecated="ssl.selectors" default="-1"/&gt;&lt;/Arg&gt;
        &lt;Arg name="factories"&gt;
          &lt;Array type="org.eclipse.jetty.server.ConnectionFactory"&gt;
            &lt;!-- uncomment to support proxy protocol
            &lt;Item&gt;
              &lt;New class="org.eclipse.jetty.server.ProxyConnectionFactory"/&gt;
            &lt;/Item&gt;--&gt;
          &lt;/Array&gt;
        &lt;/Arg&gt;

        &lt;Set name="host"&gt;&lt;Property name="jetty.ssl.host" deprecated="jetty.host" /&gt;&lt;/Set&gt;
        &lt;Set name="port"&gt;&lt;Property name="jetty.ssl.port" deprecated="ssl.port" default="8443" /&gt;&lt;/Set&gt;
        &lt;Set name="idleTimeout"&gt;&lt;Property name="jetty.ssl.idleTimeout" deprecated="ssl.timeout" default="30000"/&gt;&lt;/Set&gt;
        &lt;Set name="soLingerTime"&gt;&lt;Property name="jetty.ssl.soLingerTime" deprecated="ssl.soLingerTime" default="-1"/&gt;&lt;/Set&gt;
        &lt;Set name="acceptorPriorityDelta"&gt;&lt;Property name="jetty.ssl.acceptorPriorityDelta" deprecated="ssl.acceptorPriorityDelta" default="0"/&gt;&lt;/Set&gt;
        &lt;Set name="acceptQueueSize"&gt;&lt;Property name="jetty.ssl.acceptQueueSize" deprecated="ssl.acceptQueueSize" default="0"/&gt;&lt;/Set&gt;
      &lt;/New&gt;
    &lt;/Arg&gt;
  &lt;/Call&gt;

  &lt;!-- =========================================================== --&gt;
  &lt;!-- Create a TLS specific HttpConfiguration based on the        --&gt;
  &lt;!-- common HttpConfiguration defined in jetty.xml               --&gt;
  &lt;!-- Add a SecureRequestCustomizer to extract certificate and    --&gt;
  &lt;!-- session information                                         --&gt;
  &lt;!-- =========================================================== --&gt;
  &lt;New id="sslHttpConfig" class="org.eclipse.jetty.server.HttpConfiguration"&gt;
    &lt;Arg&gt;&lt;Ref refid="httpConfig"/&gt;&lt;/Arg&gt;
    &lt;Call name="addCustomizer"&gt;
      &lt;Arg&gt;
        &lt;New class="org.eclipse.jetty.server.SecureRequestCustomizer"&gt;
          &lt;Arg name="sniHostCheck" type="boolean"&gt;&lt;Property name="jetty.ssl.sniHostCheck" default="true"/&gt;&lt;/Arg&gt;
          &lt;Arg name="stsMaxAgeSeconds" type="int"&gt;&lt;Property name="jetty.ssl.stsMaxAgeSeconds" default="-1"/&gt;&lt;/Arg&gt;
          &lt;Arg name="stsIncludeSubdomains" type="boolean"&gt;&lt;Property name="jetty.ssl.stsIncludeSubdomains" default="false"/&gt;&lt;/Arg&gt;
        &lt;/New&gt;
      &lt;/Arg&gt;
    &lt;/Call&gt;
  &lt;/New&gt;

&lt;/Configure&gt;</code></pre></dd><dt><span class="term">jetty-https.xml</span></dt><dd><p class="simpara">Set up the https connector using the HttpConfiguration from <code class="literal">jetty.xml</code> and the ssl configuration from <code class="literal">jetty-ssl.xml</code>:</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>&lt;?xml version="1.0"?&gt;
&lt;!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_3.dtd"&gt;

&lt;!-- ============================================================= --&gt;
&lt;!-- Configure a HTTPS connector.                                  --&gt;
&lt;!-- This configuration must be used in conjunction with jetty.xml --&gt;
&lt;!-- and jetty-ssl.xml.                                            --&gt;
&lt;!-- ============================================================= --&gt;
&lt;Configure id="sslConnector" class="org.eclipse.jetty.server.ServerConnector"&gt;

  &lt;Call name="addIfAbsentConnectionFactory"&gt;
    &lt;Arg&gt;
      &lt;New class="org.eclipse.jetty.server.SslConnectionFactory"&gt;
        &lt;Arg name="next"&gt;http/1.1&lt;/Arg&gt;
        &lt;Arg name="sslContextFactory"&gt;&lt;Ref refid="sslContextFactory"/&gt;&lt;/Arg&gt;
      &lt;/New&gt;
    &lt;/Arg&gt;
  &lt;/Call&gt;

  &lt;Call name="addConnectionFactory"&gt;
    &lt;Arg&gt;
      &lt;New class="org.eclipse.jetty.server.HttpConnectionFactory"&gt;
        &lt;Arg name="config"&gt;&lt;Ref refid="sslHttpConfig" /&gt;&lt;/Arg&gt;
        &lt;Arg name="compliance"&gt;&lt;Call class="org.eclipse.jetty.http.HttpCompliance" name="valueOf"&gt;&lt;Arg&gt;&lt;Property name="jetty.http.compliance" default="RFC7230"/&gt;&lt;/Arg&gt;&lt;/Call&gt;&lt;/Arg&gt;
      &lt;/New&gt;
    &lt;/Arg&gt;
  &lt;/Call&gt;

&lt;/Configure&gt;</code></pre></dd></dl></div><p>Now you need to let the plugin know to apply the files above:</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>&lt;plugin&gt;
  &lt;groupId&gt;org.eclipse.jetty&lt;/groupId&gt;
  &lt;artifactId&gt;jetty-maven-plugin&lt;/artifactId&gt;
  &lt;version&gt;9.4.0-SNAPSHOT&lt;/version&gt;
  &lt;configuration&gt;
    &lt;jettyXml&gt;jetty.xml,jetty-ssl.xml,jetty-https.xml&lt;/jettyXml&gt;
  &lt;/configuration&gt;
&lt;/plugin&gt;</code></pre><div class="blockquote"><blockquote class="blockquote"><div xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times" class="caution" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title"><i class="fa fa-exclamation" aria-hidden="true"></i> Caution</h3><p>Just like with an installed distribution of Jetty, the ordering of the xml files is significant.</p></div></blockquote></div><p>You can also use Jetty xml files to configure a http connector for the plugin to use.
Here we use the same <code class="literal">jetty-http.xml</code> file from the Jetty distribution:</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>&lt;?xml version="1.0"?&gt;
&lt;!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_3.dtd"&gt;

&lt;!-- ============================================================= --&gt;
&lt;!-- Configure the Jetty Server instance with an ID "Server"       --&gt;
&lt;!-- by adding a HTTP connector.                                   --&gt;
&lt;!-- This configuration must be used in conjunction with jetty.xml --&gt;
&lt;!-- ============================================================= --&gt;
&lt;Configure id="Server" class="org.eclipse.jetty.server.Server"&gt;

  &lt;!-- =========================================================== --&gt;
  &lt;!-- Add a HTTP Connector.                                       --&gt;
  &lt;!-- Configure an o.e.j.server.ServerConnector with a single     --&gt;
  &lt;!-- HttpConnectionFactory instance using the common httpConfig  --&gt;
  &lt;!-- instance defined in jetty.xml                               --&gt;
  &lt;!--                                                             --&gt;
  &lt;!-- Consult the javadoc of o.e.j.server.ServerConnector and     --&gt;
  &lt;!-- o.e.j.server.HttpConnectionFactory for all configuration    --&gt;
  &lt;!-- that may be set here.                                       --&gt;
  &lt;!-- =========================================================== --&gt;
  &lt;Call name="addConnector"&gt;
    &lt;Arg&gt;
      &lt;New id="httpConnector" class="org.eclipse.jetty.server.ServerConnector"&gt;
        &lt;Arg name="server"&gt;&lt;Ref refid="Server" /&gt;&lt;/Arg&gt;
        &lt;Arg name="acceptors" type="int"&gt;&lt;Property name="jetty.http.acceptors" deprecated="http.acceptors" default="-1"/&gt;&lt;/Arg&gt;
        &lt;Arg name="selectors" type="int"&gt;&lt;Property name="jetty.http.selectors" deprecated="http.selectors" default="-1"/&gt;&lt;/Arg&gt;
        &lt;Arg name="factories"&gt;
          &lt;Array type="org.eclipse.jetty.server.ConnectionFactory"&gt;
            &lt;Item&gt;
              &lt;New class="org.eclipse.jetty.server.HttpConnectionFactory"&gt;
                &lt;Arg name="config"&gt;&lt;Ref refid="httpConfig" /&gt;&lt;/Arg&gt;
                &lt;Arg name="compliance"&gt;&lt;Call class="org.eclipse.jetty.http.HttpCompliance" name="valueOf"&gt;&lt;Arg&gt;&lt;Property name="jetty.http.compliance" default="RFC7230"/&gt;&lt;/Arg&gt;&lt;/Call&gt;&lt;/Arg&gt;
              &lt;/New&gt;
            &lt;/Item&gt;
          &lt;/Array&gt;
        &lt;/Arg&gt;
        &lt;Set name="host"&gt;&lt;Property name="jetty.http.host" deprecated="jetty.host" /&gt;&lt;/Set&gt;
        &lt;Set name="port"&gt;&lt;Property name="jetty.http.port" deprecated="jetty.port" default="8080" /&gt;&lt;/Set&gt;
        &lt;Set name="idleTimeout"&gt;&lt;Property name="jetty.http.idleTimeout" deprecated="http.timeout" default="30000"/&gt;&lt;/Set&gt;
        &lt;Set name="soLingerTime"&gt;&lt;Property name="jetty.http.soLingerTime" deprecated="http.soLingerTime" default="-1"/&gt;&lt;/Set&gt;
        &lt;Set name="acceptorPriorityDelta"&gt;&lt;Property name="jetty.http.acceptorPriorityDelta" deprecated="http.acceptorPriorityDelta" default="0"/&gt;&lt;/Set&gt;
        &lt;Set name="acceptQueueSize"&gt;&lt;Property name="jetty.http.acceptQueueSize" deprecated="http.acceptQueueSize" default="0"/&gt;&lt;/Set&gt;
      &lt;/New&gt;
    &lt;/Arg&gt;
  &lt;/Call&gt;

&lt;/Configure&gt;</code></pre><p>Now we add it to the list of configs for the plugin to apply:</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>&lt;plugin&gt;
  &lt;groupId&gt;org.eclipse.jetty&lt;/groupId&gt;
  &lt;artifactId&gt;jetty-maven-plugin&lt;/artifactId&gt;
  &lt;version&gt;9.4.0-SNAPSHOT&lt;/version&gt;
  &lt;configuration&gt;
    &lt;jettyXml&gt;jetty.xml,jetty-http.xml,jetty-ssl.xml,jetty-https.xml&lt;/jettyXml&gt;
  &lt;/configuration&gt;
&lt;/plugin&gt;</code></pre><p>Alternatively, you can use the <span class="strong"><strong>httpConnector</strong></span> configuration element inside the pom instead as described above.</p></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="configuring-your-webapp"></a>Configuring Your WebApp</h3></div></div></div><p>These configuration parameters apply to your webapp.
They are common to almost all goals.</p><div class="variablelist"><dl class="variablelist"><dt><span class="term">webApp</span></dt><dd><p class="simpara">This is an instance of <a class="link" href="http://download.eclipse.org/jetty/stable-9/apidocs/org/eclipse/jetty/maven/plugin/JettyWebAppContext.html" target="_top">org.eclipse.jetty.maven.plugin.JettyWebAppContext</a>, which is an extension to the class  <a class="link" href="http://download.eclipse.org/jetty/stable-9/apidocs/org/eclipse/jetty/webapp/WebAppContext.hml" target="_top"><code class="literal">org.eclipse.jetty.webapp.WebAppContext</code></a>.
You can use any of the setter methods on this object to configure your webapp.
Here are a few of the most useful ones:</p><div class="variablelist"><dl class="variablelist"><dt><span class="term">contextPath</span></dt><dd>The context path for your webapp. By default, this is set to <code class="literal">/</code>.
If using a custom value for this parameter, you probably want to include the leading <code class="literal">/</code>, example <code class="literal">/mycontext</code>.</dd><dt><span class="term">descriptor</span></dt><dd>The path to the <code class="literal">web.xml</code> file for your webapp.</dd><dt><span class="term">defaultsDescriptor</span></dt><dd>The path to a <code class="literal">webdefault.xml</code> file that will be applied to your webapp before the <code class="literal">web.xml</code>.
If you don&#8217;t supply one, Jetty uses a default file baked into the <code class="literal">jetty-webapp.jar</code>.</dd><dt><span class="term">overrideDescriptor</span></dt><dd>The path to a <code class="literal">web.xml</code> file that Jetty applies after reading your <code class="literal">web.xml</code>.
You can use this to replace or add configuration.</dd><dt><span class="term">tempDirectory</span></dt><dd>The path to a dir that Jetty can use to expand or copy jars and jsp compiles when your webapp is running.
The default is <code class="literal">${project.build.outputDirectory}/tmp</code>.</dd><dt><span class="term">baseResource</span></dt><dd>The path from which Jetty serves static resources.
Defaults to <code class="literal">src/main/webapp</code>.</dd><dt><span class="term">resourceBases</span></dt><dd>Use instead of <code class="literal">baseResource</code> if you have multiple directories from which you want to serve static content.
This is an array of directory names.</dd><dt><span class="term">baseAppFirst</span></dt><dd>Defaults to "true".
Controls whether any overlaid wars are added before or after the original base resource(s) of the webapp.
See the section on <a class="link" href="jetty-maven-plugin.html#using-overlaid-wars" title="Using Overlaid wars">overlaid wars</a> for more information.</dd><dt><span class="term">containerIncludeJarPattern</span></dt><dd>Defaults to <code class="literal">.*/javax.servlet-[^/]*\.jar$|.*/servlet-api-[^/]*\.jar$|.*javax.servlet.jsp.jstl-[^/]*\.jar|.*taglibs-standard-impl-.*\.jar</code>.
This is a pattern that is applied to the names of the jars on the container&#8217;s classpath (ie the classpath of the plugin, not that of the webapp) that should be scanned for fragments, tlds, annotations etc.
This is analogous to the context attribute <a class="link" href="configuring-webapps.html#container-include-jar-pattern" title="org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern">org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern</a> that is documented <a class="link" href="configuring-webapps.html#container-include-jar-pattern" title="org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern">here</a>.
You can define extra patterns of jars that will be included in the scan.</dd><dt><span class="term">webInfIncludeJarPattern</span></dt><dd>Defaults to matching <span class="emphasis"><em>all</em></span> of the dependency jars for the webapp (ie the equivalent of WEB-INF/lib).
You can make this pattern more restrictive to only match certain jars by using this setter.
This is analogous to the context attribute <a class="link" href="configuring-webapps.html#web-inf-include-jar-pattern" title="org.eclipse.jetty.server.webapp.WebInfIncludeJarPattern">org.eclipse.jetty.server.webapp.WebInfIncludeJarPattern</a> that is documented <a class="link" href="configuring-webapps.html#web-inf-include-jar-pattern" title="org.eclipse.jetty.server.webapp.WebInfIncludeJarPattern">here</a>.</dd></dl></div></dd><dt><span class="term">contextXml</span></dt><dd>The path to a context xml file that is applied to your webapp AFTER the <code class="literal">webApp</code> element.</dd></dl></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="jetty-run-goal"></a>jetty:run</h3></div></div></div><p>The <code class="literal">run</code> goal runs on a webapp that does not have to be built into a WAR.
Instead, Jetty deploys the webapp from its sources.
It looks for the constituent parts of a webapp in the Maven default project locations, although you can override these in the plugin configuration.
For example, by default it looks for:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">resources in <code class="literal">${project.basedir}/src/main/webapp</code></li><li class="listitem">classes in <code class="literal">${project.build.outputDirectory}</code></li><li class="listitem"><code class="literal">web.xml</code> in <code class="literal">${project.basedir}/src/main/webapp/WEB-INF/</code></li></ul></div><p>The plugin automatically ensures the classes are rebuilt and up-to-date before deployment.
If you change the source of a class and your IDE automatically compiles it in the background, the plugin picks up the changed class.</p><p>You do not need to assemble the webapp into a WAR, saving time during the development cycle.
Once invoked, you can configure the plugin to run continuously, scanning for changes in the project and automatically performing a hot redeploy when necessary.
Any changes you make are immediately reflected in the running instance of Jetty, letting you quickly jump from coding to testing, rather than going through the cycle of: code, compile, reassemble, redeploy, test.</p><p>Here is an example, which turns on scanning for changes every ten seconds, and sets the webapp context path to <code class="literal">/test</code>:</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>&lt;plugin&gt;
  &lt;groupId&gt;org.eclipse.jetty&lt;/groupId&gt;
  &lt;artifactId&gt;jetty-maven-plugin&lt;/artifactId&gt;
  &lt;version&gt;9.4.0-SNAPSHOT&lt;/version&gt;
  &lt;configuration&gt;
    &lt;scanIntervalSeconds&gt;10&lt;/scanIntervalSeconds&gt;
    &lt;webApp&gt;
      &lt;contextPath&gt;/test&lt;/contextPath&gt;
    &lt;/webApp&gt;
  &lt;/configuration&gt;
&lt;/plugin&gt;</code></pre><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="configuring-additional-parameters"></a>Configuration</h4></div></div></div><p>In addition to the <code class="literal">webApp</code> element that is common to most goals, the <code class="literal">jetty:run</code> goal supports:</p><div class="variablelist"><dl class="variablelist"><dt><span class="term">classesDirectory</span></dt><dd>Location of your compiled classes for the webapp.
You should rarely need to set this parameter.
Instead, you should set <code class="literal">build outputDirectory</code> in your <code class="literal">pom.xml</code>.</dd><dt><span class="term">testClassesDirectory</span></dt><dd>Location of the compiled test classes for your webapp. By default this is <code class="literal">${project.build.testOutputDirectory}</code>.</dd><dt><span class="term">useTestScope</span></dt><dd>If true, the classes from <code class="literal">testClassesDirectory</code> and dependencies of scope "test" are placed first on the classpath.
By default this is false.</dd><dt><span class="term">webAppSourceDirectory</span></dt><dd>By default, this is set to <code class="literal">${project.basedir}/src/main/webapp</code>.
If your static sources are in a different location, set this parameter accordingly.</dd><dt><span class="term">jettyEnvXml</span></dt><dd>Optional.
Location of a <code class="literal">jetty-env.xml</code> file, which allows you to make JNDI bindings that satisfy <code class="literal">env-entry</code>, <code class="literal">resource-env-ref</code>, and <code class="literal">resource-ref</code> linkages in the <code class="literal">web.xml</code> that are scoped  only to the webapp and not shared with other webapps that you might be deploying at the same time (for example, by using a ` jettyConfig` file).</dd><dt><span class="term">scanTargets</span></dt><dd>Optional.
A list of files and directories to periodically scan in addition to those the plugin automatically scans.</dd><dt><span class="term">scanTargetPatterns</span></dt><dd>Optional.
If you have a long list of extra files you want scanned, it is more convenient to use pattern matching expressions to specify them instead of enumerating them with the <code class="literal">scanTargetsList</code> of <code class="literal">scanTargetPatterns</code>, each consisting of a directory, and including and/or excluding parameters to specify the file matching patterns.</dd><dt><span class="term">scanClassesPattern</span></dt><dd>Since 9.3.0.
Optional.
Include and exclude patterns that can be applied to the classesDirectory for the purposes of scanning, it does <span class="strong"><strong>not</strong></span> affect the classpath.
If a file or directory is excluded by the patterns then a change in that file (or subtree in the case of a directory) is ignored and will not cause the webapp to redeploy.
Patterns are specified as a relative path using a glob-like syntax as described in the <a class="link" href="http://docs.oracle.com/javase/8/docs/api/java/nio/file/FileSystem.html#getPathMatcher-java.lang.String-" target="_top">javadoc</a> for <a class="link" href="http://docs.oracle.com/javase/8/docs/api/java/nio/file/FileSystem.html#getPathMatcher-java.lang.String-" target="_top">FileSystem.getPathMatcher</a>.</dd><dt><span class="term">scanTestClassesPattern</span></dt><dd>Since 9.3.0.
Optional.
Include and exclude patterns that can be applied to the testClassesDirectory for the purposes of scanning, it does <span class="strong"><strong>not</strong></span> affect the classpath.
If a file or directory is excluded by the patterns then a change in that file (or subtree in the case of a directory) is ignored and will not cause the webapp to redeploy.
Patterns are specified as a relative path using a glob-like syntax as described in the <a class="link" href="http://docs.oracle.com/javase/8/docs/api/java/nio/file/FileSystem.html#getPathMatcher-java.lang.String-" target="_top">javadoc</a> for <a class="link" href="http://docs.oracle.com/javase/8/docs/api/java/nio/file/FileSystem.html#getPathMatcher-java.lang.String-" target="_top">FileSystem.getPathMatcher</a>.</dd></dl></div><p>Here&#8217;s an example:</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>&lt;project&gt;
...
  &lt;plugins&gt;
...
    &lt;plugin&gt;
      &lt;groupId&gt;org.eclipse.jetty&lt;/groupId&gt;
      &lt;artifactId&gt;jetty-maven-plugin&lt;/artifactId&gt;
      &lt;version&gt;9.4.0-SNAPSHOT&lt;/version&gt;
      &lt;configuration&gt;
        &lt;webAppSourceDirectory&gt;${project.basedir}/src/staticfiles&lt;/webAppSourceDirectory&gt;
        &lt;webApp&gt;
          &lt;contextPath&gt;/&lt;/contextPath&gt;
          &lt;descriptor&gt;${project.basedir}/src/over/here/web.xml&lt;/descriptor&gt;
          &lt;jettyEnvXml&gt;${project.basedir}/src/over/here/jetty-env.xml&lt;/jettyEnvXml&gt;
        &lt;/webApp&gt;
        &lt;classesDirectory&gt;${project.basedir}/somewhere/else&lt;/classesDirectory&gt;
        &lt;scanClassesPattern&gt;
          &lt;excludes&gt;
             &lt;exclude&gt;**/Foo.class&lt;/exclude&gt;
          &lt;/excludes&gt;
        &lt;/scanClassesPattern&gt;
        &lt;scanTargets&gt;
          &lt;scanTarget&gt;src/mydir&lt;/scanTarget&gt;
          &lt;scanTarget&gt;src/myfile.txt&lt;/scanTarget&gt;
        &lt;/scanTargets&gt;
        &lt;scanTargetPatterns&gt;
          &lt;scanTargetPattern&gt;
            &lt;directory&gt;src/other-resources&lt;/directory&gt;
            &lt;includes&gt;
              &lt;include&gt;**/*.xml&lt;/include&gt;
              &lt;include&gt;**/*.properties&lt;/include&gt;
            &lt;/includes&gt;
            &lt;excludes&gt;
              &lt;exclude&gt;**/myspecial.xml&lt;/exclude&gt;
              &lt;exclude&gt;**/myspecial.properties&lt;/exclude&gt;
            &lt;/excludes&gt;
          &lt;/scanTargetPattern&gt;
        &lt;/scanTargetPatterns&gt;
      &lt;/configuration&gt;
    &lt;/plugin&gt;
  &lt;/plugins&gt;
&lt;/project&gt;</code></pre><p>If, for whatever reason, you cannot run on an unassembled webapp, the goals <code class="literal">run-war</code> and <code class="literal">run-exploded</code> work on unassembled webapps.</p></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="running-assembled-webapp-as-war"></a>jetty:run-war</h3></div></div></div><p>This goal first packages your webapp as a WAR file and then deploys it to Jetty.
If you set a non-zero <code class="literal">scanInterval</code>, Jetty watches your <code class="literal">pom.xml</code> and the WAR file; if either changes, it redeploys the war.</p><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="configuring-war"></a>Configuration</h4></div></div></div><div class="variablelist"><dl class="variablelist"><dt><span class="term">war</span></dt><dd>The location of the built WAR file. This defaults to <code class="literal">${project.build.directory}/${project.build.finalName}.war</code>.
If this is not sufficient, set it to your custom location.</dd></dl></div><p>Here&#8217;s how to set it:</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>&lt;project&gt;
...
  &lt;plugins&gt;
...
    &lt;plugin&gt;
      &lt;groupId&gt;org.eclipse.jetty&lt;/groupId&gt;
      &lt;artifactId&gt;jetty-maven-plugin&lt;/artifactId&gt;
      &lt;version&gt;9.4.0-SNAPSHOT&lt;/version&gt;
      &lt;configuration&gt;
        &lt;war&gt;${project.basedir}/target/mycustom.war&lt;/war&gt;
      &lt;/configuration&gt;
    &lt;/plugin&gt;
  &lt;/plugins&gt;
&lt;/project&gt;</code></pre></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="running-assembled-webapp-as-expanded-war"></a>jetty:run-exploded</h3></div></div></div><p>The run-exploded goal first assembles your webapp into an exploded WAR file and then deploys it to Jetty.
If you set a non-zero <code class="literal">scanInterval</code>, Jetty watches your <code class="literal">pom.xml,`WEB-INF/lib</code>, <code class="literal">WEB-INF/</code> and <code class="literal">WEB-INF/web.xml</code> for changes and redeploys when necessary.</p><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="configuring-exploded-war"></a>Configuration</h4></div></div></div><div class="variablelist"><dl class="variablelist"><dt><span class="term">war</span></dt><dd>The location of the exploded WAR.
This defaults to <code class="literal">${project.build.directory}/${project.build.finalName}</code>, but you can override the default by setting this parameter.</dd></dl></div><p>Here&#8217;s how to set it:</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>&lt;project&gt;
...
  &lt;plugins&gt;
...
    &lt;plugin&gt;
      &lt;groupId&gt;org.eclipse.jetty&lt;/groupId&gt;
      &lt;artifactId&gt;maven-jetty-plugin&lt;/artifactId&gt;
      &lt;version&gt;9.4.0-SNAPSHOT&lt;/version&gt;
      &lt;configuration&gt;
        &lt;war&gt;${project.basedir}/target/myfunkywebapp&lt;/war&gt;
      &lt;/configuration&gt;
    &lt;/plugin&gt;
  &lt;/plugins&gt;
&lt;/project&gt;</code></pre></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="deploy-war-running-pre-assembled-war"></a>jetty:deploy-war</h3></div></div></div><p>This is basically the same as <code class="literal">jetty:run-war</code>, but without assembling the WAR of the current module - you can nominate the location of any war to run.
Unlike <code class="literal">run-war</code>, the phase in which this plugin executes is not bound to the "package" phase - you may bind it to any phase to use it.</p><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="_configuration_3"></a>Configuration</h4></div></div></div><div class="variablelist"><dl class="variablelist"><dt><span class="term">war</span></dt><dd>The location of the WAR file. This defaults to <code class="literal">${project.build.directory}/${project.build.finalName}</code>, but you can override the default by setting this parameter.</dd><dt><span class="term">daemon</span></dt><dd>If true, this plugin will start Jetty but let the build continue.
This is useful if you want to start jetty as an execution binding in a particular phase and then stop it in another.
Alternatively, you can set this parameter to false, in which case Jetty will block and you will need to use a ctrl-c to stop it.</dd></dl></div><p>Here&#8217;s the configuration:</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>&lt;project&gt;
...
  &lt;plugins&gt;
...
  &lt;plugin&gt;
    &lt;groupId&gt;org.eclipse.jetty&lt;/groupId&gt;
    &lt;artifactId&gt;jetty-maven-plugin&lt;/artifactId&gt;
    &lt;version&gt;9.4.0-SNAPSHOT&lt;/version&gt;
    &lt;configuration&gt;
      &lt;war&gt;/opt/special/some-app.war&lt;/war&gt;
      &lt;stopKey&gt;alpha&lt;/stopKey&gt;
      &lt;stopPort&gt;9099&lt;/stopPort&gt;
    &lt;/configuration&gt;
    &lt;executions&gt;
      &lt;execution&gt;
        &lt;id&gt;start-jetty&lt;/id&gt;
        &lt;phase&gt;test-compile&lt;/phase&gt;
        &lt;goals&gt;
          &lt;goal&gt;deploy-war&lt;/goal&gt;
        &lt;/goals&gt;
      &lt;/execution&gt;
      &lt;execution&gt;
        &lt;id&gt;stop-jetty&lt;/id&gt;
        &lt;phase&gt;test&lt;/phase&gt;
        &lt;goals&gt;
          &lt;goal&gt;stop&lt;/goal&gt;
        &lt;/goals&gt;
      &lt;/execution&gt;
     &lt;/executions&gt;
    &lt;/plugin&gt;
  &lt;/plugins&gt;
&lt;/project&gt;</code></pre></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="jetty-run-forked-goal"></a>jetty:run-forked</h3></div></div></div><p>This goal allows you to start the webapp in a new JVM, optionally passing arguments to that new JVM.
This goal supports the same configuration parameters as the <code class="literal">jetty:run</code> goal with a couple of extras to help configure the forked process.</p><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="_configuration_4"></a>Configuration</h4></div></div></div><p>The available configuration parameters - in addition to those for the <code class="literal">jetty:run</code> goal - are:</p><div class="variablelist"><dl class="variablelist"><dt><span class="term">jvmArgs</span></dt><dd>Optional.
A string representing arbitrary arguments to pass to the forked JVM.</dd><dt><span class="term">waitForChild</span></dt><dd>Default is <code class="literal">true</code>.
This causes the parent process to wait for the forked process to exit.
In this case you can use <code class="literal">ctrl-c</code> to terminate both processes.
It is more useful to set it to <code class="literal">false</code>, in which case the parent process terminates whilst leaving the child process running.
You use the <code class="literal">jetty:stop</code> goal to stop the child process.</dd><dt><span class="term">maxStartupLines</span></dt><dd>Default is <code class="literal">50</code>.
This is maximum number of lines the parent process reads from the child process to receive an indication that the child has started.
If the child process produces an excessive amount of output on stdout you may need to increase this number.</dd></dl></div><p>Some of the container configuration parameters are <span class="strong"><strong>NOT</strong></span> available with this goal:</p><div class="variablelist"><dl class="variablelist"><dt><span class="term">scanIntervalSeconds</span></dt><dd>Not supported.
The forked jetty will not monitor and redeploy the webapp.</dd><dt><span class="term">reload</span></dt><dd>Not supported.
The forked jetty will not redeploy the webapp.</dd><dt><span class="term">httpConnector</span></dt><dd>Not supported.
To define custom connectors use a jetty xml file instead.</dd><dt><span class="term">loginServices</span></dt><dd>Not supported.
To define LoginServices use a jetty xml or context xml file instead.</dd><dt><span class="term">requestLog</span></dt><dd>Not supported.
To define a RequestLog setup, use a jetty xml or context xml file instead.</dd><dt><span class="term">systemProperties</span></dt><dd>Not supported.
Use the <code class="literal">jvmArgs</code> parameter to pass system properties to the forked process.</dd></dl></div><p>To deploy your unassembled web app to Jetty running in a new JVM:</p><div class="screenexample"><pre class="screen">mvn jetty:run-forked</pre></div><p>Jetty continues to execute until you either:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">Press <code class="literal">ctrl-c</code> in the terminal window to stop the plugin, which also stops the forked JVM (only if you started with <code class="literal">waitForChild=true</code>)</li><li class="listitem">Use <code class="literal">jetty:stop</code> to stop the forked JVM, which also stops the plugin.</li></ul></div><div class="blockquote"><blockquote class="blockquote"><div xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times" class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title"><i class="fa fa-asterisk" aria-hidden="true"></i> Note</h3><p>If you want to set a custom port for the Jetty connector you need to specify it in a <code class="literal">jetty xml</code> file rather than setting the connector and port tags.
You can specify the location of the <code class="literal">jetty.xml</code> using the <code class="literal">jettyXml</code> parameter.</p></div></blockquote></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="jetty-start-goal"></a>jetty:start</h3></div></div></div><p>This goal is for use with an execution binding in your <code class="literal">pom.xml</code>.
It is similar to the <code class="literal">jetty:run</code> goal, however it does NOT first execute the build up until the <code class="literal">test-compile</code> phase to ensure that all necessary classes and files of the webapp have been generated.
This is most useful when you want to control the start and stop of Jetty via execution bindings in your <code class="literal">pom.xml</code>.</p><p>For example, you can configure the plugin to start your webapp at the beginning of your unit tests and stop at the end.
To do this, you need to set up a couple of <code class="literal">execution</code> scenarios for the Jetty plugin.
You use the <code class="literal">pre-integration-test</code> and <code class="literal">post-integration-test</code> Maven build phases to trigger the execution and termination of Jetty:</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>&lt;plugin&gt;
  &lt;groupId&gt;org.eclipse.jetty&lt;/groupId&gt;
  &lt;artifactId&gt;jetty-maven-plugin&lt;/artifactId&gt;
  &lt;version&gt;9.4.0-SNAPSHOT&lt;/version&gt;
  &lt;configuration&gt;
    &lt;scanIntervalSeconds&gt;10&lt;/scanIntervalSeconds&gt;
    &lt;stopKey&gt;foo&lt;/stopKey&gt;
    &lt;stopPort&gt;9999&lt;/stopPort&gt;
  &lt;/configuration&gt;
  &lt;executions&gt;
    &lt;execution&gt;
      &lt;id&gt;start-jetty&lt;/id&gt;
      &lt;phase&gt;pre-integration-test&lt;/phase&gt;
      &lt;goals&gt;
        &lt;goal&gt;start&lt;/goal&gt;
      &lt;/goals&gt;
      &lt;configuration&gt;
        &lt;scanIntervalSeconds&gt;0&lt;/scanIntervalSeconds&gt;
      &lt;/configuration&gt;
    &lt;/execution&gt;
    &lt;execution&gt;
      &lt;id&gt;stop-jetty&lt;/id&gt;
      &lt;phase&gt;post-integration-test&lt;/phase&gt;
       &lt;goals&gt;
         &lt;goal&gt;stop&lt;/goal&gt;
       &lt;/goals&gt;
     &lt;/execution&gt;
  &lt;/executions&gt;
&lt;/plugin&gt;</code></pre></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="jetty-stop-goal"></a>jetty:stop</h3></div></div></div><p>The stop goal stops a running instance of Jetty.
To use it, you need to configure the plugin with a special port number and key.
That same port number and key will also be used by the other goals that start jetty.</p><div class="variablelist"><dl class="variablelist"><dt><span class="term">stopPort</span></dt><dd>A port number for Jetty to listen on to receive a stop command to cause it to shutdown.</dd><dt><span class="term">stopKey</span></dt><dd>A string value sent to the <code class="literal">stopPort</code> to validate the stop command.</dd><dt><span class="term">stopWait</span></dt><dd>The maximum time in seconds that the plugin will wait for confirmation that Jetty has stopped.
If false or not specified, the plugin does not wait for confirmation but exits after issuing the stop command.</dd></dl></div><p>Here&#8217;s a configuration example:</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>&lt;plugin&gt;
  &lt;groupId&gt;org.eclipse.jetty&lt;/groupId&gt;
  &lt;artifactId&gt;jetty-maven-plugin&lt;/artifactId&gt;
  &lt;version&gt;9.4.0-SNAPSHOT&lt;/version&gt;
  &lt;configuration&gt;
    &lt;stopPort&gt;9966&lt;/stopPort&gt;
    &lt;stopKey&gt;foo&lt;/stopKey&gt;
    &lt;stopWait&gt;10&lt;/stopWait&gt;
  &lt;/configuration&gt;
&lt;/plugin&gt;</code></pre><p>Then, while Jetty is running (in another window), type:</p><div class="screenexample"><pre class="screen">mvn jetty:stop</pre></div><p>The <code class="literal">stopPort</code> must be free on the machine you are running on.
If this is not the case, you will get an "Address already in use" error message after the "Started ServerConnector &#8230;&#8203;" message.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="jetty-effective-web-xml"></a>jetty:effective-web-xml</h3></div></div></div><p>This goal calculates a synthetic <code class="literal">web.xml</code> (the "effective web.xml") according to the rules of the Servlet Specification taking into account all sources of discoverable configuration of web components in your application: descriptors (<code class="literal">webdefault.xml</code>, <code class="literal">web.xml</code>, <code class="literal">web-fragment.xml`s, `web-override.xml</code>) and discovered annotations (<code class="literal">@WebServlet</code>, <code class="literal">@WebFilter</code>, <code class="literal">@WebListener</code>).
Note that no programmatic declarations of servlets, filters and listeners can be taken into account.
The effective <code class="literal">web.xml</code> from these combined sources is generated and displayed as maven log output.
Other useful information about your webapp that is produced as part of the analysis is also stored as context parameters in the effective-web.xml.
The effective-web.xml can be used in conjunction with the <a class="link" href="quickstart-webapp.html" title="Quickstart Webapps">Quickstart</a> feature to quickly start your webapp (note that Quickstart is not appropriate for the mvn jetty goals).</p><p>The following configuration parameters allow you to save the file:</p><div class="variablelist"><dl class="variablelist"><dt><span class="term">deleteOnExit</span></dt><dd>By default this is <code class="literal">true</code>.
If set to <code class="literal">false</code>, the effective web.xml is generated into a file called <code class="literal">effective-web.xml</code> in the build <code class="literal">target</code> directory.</dd><dt><span class="term">effectiveWebXml</span></dt><dd>The full path name of a file into which you would like the effective web xml generated.</dd></dl></div><p>You can also generate the origin of each element into the effective web.xml file.
The origin is either a descriptor eg web.xml,web-fragment.xml,override-web.xml file, or an annotation eg @WebServlet.
Some examples of elements with origin attribute information are:</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>&lt;listener origin="DefaultsDescriptor(file:///path/to/distro/etc/webdefault.xml):21"&gt;
&lt;listener origin="WebDescriptor(file:///path/to/base/webapps/test-spec/WEB-INF/web.xml):22"&gt;
&lt;servlet-class origin="FragmentDescriptor(jar:file:///path/to/base/webapps/test-spec/WEB-INF/lib/test-web-fragment.jar!/META-INF/web-fragment.xml):23"&gt;
&lt;servlet-class origin="@WebServlet(com.acme.test.TestServlet):24"&gt;</code></pre><p>To generate origin informatino, use the following configuration parameters on the  <code class="literal">webApp</code> element:</p><div class="variablelist"><dl class="variablelist"><dt><span class="term">originAttribute</span></dt><dd>The name of the attribute that will contain the origin.
By default it is <code class="literal">origin</code>.</dd><dt><span class="term">generateOrigin</span></dt><dd>False by default. If true, will force the generation of the originAttribute onto each element.</dd></dl></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="using-overlaid-wars"></a>Using Overlaid wars</h3></div></div></div><p>If your webapp depends on other war files, the<a class="link" href="jetty-maven-plugin.html#jetty-run-goal" title="jetty:run">jetty:run</a> and <a class="link" href="jetty-maven-plugin.html#jetty-run-forked-goal" title="jetty:run-forked">jetty:run-forked</a> goals are able to merge resources from all of them.
It can do so based on the settings of the <a class="link" href="http://maven.apache.org/plugins/maven-war-plugin/" target="_top">maven-war-plugin</a>, or if your project does not use the <a class="link" href="http://maven.apache.org/plugins/maven-war-plugin/" target="_top">maven-war-plugin</a> to handle the overlays, it can fall back to a simple algorithm to determine the ordering of resources.</p><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="_with_maven_war_plugin"></a>With maven-war-plugin</h4></div></div></div><p>The maven-war-plugin has a rich set of capabilities for merging resources.
The <code class="literal">jetty:run</code> and <code class="literal">jetty:run-forked</code> goals are able to interpret most of them and apply them during execution of your unassembled webapp.
This is probably best seen by looking at a concrete example.</p><p>Suppose your webapp depends on the following wars:</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>&lt;dependency&gt;
  &lt;groupId&gt;com.acme&lt;/groupId&gt;
  &lt;artifactId&gt;X&lt;/artifactId&gt;
  &lt;type&gt;war&lt;/type&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
  &lt;groupId&gt;com.acme&lt;/groupId&gt;
  &lt;artifactId&gt;Y&lt;/artifactId&gt;
  &lt;type&gt;war&lt;/type&gt;
&lt;/dependency&gt;</code></pre><p>Containing:</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>WebAppX:

 /foo.jsp
 /bar.jsp
 /WEB-INF/web.xml

WebAppY:

 /bar.jsp
 /baz.jsp
 /WEB-INF/web.xml
 /WEB-INF/special.xml</code></pre><p>They are configured for the <a class="link" href="http://maven.apache.org/plugins/maven-war-plugin/overlays.html" target="_top">maven-war-plugin</a>:</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>&lt;plugin&gt;
  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
  &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
  &lt;version&gt;9.4.0-SNAPSHOT&lt;/version&gt;
  &lt;configuration&gt;
    &lt;overlays&gt;
      &lt;overlay&gt;
        &lt;groupId&gt;com.acme&lt;/groupId&gt;
        &lt;artifactId&gt;X&lt;/artifactId&gt;
        &lt;excludes&gt;
          &lt;exclude&gt;bar.jsp&lt;/exclude&gt;
        &lt;/excludes&gt;
      &lt;/overlay&gt;
      &lt;overlay&gt;
        &lt;groupId&gt;com.acme&lt;/groupId&gt;
        &lt;artifactId&gt;Y&lt;/artifactId&gt;
        &lt;excludes&gt;
          &lt;exclude&gt;baz.jsp&lt;/exclude&gt;
        &lt;/excludes&gt;
      &lt;/overlay&gt;
      &lt;overlay&gt;
      &lt;/overlay&gt;
    &lt;/overlays&gt;
  &lt;/configuration&gt;
&lt;/plugin&gt;</code></pre><p>Then executing jetty:run would yield the following ordering of resources: <code class="literal">com.acme.X.war : com.acme.Y.war: ${project.basedir}/src/main/webapp</code>.
Note that the current project&#8217;s resources are placed last in the ordering due to the empty &lt;overlay/&gt; element in the maven-war-plugin.
You can either use that, or specify the <code class="literal">&lt;baseAppFirst&gt;false&lt;/baseAppFirst&gt;</code> parameter to the jetty-maven-plugin.</p><p>Moreover, due to the <code class="literal">exclusions</code> specified above, a request for the resource ` bar.jsp` would only be satisfied from <code class="literal">com.acme.Y.war.</code>
Similarly as <code class="literal">baz.jsp</code> is excluded, a request for it would result in a 404 error.</p></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="_without_maven_war_plugin"></a>Without maven-war-plugin</h4></div></div></div><p>The algorithm is fairly simple, is based on the ordering of declaration of the dependent wars, and does not support exclusions.
The configuration parameter <code class="literal">&lt;baseAppFirst&gt;</code> (see the section on <a class="link" href="jetty-maven-plugin.html#configuring-your-webapp" title="Configuring Your WebApp">Configuring Your Webapp</a> for more information) can be used to control whether your webapp&#8217;s resources are placed first or last on the resource path at runtime.</p><p>For example, suppose our webapp depends on these two wars:</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>&lt;dependency&gt;
  &lt;groupId&gt;com.acme&lt;/groupId&gt;
  &lt;artifactId&gt;X&lt;/artifactId&gt;
  &lt;type&gt;war&lt;/type&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
  &lt;groupId&gt;com.acme&lt;/groupId&gt;
  &lt;artifactId&gt;Y&lt;/artifactId&gt;
  &lt;type&gt;war&lt;/type&gt;
&lt;/dependency&gt;</code></pre><p>Suppose the webapps contain:</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>WebAppX:

 /foo.jsp
 /bar.jsp
 /WEB-INF/web.xml

WebAppY:

 /bar.jsp
 /baz.jsp
 /WEB-INF/web.xml
 /WEB-INF/special.xml</code></pre><p>Then our webapp has available these additional resources:</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>/foo.jsp (X)
/bar.jsp (X)
/baz.jsp (Y)
/WEB-INF/web.xml (X)
/WEB-INF/special.xml (Y)</code></pre></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="configuring-security-settings"></a>Configuring Security Settings</h3></div></div></div><p>You can configure LoginServices in the plugin.
Here&#8217;s an example of setting up the HashLoginService for a webapp:</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>&lt;plugin&gt;
  &lt;groupId&gt;org.eclipse.jetty&lt;/groupId&gt;
  &lt;artifactId&gt;jetty-maven-plugin&lt;/artifactId&gt;
  &lt;version&gt;9.4.0-SNAPSHOT&lt;/version&gt;
  &lt;configuration&gt;
    &lt;scanIntervalSeconds&gt;10&lt;/scanIntervalSeconds&gt;
    &lt;webApp&gt;
      &lt;contextPath&gt;/test&lt;/contextPath&gt;
    &lt;/webApp&gt;
    &lt;loginServices&gt;
      &lt;loginService implementation="org.eclipse.jetty.security.HashLoginService"&gt;
        &lt;name&gt;Test Realm&lt;/name&gt;
        &lt;config&gt;${project.basedir}/src/etc/realm.properties&lt;/config&gt;
      &lt;/loginService&gt;
    &lt;/loginServices&gt;
  &lt;/configuration&gt;
&lt;/plugin&gt;</code></pre></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="using-multiple-webapp-root-directories"></a>Using Multiple Webapp Root Directories</h3></div></div></div><p>If you have external resources that you want to incorporate in the execution of a webapp, but which are not assembled into war files, you can&#8217;t use the overlaid wars method described above, but you can tell Jetty the directories in which these external resources are located.
At runtime, when Jetty receives a request for a resource, it searches all the locations to retrieve the resource.
It&#8217;s a lot like the overlaid war situation, but without the war.</p><p>Here is a configuration example:</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>&lt;configuration&gt;
  &lt;webApp&gt;
    &lt;contextPath&gt;/${build.finalName}&lt;/contextPath&gt;
    &lt;baseResource implementation="org.eclipse.jetty.util.resource.ResourceCollection"&gt;
      &lt;resourcesAsCSV&gt;src/main/webapp,/home/johndoe/path/to/my/other/source,/yet/another/folder&lt;/resourcesAsCSV&gt;
    &lt;/baseResource&gt;
  &lt;/webApp&gt;
&lt;/configuration&gt;</code></pre></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="running-more-than-one-webapp"></a>Running More than One Webapp</h3></div></div></div><p>You can use either a <code class="literal">jetty.xml</code> file to configure extra (pre-compiled) webapps that you want to deploy, or you can use the <code class="literal">&lt;contextHandlers&gt;</code> configuration element to do so.
If you want to deploy webapp A, and webapps B and C in the same Jetty instance:</p><p>Putting the configuration in webapp A&#8217;s <code class="literal">pom.xml</code>:</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>&lt;plugin&gt;
  &lt;groupId&gt;org.eclipse.jetty&lt;/groupId&gt;
  &lt;artifactId&gt;jetty-maven-plugin&lt;/artifactId&gt;
  &lt;version&gt;9.4.0-SNAPSHOT&lt;/version&gt;
  &lt;configuration&gt;
    &lt;scanIntervalSeconds&gt;10&lt;/scanIntervalSeconds&gt;
    &lt;webApp&gt;
      &lt;contextPath&gt;/test&lt;/contextPath&gt;
    &lt;/webApp&gt;
    &lt;contextHandlers&gt;
      &lt;contextHandler implementation="org.eclipse.jetty.maven.plugin.JettyWebAppContext"&gt;
        &lt;war&gt;${project.basedir}../../B.war&lt;/war&gt;
        &lt;contextPath&gt;/B&lt;/contextPath&gt;
      &lt;/contextHandler&gt;
      &lt;contextHandler implementation="org.eclipse.jetty.maven.plugin.JettyWebAppContext"&gt;
        &lt;war&gt;${project.basedir}../../C.war&lt;/war&gt;
        &lt;contextPath&gt;/C&lt;/contextPath&gt;
      &lt;/contextHandler&gt;
    &lt;/contextHandlers&gt;
  &lt;/configuration&gt;
&lt;/plugin&gt;</code></pre><div class="blockquote"><blockquote class="blockquote"><div xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times" class="important" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title"><i class="fa fa-plus" aria-hidden="true"></i> Important</h3><p>If the <code class="literal">ContextHandler</code> you are deploying is a webapp, it is <span class="strong"><strong>essential</strong></span> that you use an <code class="literal">org.eclipse.jetty.maven.plugin.JettyWebAppContext</code> instance rather than a standard <code class="literal">org.eclipse.jetty.webapp.WebAppContext</code> instance.
Only the former will allow the webapp to function correctly in the maven environment.</p></div></blockquote></div><p>Alternatively, add a <code class="literal">jetty.xml</code> file to webapp A.
Copy the <code class="literal">jetty.xml</code> file from the Jetty distribution, and then add WebAppContexts for the other 2 webapps:</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>&lt;Ref refid="Contexts"&gt;
  &lt;Call name="addHandler"&gt;
    &lt;Arg&gt;
      &lt;New class="org.eclipse.jetty.maven.plugin.JettyWebAppContext"&gt;
        &lt;Set name="contextPath"&gt;/B&lt;/Set&gt;
        &lt;Set name="war"&gt;../../B.war&lt;/Set&gt;
      &lt;/New&gt;
    &lt;/Arg&gt;
  &lt;/Call&gt;
  &lt;Call&gt;
    &lt;Arg&gt;
      &lt;New class="org.eclipse.jetty.maven.plugin.JettyWebAppContext"&gt;
        &lt;Set name="contextPath"&gt;/C&lt;/Set&gt;
        &lt;Set name="war"&gt;../../C.war&lt;/Set&gt;
      &lt;/New&gt;
    &lt;/Arg&gt;
  &lt;/Call&gt;
&lt;/Ref&gt;</code></pre><p>Then configure the location of this <code class="literal">jetty.xml</code> file into webapp A&#8217;s jetty plugin:</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>&lt;plugin&gt;
  &lt;groupId&gt;org.eclipse.jetty&lt;/groupId&gt;
  &lt;artifactId&gt;jetty-maven-plugin&lt;/artifactId&gt;
  &lt;version&gt;9.4.0-SNAPSHOT&lt;/version&gt;
  &lt;configuration&gt;
    &lt;scanIntervalSeconds&gt;10&lt;/scanIntervalSeconds&gt;
    &lt;webApp&gt;
      &lt;contextPath&gt;/test&lt;/contextPath&gt;
    &lt;/webApp&gt;
    &lt;jettyXml&gt;src/main/etc/jetty.xml&lt;/jettyXml&gt;
  &lt;/configuration&gt;
&lt;/plugin&gt;</code></pre><p>For either of these solutions, the other webapps must already have been built, and they are not automatically monitored for changes.
You can refer either to the packed WAR file of the pre-built webapps or to their expanded equivalents.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="setting-system-properties"></a>Setting System Properties</h3></div></div></div><p>You can specify property name/value pairs that Jetty sets as System properties for the execution of the plugin.
This feature is useful to tidy up the command line and save a lot of typing.</p><p>However, <span class="strong"><strong>sometimes it is not possible to use this feature to set System properties</strong></span> - sometimes the software component using the System property is already initialized by the time that maven runs (in which case you will need to provide the System property on the command line), or by the time that Jetty runs.
In the latter case, you can use the <a class="link" href="http://www.mojohaus.org/" target="_top">maven properties plugin</a> to define the system properties instead. Here&#8217;s an example that configures the logback logging system as the Jetty logger:</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>&lt;plugin&gt;
  &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
  &lt;artifactId&gt;properties-maven-plugin&lt;/artifactId&gt;
  &lt;version&gt;1.0-alpha-2&lt;/version&gt;
  &lt;executions&gt;
    &lt;execution&gt;
      &lt;goals&gt;
        &lt;goal&gt;set-system-properties&lt;/goal&gt;
      &lt;/goals&gt;
      &lt;configuration&gt;
        &lt;properties&gt;
          &lt;property&gt;
            &lt;name&gt;logback.configurationFile&lt;/name&gt;
            &lt;value&gt;${project.baseUri}/resources/logback.xml&lt;/value&gt;
          &lt;/property&gt;
        &lt;/properties&gt;
      &lt;/configuration&gt;
    &lt;/execution&gt;
  &lt;/executions&gt;
&lt;/plugin&gt;</code></pre><div class="blockquote"><blockquote class="blockquote"><div xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times" class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title"><i class="fa fa-asterisk" aria-hidden="true"></i> Note</h3><p>If a System property is already set (for example, from the command line or by the JVM itself), then by default these configured properties <span class="strong"><strong>DO NOT</strong></span> override them (see below for use of the &lt;force&gt; parameter).</p></div></blockquote></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="specifying-properties-in-pom"></a>Specifying System Properties in the POM</h4></div></div></div><p>Here&#8217;s an example of how to specify System properties in the POM:</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>&lt;plugin&gt;
  &lt;groupId&gt;org.eclipse.jetty&lt;/groupId&gt;
  &lt;artifactId&gt;jetty-maven-plugin&lt;/artifactId&gt;
  &lt;configuration&gt;
    &lt;systemProperties&gt;
      &lt;systemProperty&gt;
        &lt;name&gt;fooprop&lt;/name&gt;
        &lt;value&gt;222&lt;/value&gt;
      &lt;/systemProperty&gt;
    &lt;/systemProperties&gt;
    &lt;webApp&gt;
      &lt;contextPath&gt;/test&lt;/contextPath&gt;
    &lt;/webApp&gt;
  &lt;/configuration&gt;
&lt;/plugin&gt;</code></pre><p>To change the default behavior so that these system properties override those on the command line, use the <code class="literal">&lt;force&gt;</code> parameter:</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>&lt;plugin&gt;
  &lt;groupId&gt;org.eclipse.jetty&lt;/groupId&gt;
  &lt;artifactId&gt;jetty-maven-plugin&lt;/artifactId&gt;
  &lt;configuration&gt;
    &lt;systemProperties&gt;
      &lt;force&gt;true&lt;/force&gt;
      &lt;systemProperty&gt;
       &lt;name&gt;fooprop&lt;/name&gt;
       &lt;value&gt;222&lt;/value&gt;
     &lt;/systemProperty&gt;
    &lt;/systemProperties&gt;
    &lt;webApp&gt;
      &lt;contextPath&gt;/test&lt;/contextPath&gt;
    &lt;/webApp&gt;
  &lt;/configuration&gt;
&lt;/plugin&gt;</code></pre></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="specifying-properties-in-file"></a>Specifying System Properties in a File</h4></div></div></div><p>You can also specify your System properties in a file.
System properties you specify in this way <span class="strong"><strong>do not</strong></span> override System properties that set on the command line, by the JVM, or directly in the POM via <code class="literal">systemProperties</code>.</p><p>Suppose we have a file called <code class="literal">mysys.props</code> which contains the following:</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>fooprop=222</code></pre><p>This can be configured on the plugin like so:</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>&lt;plugin&gt;
  &lt;groupId&gt;org.eclipse.jetty&lt;/groupId&gt;
  &lt;artifactId&gt;jetty-maven-plugin&lt;/artifactId&gt;
  &lt;configuration&gt;
    &lt;systemPropertiesFile&gt;${project.basedir}/mysys.props&lt;/systemPropertiesFile&gt;
    &lt;webApp&gt;
      &lt;contextPath&gt;/test&lt;/contextPath&gt;
    &lt;/webApp&gt;
  &lt;/configuration&gt;
&lt;/plugin&gt;</code></pre><p>You can instead specify the file by setting the System property <code class="literal">jetty.systemPropertiesFile</code> on the command line.</p></div></div></div><script type="text/javascript">
      SyntaxHighlighter.all()
    </script><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="maven-and-jetty.html"><i class="fa fa-chevron-left" aria-hidden="true"></i> Previous</a>&nbsp;</td><td width="20%" align="center"><a accesskey="u" href="maven-and-jetty.html"><i class="fa fa-chevron-up" aria-hidden="true"></i> Top</a></td><td width="40%" align="right">&nbsp;<a accesskey="n" href="jetty-maven-scanning.html">Next <i class="fa fa-chevron-right" aria-hidden="true"></i></a></td></tr><tr><td width="40%" align="left" valign="top">Chapter&nbsp;23.&nbsp;Maven and Jetty&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html"><i class="fa fa-home" aria-hidden="true"></i> Home</a></td><td width="40%" align="right" valign="top">&nbsp;Files Scanned by the Jetty Maven Plugin</td></tr></table></div><p xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><div class="jetty-callout">
            See an error or something missing?
            <span class="callout"><a href="http://github.com/eclipse/jetty.project">Contribute to this documentation at
                <span class="website"><i class="fa fa-github" aria-hidden="true"></i> Github!</span></a></span><span style="float: right"><i>(Generated: 2016-12-05)</i></span></div></p><script xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times" type="text/javascript">
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-1149868-7']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
    </script></body></html>

Back to the top