idea创建project
eclipse | idea |
workspace | project |
project | model |
一、创建maven工程。
1.欢迎页面,点击“Create New Project”
![24222803_K2dd.jpg](http://static.oschina.net/uploads/img/201309/24222803_K2dd.jpg)
2.打开创建项目页面,可以选择具体的model,选择具体的model后,project中只能创建一个model.在这里选择"Empty Project".
![24222804_4v5X.jpg](http://static.oschina.net/uploads/img/201309/24222804_4v5X.jpg)
3.如图,点击"Finish".
![24222804_MzU8.jpg](http://static.oschina.net/uploads/img/201309/24222804_MzU8.jpg)
4.接下来,需要配置project,以及创建model
![24222805_TGaN.jpg](http://static.oschina.net/uploads/img/201309/24222805_TGaN.jpg)
5.主要配置JDK.
![24222805_uJd6.jpg](http://static.oschina.net/uploads/img/201309/24222805_uJd6.jpg)
6.点击"OK",project就创建完成,项目中不包含任何model,如图:
![24222805_JsGi.jpg](http://static.oschina.net/uploads/img/201309/24222805_JsGi.jpg)
7.创建model.此例以maven为例。File-->New Model.
![24222806_4bMQ.jpg](http://static.oschina.net/uploads/img/201309/24222806_4bMQ.jpg)
8.弹出如下页面:
![24222806_RFk2.jpg](http://static.oschina.net/uploads/img/201309/24222806_RFk2.jpg)
左侧选择“Maven Model”,右侧配置项目信息。点击"Next".
9.选中“Create from archetype”,选中下图所示,即创建web项目.
![24222807_Cmzq.jpg](http://static.oschina.net/uploads/img/201309/24222807_Cmzq.jpg)
10.点击“Next”.确定项目信息,如图:
![24222807_U11n.jpg](http://static.oschina.net/uploads/img/201309/24222807_U11n.jpg)
11.点击"Finish".
![24222808_U2UG.jpg](http://static.oschina.net/uploads/img/201309/24222808_U2UG.jpg)
12.创建完成。
![24222811_UF9n.jpg](http://static.oschina.net/uploads/img/201309/24222811_UF9n.jpg)
至此,已经创建好maven的基本工程。但是并没有src/main/java,src/test/java,src/test/resource.找了好久不知道在哪里添加,以致后面创建不知道如何创建java类。
小技巧:
File->Project Structure.
![24222812_UOpy.jpg](http://static.oschina.net/uploads/img/201309/24222812_UOpy.jpg)
选中main,鼠标右键->New Folder,输入java.
以此类推创建其他目录。并标识Sources,Test Sources.
![24222812_HUG7.jpg](http://static.oschina.net/uploads/img/201309/24222812_HUG7.jpg)
这样在java目录下即可创建java文件了。
![24222813_qa9O.jpg](http://static.oschina.net/uploads/img/201309/24222813_qa9O.jpg)
二、将maven工程添加到svn版本控制。
添加之前,先确保svn功能已经打开,svn资源库已经存在。
1.打开svn功能
![24222813_UCI2.jpg](http://static.oschina.net/uploads/img/201309/24222813_UCI2.jpg)
2.弹出框选择svn即可。然后单击“OK”。
![24222813_yIkA.jpg](http://static.oschina.net/uploads/img/201309/24222813_yIkA.jpg)
3.将工程添加到svn库。选中项目,鼠标右键,Subversion->Share Directory.
![24222814_M9qo.jpg](http://static.oschina.net/uploads/img/201309/24222814_M9qo.jpg)
4.弹出如下窗口
![24222814_Xx7K.jpg](http://static.oschina.net/uploads/img/201309/24222814_Xx7K.jpg)
5.点击“+”,创建repositiory.
![24222814_XbeO.jpg](http://static.oschina.net/uploads/img/201309/24222814_XbeO.jpg)
6.选择相应的目录。
![24222815_0zCK.jpg](http://static.oschina.net/uploads/img/201309/24222815_0zCK.jpg)
7.点击"Share",之后弹出一个框
![24222815_PrIb.jpg](http://static.oschina.net/uploads/img/201309/24222815_PrIb.jpg)
默认即可。
8.接下来就可以提交model了。选中model,鼠标右键,Subversion,Commit Directory.
![24222816_CzW9.jpg](http://static.oschina.net/uploads/img/201309/24222816_CzW9.jpg)
9.提交窗口如下图
![24222816_O1iD.jpg](http://static.oschina.net/uploads/img/201309/24222816_O1iD.jpg)
10.Commit。