1.cmd 转至 欲生成项目的目录执行:mvn archetype:create -DgroupId=org.jxsme.hj -DartifactId=sshinfo -DarchetypeArtifactId=maven-archetype-webapp
生成一个web项目
2.设置代理服务器地址:http://192.168.2.196:8081
3.在项目目录下pom.xml文件中添加struts2,spring,hibernate,servlet,jsp,junit包引入
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
4.0.0
org.jxsme.hj
sshinfo
war
1.0-SNAPSHOT
sshinfo Maven Webapp
http://maven.apache.org
junit
junit
3.8.1
test
org.apache.struts
struts2-core
2.0.11.2
org.apache.struts
struts2-sitemesh-plugin
2.0.11.2
org.apache.struts
struts2-spring-plugin
2.0.11.2
javax.servlet
servlet-api
2.4
provided
javax.servlet
jsp-api
2.0
provided
commons-fileupload
commons-fileupload
1.1.1
commons-dbcp
commons-dbcp
1.2.2
org.springframework
spring-hibernate3
2.0.8
org.springframework
spring-orm
2.5.5
org.springframework
spring-core
2.5.5
org.springframework
spring-beans
2.5.5
org.springframework
spring-context
2.5.5
org.springframework
spring-jdbc
2.5.5
org.springframework
spring-test
2.5.5
org.springframework
spring-context-support
2.5.5
org.springframework
spring-aop
2.5.5
org.springframework
spring-aspects
2.5.5
mysql
mysql-connector-java
5.1.6
proxool
proxool
0.8.3
org.hibernate
hibernate-core
3.3.1.GA
org.hibernate
hibernate-annotations
3.3.0.ga
sshinfo
org.apache.maven.plugins
maven-compiler-plugin
1.5
1.5
utf-8
4,执行mvn eclipse:eclipse生成eclipse项目
5 打开eclipse导入工程,添加src/main/java目录,src/test/main,src/test/resources源文件目录
编写测试文件sayHello,及servlet添加相应的测试,并生成war文件..将该文件放至tomcat中进行测试.
6.添加struts支持action测试.
7.在applicationContent.xml中配置hibernate及事务代理.
8.连接数据库,生成hbm.xml,pojo文件
9.编写dao.service,serviceimpl等到类文件....
10.编写junit Dao测试,
11.编写struts2.Actioin及测试类.
12.执行编译打包,,mvn install
13.放至tomcat中进行测试