1. 新建,maven project  下一步
  2. 不要选择 create a simple project,下一步
  3. filter 输入webapp,选择webapp 下一步
  4. 填写 group Id  com.XX  artifactId testXX ,package 可选
  5.  finish
  6. 结构如图java视图下 ,javeEE错误原因The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path ,等下maven引入 jsp 相关jar包即可解决
  7. 配置项目 已经有了src/main/resource 需要添加src/main/java,src/test/java ,src/test/resources三个文件夹。右键项目根目录点击New -> Source Folder,建出这三个文件夹
  8. 更改顺序,可用Order and Exprot 更改后如下
  9. 更改输入路径,右键Java Build Path -> Source 下面应该有4个文件夹。src/main/java,src/main /resources,src/test/java ,src/test/resources
    选上Allow output folders for source folders
    双击每个文件夹的Output folder,选择路径
    src/main/java,src/main/resources,选择target/classes;
    src/test/java ,src/test/resources, 选择target/test-classes;     
  10. 更改jre ,选择remove ,add Libray,添加 jre
  11. 把项目变成Dynamic Web项目 右键项目,properties 选择Project Facets,点击 选中 Dynamic Web Module ,OK
  12. 设置部署程序集(Web Deployment Assembly) 只留下即可,此处列表是,部署项目时,文件发布的路径。
    (1)我们删除test的两项,因为test是测试使用,并不需要部署。
    (2)设置将Maven的jar包发布到lib下。
  13. 构建框架 在pom.xml中添加所需要的jar包 一般添加如下,根据需要的功能添加
    1. <!-- 定义一些属性参数,一般是定义依赖的版本号 -->
    2. <properties>
    3. <junit.version>4.10</junit.version>
    4. <spring.version>4.0.6.RELEASE</spring.version>
    5. <mybatis.version>3.2.7</mybatis.version>
    6. <mybatis.spring.version>1.2.2</mybatis.spring.version>
    7. <mybatis.paginator.version>1.2.15</mybatis.paginator.version>
    8. <mysql.version>5.1.32</mysql.version>
    9. <druid.version>1.0.9</druid.version>
    10. <jstl.version>1.2</jstl.version>
    11. <servlet-api.version>2.5</servlet-api.version>
    12. <jsp-api.version>2.0</jsp-api.version>
    13. <commons-lang3.version>3.3.2</commons-lang3.version>
    14. <commons-io.version>1.3.2</commons-io.version>
    15. </properties>
    16. <dependencies>
    17. <!-- junit -->
    18. <dependency>
    19. <groupId>junit</groupId>
    20. <artifactId>junit</artifactId>
    21. <version>${junit.version}</version>
    22. <scope>test</scope>
    23. </dependency>
    24. <!--JSTL -->
    25. <dependency>
    26. <groupId>jstl</groupId>
    27. <artifactId>jstl</artifactId>
    28. <version>${jstl.version}</version>
    29. </dependency>
    30. <!-- Apache工具组件 -->
    31. <dependency>
    32. <groupId>org.apache.commons</groupId>
    33. <artifactId>commons-lang3</artifactId>
    34. <version>${commons-lang3.version}</version>
    35. </dependency>
    36. <!-- IO处理组件 -->
    37. <dependency>
    38. <groupId>org.apache.commons</groupId>
    39. <artifactId>commons-io</artifactId>
    40. <version>${commons-io.version}</version>
    41. </dependency>
    42. <!-- json工具类 -->
    43. <dependency>
    44. <groupId>com.alibaba</groupId>
    45. <artifactId>fastjson</artifactId>
    46. <version>1.1.41</version>
    47. </dependency>
    48. <!-- Spring -->
    49. <dependency>
    50. <groupId>org.springframework</groupId>
    51. <artifactId>spring-context</artifactId>
    52. <version>${spring.version}</version>
    53. </dependency>
    54. <!-- Spring MVC -->
    55. <dependency>
    56. <groupId>org.springframework</groupId>
    57. <artifactId>spring-webmvc</artifactId>
    58. <version>${spring.version}</version>
    59. </dependency>
    60. <dependency>
    61. <groupId>org.springframework</groupId>
    62. <artifactId>spring-jdbc</artifactId>
    63. <version>${spring.version}</version>
    64. </dependency>
    65. <dependency>
    66. <groupId>org.springframework</groupId>
    67. <artifactId>spring-aspects</artifactId>
    68. <version>${spring.version}</version>
    69. </dependency>
    70. <!-- Mybatis -->
    71. <dependency>
    72. <groupId>org.mybatis</groupId>
    73. <artifactId>mybatis</artifactId>
    74. <version>${mybatis.version}</version>
    75. </dependency>
    76. <dependency>
    77. <groupId>org.mybatis</groupId>
    78. <artifactId>mybatis-spring</artifactId>
    79. <version>${mybatis.spring.version}</version>
    80. </dependency>
    81. <dependency>
    82. <groupId>com.github.miemiedev</groupId>
    83. <artifactId>mybatis-paginator</artifactId>
    84. <version>${mybatis.paginator.version}</version>
    85. </dependency>
    86. <!-- MySql -->
    87. <dependency>
    88. <groupId>mysql</groupId>
    89. <artifactId>mysql-connector-java</artifactId>
    90. <version>${mysql.version}</version>
    91. </dependency>
    92. <!-- 链接池 -->
    93. <dependency>
    94. <groupId>com.alibaba</groupId>
    95. <artifactId>druid</artifactId>
    96. <version>${druid.version}</version>
    97. </dependency>
    98. <!-- JSP相关 -->
    99. <dependency>
    100. <groupId>jstl</groupId>
    101. <artifactId>jstl</artifactId>
    102. <version>${jstl.version}</version>
    103. </dependency>
    104. <dependency>
    105. <groupId>javax.servlet</groupId>
    106. <artifactId>servlet-api</artifactId>
    107. <version>${servlet-api.version}</version>
    108. <scope>provided</scope>
    109. </dependency>
    110. <dependency>
    111. <groupId>javax.servlet</groupId>
    112. <artifactId>jsp-api</artifactId>
    113. <version>${jsp-api.version}</version>
    114. <scope>provided</scope>
    115. </dependency>
    116. <!-- 文件上传组件 -->
    117. <dependency>
    118. <groupId>commons-fileupload</groupId>
    119. <artifactId>commons-fileupload</artifactId>
    120. <version>1.3.1</version>
    121. </dependency>
    122. </dependencies>
  14. 发布 对着工程点右键:Run As ->Maven install 


    创建server 切换到javeEE 视图,点击
    选择自己的tomcat 版本,名称什么,下一步
来自为知笔记(Wiz)

转载于:https://www.cnblogs.com/liubo6/p/4491133.html

eclipse 构建maven web工程相关推荐

  1. Eclipse中Maven WEB工程tomcat调试

    http://blog.csdn.net/clj198606061111/article/details/20221133 转载于:https://www.cnblogs.com/wulongbo/p ...

  2. Eclipse 使用 Maven 构建动态 Web 工程,默认无 java 目录的解决方法

    Eclipse 使用 Maven 构建动态 Web 工程,默认无 java 目录的解决方法 太阳火神的美丽人生 (http://blog.csdn.net/opengl_es) 本文遵循"署 ...

  3. 配置Tomcat和在Eclipse中创建Web工程

    配置Tomcat服务器信息: 在Tomcat的安装目录下有一个conf目录,里面存放着Tomcat服务器的配置文件,其中最为核心的配置文件是server.xml,在这个文件里我们可以配置服务器的各种参 ...

  4. Maven实战(三)Eclipse构建Maven项目

    2019独角兽企业重金招聘Python工程师标准>>> 1. 安装m2eclipse插件     要用Eclipse构建Maven项目,我们需要先安装meeclipse插件     ...

  5. 使用Eclipse构建Maven的SpringMVC项目

    http://limingnihao.iteye.com/blog/830409 使用Eclipse构建Maven的SpringMVC项目 首先Eclipse需要安装Maven的插件,地址:http: ...

  6. Java归去来第2集:利用Eclipse创建Maven Web项目

    一.前言 如果还不了解剧情,请返回第一集的剧情          Java归去来第1集:手动给Eclipse配置Maven环境 二.利用Eclipse创建Maven Web项目 选择File-New- ...

  7. idea maven web工程明明添加了maven lib的依赖,但启动web容器时始终报No Class Found?...

    idea maven web工程明明添加了maven lib的依赖,但启动web容器时始终报No Class Found? 很久没用idea搭新工程,最近自己想做个东西,冲心搭个web工程,jar包都 ...

  8. 创建的Maven Web工程无法部署到服务器及web-app_2_3.dtd规范

    参考:https://blog.csdn.net/east_mrchiu/article/details/69802595 二.web.xml文件里面报错处理 创建了一个maven web工程,写we ...

  9. 使用IDEA创建一个Maven Web工程:无法创建Java Class文件

    今天用IDEA新建了一个maven web工程,项目目录是这样的: 在新创建一个Java class 文件时,却没有Java class功能,无法创建,如图: 解决方案: 选择 File-->P ...

最新文章

  1. 第六天2017/04/11(1:结构体链表基础和相关经典操作)
  2. php签名墙,肺功能检查质量控制网
  3. 简明Python教程学习笔记_5_解决问题
  4. 开源极速的人脸跟踪-基于OpenTLD与RNet
  5. php的具体配置学习笔记
  6. 处理机调度的概念,层次
  7. php跳转方式带rere_PHP利用REFERER根居访问来地址进行页面跳转
  8. Makefile 编写规则
  9. 华为路由器:AR真机忘记Console口密码的处理方法全过程演示
  10. 计算机专业毕业论文写作指导(案例超详解)
  11. 国防科大 计算机原理考研试题,国防科技大学考研2003年计算机原理试题
  12. vue导出word模版文档
  13. 如何在WordPress中的页面上添加博客文章
  14. javacv 人脸追踪_基于JavaCV的人脸识别程序
  15. substring从指定字符串开始截取
  16. 《与君对酒》 徐正坤
  17. 怎么下载老版本android,剪映旧版下载
  18. idea 中git 将 dev 分支合并到 master 分支 或将master 分支 合并到dev 分支
  19. Commands that may modify the data set are disabled, because this instance is configured to report er
  20. 血战上海滩寻找英雄血量地址 实现无敌效果

热门文章

  1. .NET数据提供程序
  2. 3.1 Tensorflow基础知识
  3. android 8.0 iso6,微信8.0.6更新了什么?IOS系统微信8.0.6版本更新详情一览[多图]
  4. php5 mysql 源_thinkphp6:访问多个mysql数据源(thinkphp6.0.5 / php 7.4.9)
  5. python pathlib模块_【Python Snippets】Pathlib 模块
  6. ios 数字键盘左下角添加按钮_ios数字键盘添加完成按钮
  7. android开发 解析 b5,张绍文android开发高手课读书笔记4-启动优化篇
  8. 父元素浮动子元素会浮动吗_为什么quot;overflow:hiddenquot;能清除浮动的影响
  9. mysql source超时_mysql数据库连接超时
  10. 在Ubuntu 18.04上安装Nginx