创建Java工程:
- 创建项目
- 创建简单工程
- 填写坐标,选择打包方式
- maven导包的功能
创建Web工程:
- 创建项目
- 创建简单工程
- 填写坐标,选择打包方式
坑:
maven项目出现web.xml is missing and is set to true错误的解决办法
使用maven创建web项目时,可能会出现如下错误:
web.xml is missing and <failOnMissingWebXml> is set to true
此问题的解决办法:
1. 右键点击Project Explorer
中的Deployment Descriptor
2. 选择Generate Deployment Descriptor Stub
这样就能生成src/main/webapp/WEB_INF/web.xml
文件了。
- common文件夹右键maven install把common打包成jar包
- 在web下的pom.xml中引用上面common中的项目,项目间的相互依赖。