豪仕知识网--知识就是力量!

微信
手机版
生活常识

eclipse构建及运行mavenweb项目,eclipse搭建maven环境

作者 :慕容渊博 2024-01-09 09:05:02 围观 : 评论

eclipse构建及运行mavenweb项目,eclipse搭建maven环境

豪士君测试所用平台

eclipse构建及运行mavenweb项目,一起来看看吧,希望能帮助到您,更多请关注豪仕知识网。

简单讲下maven的安装步骤:

◐◐◐◐●☛█▼▲豪仕知识网███████豪仕知识http://www.Haoz.net▼▲▼▲▼▲▼▲▼●●●●●●●▼▲▼▲▼▲

1.在安装maven之前,先确保已经安装JDK1.6及以上版本,并且配置好环境变量。

2.下载maven3,最新版本是Maven3.0.4 ,下载地址:http://maven.apache.org/download.html

◐◐◐◐●☛█▼▲豪仕知识网HT●☛█▼▲◐◐◐◐●☛█▼▲

下载apache-maven-3.0.4-bin.zip文件后,并解压到 D:\cloud_cms\maven\apache-maven-3.0.4

3.配置maven3的环境变量:先配置M2_HOME的环境变量,新建一个系统变量:M2_HOME , 路径是:D:\cloud_cms\maven\apache-maven-3.0.4,如图所示:

http://www.haoz.net●☛█▼▲◐●☛█▼▲◐◐◐◐●☛█▼▲◐豪仕知识网●☛█▼▲豪仕知识网

再配置path环境变量,在path值的末尾添加"%M2_HOME%\bin",如下图所示;

◐◐◐◐●☛█▼▲◐◐◐◐●☛█▼▲◐◐◐◐●☛█▼▲豪仕知识网HtTp://▲▼▲▼▲

5.点击确定之后,打开cmd窗口:输入 mvn -version,出现如下内容表示安装成功。

1:环境

◐◐◐◐●☛█▼▲豪仕知识网http://www.haOz.net▼▲▼▲▼▲▼▲▼●●●●●●●▼▲▼▲▼▲

eclipse indigo,

●☛█▼▲豪仕知识网◐◐◐◐●☛█▼▲◐◐◐◐●☛█▼▲

JDK1.6,

maven 3.2.1,

tomcat7.0.42

◐◐◐◐●☛█▼▲豪仕知识网███████豪仕知识http://www.Haoz.net▼▲▼▲▼▲▼▲▼●●●●●●●▼▲▼▲▼▲

2:安装eclipse maven插件 m2eclipse

第一种方法:从网上下载m2eclipse,这个网上有很多下载的地方。然后放到eclipse安装目录的plugins下。

◐◐◐◐●☛█▼▲豪仕知识网███████豪仕知识http://www.Haoz.net▼▲▼▲▼▲▼▲▼●●●●●●●▼▲▼▲▼▲

第二种方法:打开eclipse->help->install new software。在work with后输入:http://download.eclipse.org/technology/m2e/releases。如图:

3:下载maven和tomcat

上apache官网下载maven:/d/file/2024/01/09/61618 ◐◐◐◐●☛█▼▲豪仕知识网http://www.haOz.net▼▲▼▲▼▲▼▲▼●●●●●●●▼▲▼▲▼▲

上apache官网下载tomcat:http://tomcat.apache.org/。

4:eclipse配置maven

window-》prefrences-》maven-》user setting。如图

http://www.haoz.net●☛█▼▲◐●☛█▼▲◐◐◐◐●☛█▼▲◐豪仕知识网●☛█▼▲豪仕知识网

window-》prefrences-》maven-》installations。如图

◐◐◐◐●☛█▼▲◐◐◐◐●☛█▼▲◐◐◐◐●☛█▼▲豪仕知识网HtTp://▲▼▲▼▲

5:配置tomcat和maven

进入tomcat_home/conf/tomcat_users.xml:修改如下:

[html]

◐◐◐◐●☛█▼▲豪仕知识网███████豪仕知识http://www.Haoz.net▼▲▼▲▼▲▼▲▼●●●●●●●▼▲▼▲▼▲

◐◐◐◐●☛█▼▲◐◐◐◐●☛█▼▲◐◐◐◐●☛█▼▲HTTP://WWW.hAoz.net███████████████████████████东方金报网

◐◐◐◐●☛█▼▲豪仕知识网http://www.haOz.net▼▲▼▲▼▲▼▲▼●●●●●●●▼▲▼▲▼▲

◐◐◐◐●☛█▼▲◐◐◐◐●☛█▼▲◐◐◐◐●☛█▼▲豪仕知识网HtTp://▲▼▲▼▲

进入maven_home/conf/settings.xml:修改如下:

[html]

http://www.haoz.net●☛█▼▲◐●☛█▼▲◐◐◐◐●☛█▼▲◐豪仕知识网●☛█▼▲豪仕知识网

◐◐◐◐●☛█▼▲豪仕知识网███████豪仕知识http://www.Haoz.net▼▲▼▲▼▲▼▲▼●●●●●●●▼▲▼▲▼▲

tomcat

◐◐◐◐●☛█▼▲豪仕知识网HT●☛█▼▲◐◐◐◐●☛█▼▲

admin

admin

◐◐◐◐●☛█▼▲豪仕知识网███████豪仕知识网HTtp://www.haoZ.net▼▲▼▲▼▲▼▲▼●●●●●●●▼▲▼▲▼▲

6:eclipse创建maven web项目

这个简单,new-》other-》maven project-》next。这里注意groupid选org.apache.maven.archetypes,artifactid 选maven-archetype-webapp,然后next,输入我们自己的groupid(com.test),artifactid(transition),然后finish,OK。如图所示:

7:修改pom.xml

◐◐◐◐●☛█▼▲豪仕知识网HT●☛█▼▲◐◐◐◐●☛█▼▲

[html]

<projectxmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

◐◐◐◐●☛█▼▲◐◐◐◐●☛█▼▲HtTp://wWW.haoz.net豪仕知识网●●●●●●●●●●●●●●●●●●●●●●●●●●

xsi:schemaLocation="http://maven.apache.org/POM/4.0.0http://maven.apache.org/maven-v4_0_0.xsd">

●☛█▼▲豪仕知识网◐◐◐◐●☛█▼▲◐◐◐◐●☛█▼▲

4.0.0

com.test

◐◐◐◐●☛█▼▲豪仕知识网███████http://www.haOZ.net▼▲▼▲▼▲▼▲▼●●●●●●●▼▲▼▲▼▲

transition

◐◐◐◐●☛█▼▲豪仕知识网███████豪仕知识网HTtp://www.haoZ.net▼▲▼▲▼▲▼▲▼●●●●●●●▼▲▼▲▼▲

war

0.0.1

transitionMavenWebapp

◐◐◐◐●☛█▼▲豪仕知识网███████豪仕知识http://www.Haoz.net▼▲▼▲▼▲▼▲▼●●●●●●●▼▲▼▲▼▲

http://maven.apache.org

◐◐◐◐●☛█▼▲◐◐◐◐●☛█▼▲HtTp://wWW.haoz.net豪仕知识网●●●●●●●●●●●●●●●●●●●●●●●●●●

maven_remote_1

http://mirrors.ibiblio.org/pub/mirrors/maven2/

http://www.haoz.net●☛█▼▲◐●☛█▼▲◐◐◐◐●☛█▼▲◐豪仕知识网●☛█▼▲豪仕知识网

◐◐◐◐●☛█▼▲豪仕知识网███████豪仕知识http://www.Haoz.net▼▲▼▲▼▲▼▲▼●●●●●●●▼▲▼▲▼▲

junit

junit

HTTP://WWW.haoz.net豪仕知识网采集不好玩哦◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐撒旦法师打发斯蒂芬

3.8.1

◐◐◐◐●☛█▼▲◐◐◐◐●☛█▼▲◐◐◐◐●☛█▼▲HTTP://WWW.hAoz.net███████████████████████████东方金报网

test

HTTP://WWW.haoz.net豪仕知识网采集不好玩哦◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐撒旦法师打发斯蒂芬

◐◐◐◐●☛█▼▲◐◐◐◐●☛█▼▲◐◐◐◐●☛█▼▲豪仕知识网HtTp://▲▼▲▼▲

transition

http://www.haoz.net●☛█▼▲◐●☛█▼▲◐◐◐◐●☛█▼▲◐豪仕知识网●☛█▼▲豪仕知识网

org.codehaus.mojo

tomcat-maven-plugin

◐◐◐◐●☛█▼▲◐◐◐◐●☛█▼▲◐◐◐◐●☛█▼▲HTTP://WWW.hAoz.net███████████████████████████东方金报网

target/transition.war

◐◐◐◐●☛█▼▲豪仕知识网███████http://www.haOZ.net▼▲▼▲▼▲▼▲▼●●●●●●●▼▲▼▲▼▲

tomcat

http://localhost:8080/manager/text

/transition

◐◐◐◐●☛█▼▲豪仕知识网███████豪仕知识网HTtp://www.haoZ.net▼▲▼▲▼▲▼▲▼●●●●●●●▼▲▼▲▼▲

http://www.haoz.net●☛█▼▲◐●☛█▼▲◐◐◐◐●☛█▼▲◐豪仕知识网●☛█▼▲豪仕知识网

豪仕知识网http://www.haoz.net▼▲▼▲▼▲▼▲▼●●●●●●●▼▲▼▲▼▲

◐◐◐◐●☛█▼▲◐◐◐◐●☛█▼▲◐◐◐◐●☛█▼▲HTTP://WWW.hAoz.net███████████████████████████东方金报网

豪仕知识网http://www.haoz.net▼▲▼▲▼▲▼▲▼●●●●●●●▼▲▼▲▼▲

8:运行maven项目

先进入tomcat目录启动tomcat,然后右键项目 run as-》run configrations:

Goals项输入:package tomcat:redeploy

◐◐◐◐●☛█▼▲◐◐◐◐●☛█▼▲◐◐◐◐●☛█▼▲豪仕知识网HtTp://▲▼▲▼▲

Maven Runtime选择我们自己的maven。如图:

◐◐◐◐●☛█▼▲豪仕知识网http://www.haOz.net▼▲▼▲▼▲▼▲▼●●●●●●●▼▲▼▲▼▲

然后点Run,控制台显示如下:

◐◐◐◐●☛█▼▲豪仕知识网███████豪仕知识网HTtp://www.haoZ.net▼▲▼▲▼▲▼▲▼●●●●●●●▼▲▼▲▼▲

[plain]

[INFO]Processingwarproject

[INFO]Copyingwebappresources[E:\transition\src\main\webapp]

http://www.haoz.net●☛█▼▲◐●☛█▼▲◐◐◐◐●☛█▼▲◐豪仕知识网●☛█▼▲豪仕知识网

[INFO]Webappassembledin[3msecs]

[INFO]Buildingwar:E:\transition\target\transition.war

◐◐◐◐●☛█▼▲豪仕知识网HT●☛█▼▲◐◐◐◐●☛█▼▲

[INFO]WEB-INF\web.xmlalreadyadded,skipping

◐◐◐◐●☛█▼▲◐◐◐◐●☛█▼▲◐◐◐◐●☛█▼▲HTTP://WWW.hAoz.net███████████████████████████东方金报网

[INFO]

[INFO]<<<tomcat-maven-plugin:1.1:redeploy(default-cli)@transition<<<

[INFO]

◐◐◐◐●☛█▼▲◐◐◐◐●☛█▼▲◐◐◐◐●☛█▼▲HTTP://WWW.hAoz.net███████████████████████████东方金报网

[INFO]---tomcat-maven-plugin:1.1:redeploy(default-cli)@transition---

[INFO]Deployingwartohttp://localhost:8080/transition

[INFO]OK-Undeployedapplicationatcontextpath/transition

HTTP://WWW.haoz.net◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐豪仕知识网

[INFO]OK-Deployedapplicationatcontextpath/transition

[INFO]------------------------------------------------------------------------

[INFO]BUILDSUCCESS

HTTP://WWW.haoz.net◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐豪仕知识网

[INFO]------------------------------------------------------------------------

[INFO]Totaltime:2.412s

HTTP://WWW.haoz.net◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐豪仕知识网

[INFO]Finishedat:2014-03-13T11:43:42+08:00

[INFO]FinalMemory:6M/15M

◐◐◐◐●☛█▼▲◐◐◐◐●☛█▼▲◐◐◐◐●☛█▼▲豪仕知识网HtTp://▲▼▲▼▲

[INFO]------------------------------------------------------------------------

这里省略很多控制台输出,出现BUILD SUCCESS 则说明部署成功,浏览器输入:http://localhost:8080/transition/。显示Hello world..

注意:这样成功之后项目会直接打成war包,部署到tomcat下,每次build不需要重启tomcat。这样致命的缺点就是,不能调试。如果需要调试且在eclipse中启动tomcat的话。会发现右键项目没有run as server,有两种方法解决:

HTTP://WWW.haoz.net豪仕知识网采集不好玩哦◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐撒旦法师打发斯蒂芬

第一种:这时需要把项目转变成dynamic web module。右键项目-》properties-》project facets,然后右边选中dynamic web module。之后就会出现run as server了.

第二种:右键项目,run/debug as configrations 如上第8步骤的图。不过Goals中天上【tomcat:run】。然后run就OK了,注意这里不需要提前启动tomcat。

◐◐◐◐●☛█▼▲豪仕知识网███████豪仕知识http://www.Haoz.net▼▲▼▲▼▲▼▲▼●●●●●●●▼▲▼▲▼▲

简单讲下maven的安装步骤:

◐◐◐◐●☛█▼▲豪仕知识网http://www.haOz.net▼▲▼▲▼▲▼▲▼●●●●●●●▼▲▼▲▼▲

1.在安装maven之前,先确保已经安装JDK1.6及以上版本,并且配置好环境变量。

◐◐◐◐●☛█▼▲◐◐◐◐●☛█▼▲◐◐◐◐●☛█▼▲HTTP://WWW.hAoz.net███████████████████████████东方金报网

2.下载maven3,最新版本是Maven3.0.4 ,下载地址:http://maven.apache.org/download.html

◐◐◐◐●☛█▼▲◐◐◐◐●☛█▼▲HtTp://wWW.haoz.net豪仕知识网●●●●●●●●●●●●●●●●●●●●●●●●●●

下载apache-maven-3.0.4-bin.zip文件后,并解压到 D:\cloud_cms\maven\apache-maven-3.0.4

3.配置maven3的环境变量:先配置M2_HOME的环境变量,新建一个系统变量:M2_HOME , 路径是:D:\cloud_cms\maven\apache-maven-3.0.4,如图所示:

再配置path环境变量,在path值的末尾添加"%M2_HOME%\bin",如下图所示;

◐◐◐◐●☛█▼▲豪仕知识网HT●☛█▼▲◐◐◐◐●☛█▼▲

5.点击确定之后,打开cmd窗口:输入 mvn -version,出现如下内容表示安装成功。

1:环境

eclipse indigo,

HTTP://WWW.haoz.net◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐豪仕知识网

JDK1.6,

maven 3.2.1,

tomcat7.0.42

http://www.haoz.net●☛█▼▲◐●☛█▼▲◐◐◐◐●☛█▼▲◐豪仕知识网●☛█▼▲豪仕知识网

2:安装eclipse maven插件 m2eclipse

第一种方法:从网上下载m2eclipse,这个网上有很多下载的地方。然后放到eclipse安装目录的plugins下。

第二种方法:打开eclipse->help->install new software。在work with后输入:http://download.eclipse.org/technology/m2e/releases。如图:

◐◐◐◐●☛█▼▲豪仕知识网███████豪仕知识http://www.Haoz.net▼▲▼▲▼▲▼▲▼●●●●●●●▼▲▼▲▼▲

3:下载maven和tomcat

上apache官网下载maven:/d/file/2024/01/09/61618 ◐◐◐◐●☛█▼▲豪仕知识网http://www.haOz.net▼▲▼▲▼▲▼▲▼●●●●●●●▼▲▼▲▼▲

上apache官网下载tomcat:http://tomcat.apache.org/。

4:eclipse配置maven

window-》prefrences-》maven-》user setting。如图

●☛█▼▲豪仕知识网◐◐◐◐●☛█▼▲◐◐◐◐●☛█▼▲

window-》prefrences-》maven-》installations。如图

5:配置tomcat和maven

◐◐◐◐●☛█▼▲豪仕知识网███████豪仕知识http://www.Haoz.net▼▲▼▲▼▲▼▲▼●●●●●●●▼▲▼▲▼▲

进入tomcat_home/conf/tomcat_users.xml:修改如下:

HTTP://WWW.haoz.net◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐豪仕知识网

[html]

◐◐◐◐●☛█▼▲豪仕知识网███████豪仕知识http://www.Haoz.net▼▲▼▲▼▲▼▲▼●●●●●●●▼▲▼▲▼▲

◐◐◐◐●☛█▼▲豪仕知识网███████http://www.haOZ.net▼▲▼▲▼▲▼▲▼●●●●●●●▼▲▼▲▼▲

◐◐◐◐●☛█▼▲豪仕知识网http://www.haOz.net▼▲▼▲▼▲▼▲▼●●●●●●●▼▲▼▲▼▲

◐◐◐◐●☛█▼▲豪仕知识网http://www.haOz.net▼▲▼▲▼▲▼▲▼●●●●●●●▼▲▼▲▼▲

进入maven_home/conf/settings.xml:修改如下:

◐◐◐◐●☛█▼▲豪仕知识网███████豪仕知识http://www.Haoz.net▼▲▼▲▼▲▼▲▼●●●●●●●▼▲▼▲▼▲

[html]

tomcat

HTTP://WWW.haoz.net豪仕知识网采集不好玩哦◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐撒旦法师打发斯蒂芬

admin

admin

◐◐◐◐●☛█▼▲◐◐◐◐●☛█▼▲◐◐◐◐●☛█▼▲豪仕知识网HtTp://▲▼▲▼▲

6:eclipse创建maven web项目

这个简单,new-》other-》maven project-》next。这里注意groupid选org.apache.maven.archetypes,artifactid 选maven-archetype-webapp,然后next,输入我们自己的groupid(com.test),artifactid(transition),然后finish,OK。如图所示:

◐◐◐◐●☛█▼▲◐◐◐◐●☛█▼▲◐◐◐◐●☛█▼▲豪仕知识网HtTp://▲▼▲▼▲

7:修改pom.xml

[html]

<projectxmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

◐◐◐◐●☛█▼▲豪仕知识网http://www.haOz.net▼▲▼▲▼▲▼▲▼●●●●●●●▼▲▼▲▼▲

xsi:schemaLocation="http://maven.apache.org/POM/4.0.0http://maven.apache.org/maven-v4_0_0.xsd">

◐◐◐◐●☛█▼▲◐◐◐◐●☛█▼▲◐◐◐◐●☛█▼▲豪仕知识网HtTp://▲▼▲▼▲

4.0.0

com.test

transition

◐◐◐◐●☛█▼▲◐◐◐◐●☛█▼▲HtTp://wWW.haoz.net豪仕知识网●●●●●●●●●●●●●●●●●●●●●●●●●●

war

◐◐◐◐●☛█▼▲豪仕知识网HT●☛█▼▲◐◐◐◐●☛█▼▲

0.0.1

◐◐◐◐●☛█▼▲豪仕知识网http://www.haOz.net▼▲▼▲▼▲▼▲▼●●●●●●●▼▲▼▲▼▲

transitionMavenWebapp

http://maven.apache.org

HTTP://WWW.haoz.net豪仕知识网采集不好玩哦◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐撒旦法师打发斯蒂芬

http://www.haoz.net●☛█▼▲◐●☛█▼▲◐◐◐◐●☛█▼▲◐豪仕知识网●☛█▼▲豪仕知识网

maven_remote_1

http://mirrors.ibiblio.org/pub/mirrors/maven2/

◐◐◐◐●☛█▼▲豪仕知识网http://www.haOz.net▼▲▼▲▼▲▼▲▼●●●●●●●▼▲▼▲▼▲

◐◐◐◐●☛█▼▲豪仕知识网███████http://www.haOZ.net▼▲▼▲▼▲▼▲▼●●●●●●●▼▲▼▲▼▲

HTTP://WWW.haoz.net豪仕知识网采集不好玩哦◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐撒旦法师打发斯蒂芬

junit

junit

3.8.1

◐◐◐◐●☛█▼▲豪仕知识网███████豪仕知识http://www.Haoz.net▼▲▼▲▼▲▼▲▼●●●●●●●▼▲▼▲▼▲

test

◐◐◐◐●☛█▼▲豪仕知识网███████http://www.haOZ.net▼▲▼▲▼▲▼▲▼●●●●●●●▼▲▼▲▼▲

transition

◐◐◐◐●☛█▼▲豪仕知识网http://www.haOz.net▼▲▼▲▼▲▼▲▼●●●●●●●▼▲▼▲▼▲

◐◐◐◐●☛█▼▲◐◐◐◐●☛█▼▲◐◐◐◐●☛█▼▲HTTP://WWW.hAoz.net███████████████████████████东方金报网

org.codehaus.mojo

◐◐◐◐●☛█▼▲◐◐◐◐●☛█▼▲HtTp://wWW.haoz.net豪仕知识网●●●●●●●●●●●●●●●●●●●●●●●●●●

tomcat-maven-plugin

target/transition.war

◐◐◐◐●☛█▼▲◐◐◐◐●☛█▼▲◐◐◐◐●☛█▼▲HTTP://WWW.hAoz.net███████████████████████████东方金报网

tomcat

◐◐◐◐●☛█▼▲◐◐◐◐●☛█▼▲HtTp://wWW.haoz.net豪仕知识网●●●●●●●●●●●●●●●●●●●●●●●●●●

http://localhost:8080/manager/text

/transition

◐◐◐◐●☛█▼▲◐◐◐◐●☛█▼▲HtTp://wWW.haoz.net豪仕知识网●●●●●●●●●●●●●●●●●●●●●●●●●●

◐◐◐◐●☛█▼▲豪仕知识网███████http://www.haOZ.net▼▲▼▲▼▲▼▲▼●●●●●●●▼▲▼▲▼▲

◐◐◐◐●☛█▼▲◐◐◐◐●☛█▼▲◐◐◐◐●☛█▼▲豪仕知识网HtTp://▲▼▲▼▲

◐◐◐◐●☛█▼▲豪仕知识网███████http://www.haOZ.net▼▲▼▲▼▲▼▲▼●●●●●●●▼▲▼▲▼▲

8:运行maven项目

先进入tomcat目录启动tomcat,然后右键项目 run as-》run configrations:

●☛█▼▲豪仕知识网◐◐◐◐●☛█▼▲◐◐◐◐●☛█▼▲

Goals项输入:package tomcat:redeploy

Maven Runtime选择我们自己的maven。如图:

然后点Run,控制台显示如下:

◐◐◐◐●☛█▼▲◐◐◐◐●☛█▼▲◐◐◐◐●☛█▼▲HTTP://WWW.hAoz.net███████████████████████████东方金报网

[plain]

[INFO]Processingwarproject

◐◐◐◐●☛█▼▲豪仕知识网███████豪仕知识http://www.Haoz.net▼▲▼▲▼▲▼▲▼●●●●●●●▼▲▼▲▼▲

[INFO]Copyingwebappresources[E:\transition\src\main\webapp]

[INFO]Webappassembledin[3msecs]

[INFO]Buildingwar:E:\transition\target\transition.war

HTTP://WWW.haoz.net◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐豪仕知识网

[INFO]WEB-INF\web.xmlalreadyadded,skipping

●☛█▼▲豪仕知识网◐◐◐◐●☛█▼▲◐◐◐◐●☛█▼▲

[INFO]

◐◐◐◐●☛█▼▲豪仕知识网███████豪仕知识网HTtp://www.haoZ.net▼▲▼▲▼▲▼▲▼●●●●●●●▼▲▼▲▼▲

[INFO]<<<tomcat-maven-plugin:1.1:redeploy(default-cli)@transition<<<

豪仕知识网http://www.haoz.net▼▲▼▲▼▲▼▲▼●●●●●●●▼▲▼▲▼▲

[INFO]

[INFO]---tomcat-maven-plugin:1.1:redeploy(default-cli)@transition---

[INFO]Deployingwartohttp://localhost:8080/transition

HTTP://WWW.haoz.net豪仕知识网采集不好玩哦◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐撒旦法师打发斯蒂芬

[INFO]OK-Undeployedapplicationatcontextpath/transition

HTTP://WWW.haoz.net豪仕知识网采集不好玩哦◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐撒旦法师打发斯蒂芬

[INFO]OK-Deployedapplicationatcontextpath/transition

[INFO]------------------------------------------------------------------------

[INFO]BUILDSUCCESS

◐◐◐◐●☛█▼▲豪仕知识网███████豪仕知识http://www.Haoz.net▼▲▼▲▼▲▼▲▼●●●●●●●▼▲▼▲▼▲

[INFO]------------------------------------------------------------------------

●☛█▼▲豪仕知识网◐◐◐◐●☛█▼▲◐◐◐◐●☛█▼▲

[INFO]Totaltime:2.412s

◐◐◐◐●☛█▼▲豪仕知识网███████豪仕知识网HTtp://www.haoZ.net▼▲▼▲▼▲▼▲▼●●●●●●●▼▲▼▲▼▲

[INFO]Finishedat:2014-03-13T11:43:42+08:00

[INFO]FinalMemory:6M/15M

HTTP://WWW.haoz.net豪仕知识网采集不好玩哦◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐◐撒旦法师打发斯蒂芬

[INFO]------------------------------------------------------------------------

这里省略很多控制台输出,出现BUILD SUCCESS 则说明部署成功,浏览器输入:http://localhost:8080/transition/。显示Hello world..

注意:这样成功之后项目会直接打成war包,部署到tomcat下,每次build不需要重启tomcat。这样致命的缺点就是,不能调试。如果需要调试且在eclipse中启动tomcat的话。会发现右键项目没有run as server,有两种方法解决:

◐◐◐◐●☛█▼▲◐◐◐◐●☛█▼▲◐◐◐◐●☛█▼▲HTTP://WWW.hAoz.net███████████████████████████东方金报网

第一种:这时需要把项目转变成dynamic web module。右键项目-》properties-》project facets,然后右边选中dynamic web module。之后就会出现run as server了.

http://www.haoz.net●☛█▼▲◐●☛█▼▲◐◐◐◐●☛█▼▲◐豪仕知识网●☛█▼▲豪仕知识网

第二种:右键项目,run/debug as configrations 如上第8步骤的图。不过Goals中天上【tomcat:run】。然后run就OK了,注意这里不需要提前启动tomcat。

关于eclipse构建及运行mavenweb项目的内容到此结束,希望对大家有所帮助。豪仕知识网往后会继续推荐eclipse构建及运行mavenweb项目相关内容。

相关文章