久违的问候-----eclipse中搭建maven项目2016年

时间:2023-03-09 08:51:56
久违的问候-----eclipse中搭建maven项目2016年

好久没有写过博客了,可是一直向别人推荐自己的博客,深感惭愧!今天再次在寒冷之夜继续code,config,write。

接下来,我们就来谈下eclipse中搭建maven web工程的步骤!虽然就是一个简单的例子,但是过程是很艰辛的。首先谈下eclipse吧!

2016年11月3日上午去官网查看的时候,才发现eclipse推出了N多个IDE,简直让人目不暇接。截图为证,以防有诈!

上图了:

久违的问候-----eclipse中搭建maven项目2016年

等等,其实不是这张图,是下面那张图

久违的问候-----eclipse中搭建maven项目2016年

久违的问候-----eclipse中搭建maven项目2016年

怎么样,厉害吧!

那么废话不多说,直接开搞!

首先我安装了eclipse的JavaEE IDE,然后开始具体的步骤了

1.Ctrl + N调出新建窗口,双击选择Maven Project

久违的问候-----eclipse中搭建maven项目2016年

2.直接点击下一步

久违的问候-----eclipse中搭建maven项目2016年

3.双击选择maven-archetype-webapp

久违的问候-----eclipse中搭建maven项目2016年

4.根据个人情况输入Group Id和Artifact Id,Package会自动生成,点击finish

久违的问候-----eclipse中搭建maven项目2016年

java视图下项目结构如

久违的问候-----eclipse中搭建maven项目2016年

5.右键项目 -> Build Path -> Configure Build Path...

久违的问候-----eclipse中搭建maven项目2016年

6.在Source下去掉两个错误的Source folder

久违的问候-----eclipse中搭建maven项目2016年

7.点击上图中的Add Folder... -> 点击Create New Folder...增加src/main/java、src/test/java 和src/test/resources

久违的问候-----eclipse中搭建maven项目2016年

8.分别双击src/test/java和src/test/resources下的Output folder,设置测试代码编译的class发布目录为target/test-classes。为的是不和正式代码的编译文件混在一起,正式代码发布目 录使用默认的target/classes即可。

久违的问候-----eclipse中搭建maven项目2016年

9.在Order and Export中调整folder的显示顺序

久违的问候-----eclipse中搭建maven项目2016年