Myeclipse通过maven搭建SpringMvc框架(一)

一、创建maven项目

1、File>>new>>others>>选择Maven Project项目,

Myeclipse通过maven搭建SpringMvc框架(一)_第1张图片

2、勾选Create a simple project,Next

Myeclipse通过maven搭建SpringMvc框架(一)_第2张图片

3、填写信息

Group Id:大项目名称,一般是域名反写

Artifact Id:项目名称

Version:版本,默认

Packaging:选择war,web项目

Myeclipse通过maven搭建SpringMvc框架(一)_第3张图片

4、生成后pom.xml会有些错误,不过我们先添加依赖包,我的这个pom.xml整合了springmvc、spring、hibernate、mybatis等依赖包,实在不想分开试了


	
		UTF-8
		4.2.0.RELEASE
		3.2.8.RELEASE
		3.3.0
		4.2.7.Final
		1.2.17
	

	
	
	
		
			org.hamcrest
			hamcrest-core
			1.3
		

		
			junit
			junit
			4.11
		
		
			javax.servlet
			servlet-api
			2.5
		
		
			org.jsoup
			jsoup
			1.8.3
		

		
		
			commons-logging
			commons-logging
			1.2
		
		
			log4j
			log4j
			${log4j.version}
		

		
		
			net.sf.json-lib
			json-lib
			2.4
			jdk15
		
		
			com.fasterxml.jackson.core
			jackson-core
			2.2.3
		
		
			com.fasterxml.jackson.core
			jackson-databind
			2.2.3
		

		
		
			org.springframework
			spring-core
			${spring.version}
		
		
			org.springframework
			spring-web
			${spring.version}
		
		
			org.springframework
			spring-oxm
			${spring.version}
		
		
			org.springframework
			spring-tx
			${spring.version}
		
		
			org.springframework
			spring-jdbc
			${spring.version}
		
		
			org.springframework
			spring-webmvc
			${spring.version}
		
		
			org.springframework
			spring-orm
			${spring.version}
		
		
			org.springframework
			spring-aop
			${spring.version}
		
		
			org.springframework
			spring-context-support
			${spring.version}
		
		
			org.springframework
			spring-aspects
			${spring.version}
		
		
			org.springframework
			spring-test
			${spring.version}
		

		
		
			org.springframework.security
			spring-security-core
			${security.version}
		
		
			org.springframework.security
			spring-security-web
			${security.version}
		
		
			org.springframework.security
			spring-security-config
			${security.version}
		

		
		
			oracle
			ojdbc6
			12
		

		
		
			org.hibernate
			hibernate-core
			${hibernate.version}
		
		
			org.hibernate
			hibernate-entitymanager
			${hibernate.version}
		

		
		
			org.mybatis
			mybatis
			${mybatis.version}
		
		
			org.mybatis
			mybatis-spring
			1.2.2
		

		
		
			com.github.pagehelper
			pagehelper
			4.1.3
		


		
		
			org.apache.httpcomponents
			httpclient
			4.5
		
		
			org.apache.httpcomponents
			httpmime
			4.2.1
		

		
		
			org.lucee
			commons-fileupload
			1.2.1
		

		
		
			org.apache.poi
			poi
			3.17
		

		
			org.apache.poi
			poi-examples
			3.17
		

		
			org.apache.poi
			poi-excelant
			3.17
		


		
			org.apache.poi
			poi-ooxml
			3.17
		

		
			org.apache.poi
			poi-ooxml-schemas
			3.15
		
		
			com.github.pjfanning
			xmlbeans
			2.6.1
		
		
		 

		
			org.apache.poi
			poi-scratchpad
			3.17
		
		
		
			commons-io
			commons-io
			1.2
		

		
		
			commons-net
			commons-net
			1.4.1
		
	

	
		
			
				org.apache.maven.plugins
				maven-surefire-plugin
				2.16
				
					true
					-Dfile.encoding=UTF-8
				
			
			
				maven-compiler-plugin
				2.3.2
				
					1.7
					1.7
				
			
			
				maven-war-plugin
				2.2
				
					3.1
					false
					**/package-info.*
				
			

			
			
				org.apache.maven.plugins
				maven-javadoc-plugin
				2.7
				
					
						attach-javadocs
						
							jar
						
					
				
			

			
			
				org.apache.maven.plugins
				maven-source-plugin
				2.1.2
				
					
						attach-sources
						package
						
							jar-no-fork
						
					
				
			
		
	

5、右击项目,Maven>>update project,错误完美解决,

注:java存放java源代码,resources存放配置文件、webapp存放网页等文件,test是测试文件夹,target是发布文件夹,pom.xml是maven的配置文件。

Myeclipse通过maven搭建SpringMvc框架(一)_第4张图片

Maven环境就搭建好了,SpringMvc放在下一篇讲吧,太长了

你可能感兴趣的:(javaEE框架,maven,框架)