码迷,mamicode.com
首页 > 其他好文 > 详细

Command mvn jetty:run

时间:2014-11-01 19:06:02      阅读:274      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   io   color   os   ar   java   for   

How to use the command mav jetty:run?

There is a simple display as below:

Step 1:

   You should generate a web project with maven first. 

   you could go to "Using Maven to generate a Java Project or Web project" to know how to generate a Web project with maven in Windows 7.

 

Step 2:

   Change the pom.xml in as bellow in the web project you have generated just now.

<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.b510.shopping</groupId>
  <artifactId>shopping-core</artifactId>
  <packaging>war</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>shopping-core Maven Webapp</name>
  <url>http://maven.apache.org</url>
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <build>
    <finalName>shopping-core</finalName>
    <pluginManagement>
    <!--Configuration for Jetty-->
      <plugins>
        <plugin>
         <groupId>org.mortbay.jetty</groupId>   
         <artifactId>maven-jetty-plugin</artifactId>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>
</project>

 

Step 3:

   Type the command mvn jetty:run

 NOTE: You shoud go to the "F:/maven/shopping-core" directory to execute above command.

bubuko.com,布布扣

Step 4:

 Open a broswer and type "http://localhost:8080/shopping-core"

bubuko.com,布布扣

 

========================================================

More reading,and english is important.

I‘m Hongten

bubuko.com,布布扣

 

E | hongtenzone@foxmail.com  B | http://www.cnblogs.com/hongten

========================================================

 

Command mvn jetty:run

标签:style   blog   http   io   color   os   ar   java   for   

原文地址:http://www.cnblogs.com/hongten/p/hongten_maven_jetty.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!