Maven jetty plugin

Source: Internet
Author: User

 


TIPS ==================


Mvn jetty: run, run automatically, use the class in/target/classes, use the webapp in src/main/webapp, and use the web. xml in src/main/webapp/WEB-INF/web. xml
After it is started, the system automatically monitors file loading changes. You can modify and test the changes in eclipse.
The following configuration can be used to automatically start and stop an integration test.
[Html] <executions>
<Execution>
<Id> start-jetty </id>
<Phase> pre-integration-test </phase> execution period>
<Goals>
<Goal> run </goal> execution target
</Goals>
<Configuration>
<ScanIntervalSeconds> 0 </scanIntervalSeconds>
<Daemon> true </daemon>
</Configuration>
</Execution>
<Execution>
<Id> stop-jetty </id>
<Phase> post-integration-test </phase>
<Goals>
<Goal> stop </goal>
</Goals>
</Execution>
</Executions>

<Executions>
<Execution>
<Id> start-jetty </id>
<Phase> pre-integration-test </phase> execution period>
<Goals>
<Goal> run </goal> execution target
</Goals>
<Configuration>
<ScanIntervalSeconds> 0 </scanIntervalSeconds>
<Daemon> true </daemon>
</Configuration>
</Execution>
<Execution>
<Id> stop-jetty </id>
<Phase> post-integration-test </phase>
<Goals>
<Goal> stop </goal>
</Goals>
</Execution>
</Executions>


[Html] Port, root, and other configurations:
 
<Configuration>
 
<Contextpath>/</contextpath>
 
<Connectors>
 
<Connector implementation = "org. mortbay. jetty. nio. SelectChannelConnector">
 
<Port> 8080 </port>
 
<Maxidletime> 60000 </maxidletime>
 
</Connector>
 
</Connectors>
 
<Scanintervalseconds> 10 </scanintervalseconds> // scan time for resource file changes
 
<Webdefaultxml> src/main/resources/webdefault. xml </webdefaxml xml> // This file replaces src/webapp/WEB-INF/web. xml
 
<Webappsourcedirectory >$ {basedir}/src/staticfiles </webappsourcedirectory>/default is src/webapp
 
<Webxml> $ {basedir}/src/over/here/web. xml </webxml> // default is src/webapp/WEB-INF/web. xml
 
<Classesdirectory >$ {basedir}/somewhere/else </classesdirectory> // default is target/classes/
 
</Configuration>

Port, root, and other configurations:

<Configuration>

<Contextpath>/</contextpath>

<Connectors>

<Connector implementation = "org. mortbay. jetty. nio. SelectChannelConnector">

<Port> 8080 </port>

<Maxidletime> 60000 </maxidletime>

</Connector>

</Connectors>

<Scanintervalseconds> 10 </scanintervalseconds> // scan time for resource file changes

<Webdefaultxml> src/main/resources/webdefault. xml </webdefaxml xml> // This file replaces src/webapp/WEB-INF/web. xml

<Webappsourcedirectory >$ {basedir}/src/staticfiles </webappsourcedirectory>/default is src/webapp

<Webxml> $ {basedir}/src/over/here/web. xml </webxml> // default is src/webapp/WEB-INF/web. xml

<Classesdirectory >$ {basedir}/somewhere/else </classesdirectory> // default is target/classes/

</Configuration>


You can also specify mvn-D jetty. port = 9999 jetty: run by using command parameters.
Mvn jetty: run-war, mvn jetty: deploy-war runs $ {project by default. build. directory}/$ {project. build. finalName }. the difference is that jetty: deploy-war does not trigger compilation, and mvn cycles such as testing

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.