Jetty debugging methods directly in Eclipse

Source: Internet
Author: User

Maven2 is much better than the 1 generation, and the main emphasis is that it's not just a dependency pack manager!
Start by recommending a Maven2 ebook for you, which is very useful for Maven learning: Better builds with maven


The following is a special introduction to the WebApp management and debugging support for the MAVEN2.

1. Create a project

MVN archetype:create-dgroupid=com.mycompany.app-dartifactid=my-webapp-darchetypeartifactid= Maven-archetype-webapp

Also refer to Here

Create a directory structure that is careful to follow Maven, with particular attention to the source file being placed under Main/java:



2. pom file configuration

Pay special attention to the configuration of the resource section, because my spring and web-related XML is placed in the Web-inf directory, so that it can be used at unit test, adding references to these profiles. It's equivalent to adding a classpath.

There is also an episode: I do not know why there is no JTA bag in the MAVEN2, automatic download will be prompted to teach you how to manually through the order to join, very simple.

Jetty's plugin is for the back to use it for debugging.

DWR is also currently a hot option for web development.

In addition, in order to use the JAVA5 generation to compile, joined the Maven-compiler-plugin section.
< project xmlns = "http://maven.apache.org/POM/4.0.0" xmlns:xsi = "Http://www.w3.org/2001/XMLSchema-instance"
Xsi:schemalocation = "http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd" >
< modelversion > 4.0.0 </modelversion >
< groupId > Com.exchangebit.nms </groupId >
< Artifactid > Ebnms </artifactid >
< packaging > War </Packaging >
< version > 1.0-snapshot </version >
< name > Ebnms Maven Webapp </name >
< URL > http://maven.apache.org </URL >

< build >
< Finalname > Ebnms </finalname >

< resources >
< Resource >
< directory > Src/main/java </directory >
< includes >
< include > **/*.xml </include >
</includes >
</Resource >
< Resource >
< directory > Src/main/webapp/web-inf </directory >
< includes >
< include > **/*.xml </include >
< include > **/log4j.properties </include >
</includes >
</Resource >
</Resources >

< plugins >
< plugin >
< groupId > Org.apache.maven.plugins </groupId >
< Artifactid > Maven-compiler-plugin </artifactid >
< configuration >
< source > 1.5 </Source >
< target > 1.5 </target >
</configuration >
</plugin >

< plugin >
< groupId > Org.mortbay.jetty </groupId >
< Artifactid > Maven-jetty-plugin </artifactid >
</plugin >

</Plugins >
</Build >

< dependencies >
< dependency >
< groupId > JUnit </groupId >
< Artifactid > JUnit </artifactid >
< version > 3.8.1 </version >
< scope > Test </scope >
</dependency >

< dependency >
< groupId > org.hibernate </groupId >
< Artifactid > Hibernate </

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.