2021.3.3idea创建Maven项目

首先new - project - 找到Maven 然后按下图操作:

先勾选使用骨架,再找到Maven-archetype-webapp,选中,然后next

填写自己想要创建的项目名,然后选择自己的工作空间

①、选择自己下载的Maven插件

②、选择选择Maven里的settings.xml

③、选择Maven里的response文件夹

完成之后点击finish

然后选中pom.xml

把1.7改为1.8

然后把这个web.xml自动生成的内容更改为与自己版本相符合的,如下

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
         version="4.0">
  <display-name>Maven2</display-name>
  <welcome-file-list>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>default.html</welcome-file>
    <welcome-file>default.htm</welcome-file>
    <welcome-file>default.jsp</welcome-file>
  </welcome-file-list>
</web-app>

然后如下图按顺序操作

上图:②为自己下载的Maven插件,③就是对应maven的setting和repository

结束后配置tomcat

/Maven3_war只需要保留一个/即可。

以上的所有内容完成之后,再运行一边,出现Hello World!即配置完成。

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值