如何通过maven创建基于eclipse的web应用(带操作视频)

1.首先到http://maven.apache.org/download.html下载maven
2.在本地解压缩后 配置环境变量M2_HOME=maven的解压目录
3.打开命令窗口 mvn -v 确定mvn是否安装成功

在eclipse中安装Maven2eclipse插件 插件地址是http://m2eclipse.sonatype.org/update/

1.mvn archetype:create -DgroupId=org.chz -DartifactId=tapestry-test -DpackageName=org.chz.hnpp.tapestry -DarchetypeArtifactId=maven-archetype-webapp

2.在tapestry-test/src/main/目录中创建java目录
3.然后在java目录下建org/chz
4.进入tapestry-test目录
5.mvn eclipse:eclipse 创建eclipse工程文件Dwtpversion=1.5
6.在eclipse中导入工程文件
7.在eclipse中工程属性的java build path中的libraries标签中添加Server Runtime库
8.在eclipse中右键点击工程选择 maven->Enable dependency Management

启动服务,访问地址
http://127.0.0.1:8080/tapestry-test/

zhuanzi"http://gongstring.javaeye.com/blog/455756

原文地址:https://www.cnblogs.com/zyxzhsh/p/1876502.html