1<plugin>2<groupId>org.mortbay.jetty</groupId>3<artifactId>maven-jetty-plugin</artifactId>4<version>6.1. -</version>5<configuration>6<!--scan every 2 seconds for hot deployment--7<scanIntervalSeconds>2</scanIntervalSeconds>8<contextPath>/</contextPath>9</configuration>Ten</plugin>
The code looks like this: The jetty plug-in will automatically reload,jetty restart each time you save your code by pressing <reload>automatic</reload> default settings
To implement manual control, restart the jetty setting as follows:
1<plugin>2<groupId>org.mortbay.jetty</groupId>3<artifactId>maven-jetty-plugin</artifactId>4<version>6.1. -</version>5<configuration>6<!--scan every 2 seconds for hot deployment--7<scanIntervalSeconds>2</scanIntervalSeconds>8<reload>manual</reload>9<contextPath>/</contextPath>Ten</configuration> One</plugin>
Note: Some jetty plug-in versions do not support <RELOAD></RELOAD>, and note the version selection.
" manual reload "
From the Jetty 6.2.0pre0 version , a new, available component was added to control the redeployment of web apps.
Configuration parameters:<reload>[manual|automatic]</reload>
When you set theManual ModeAfterWebApps do not automatically scan and re-deploy. Instead, the user can control theweb when applied, by typing " carriage return line key " reload. When set to automatic mode , it is based on the scanintervalseconds
-djetty.reload
For example:"Mvn-djetty.reload=manual jetty:run" will force manual overloading, regardless of how the Pom.xml file is configured. Similarly : "mvn-djetty.reload=automatic-djetty.scanintervalseconds=10 jetty:run" will reload in the background every 10 seconds, regardless of pom.xml How to configure it in the file.
About Maven-jetty-plugin Automatic restart problem