`
huangmin001
  • 浏览: 51258 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

一个SSH框架的maven archetype

阅读更多
小弟最近利用下班空闲时间学习了SSH框架,顺便做了一个maven的archetype,可以自动产生SSH框架,该框架自带一个TEST示例,SSH的版本是struts2.2,spring2.5和hibernate3.6,包括其他版本依赖都在父POM中统一指定,你可以直接打war包部署运行TEST示例程序,并且允许你动态指定数据库类型和地址,比如你生成的war包需要连接mysql开发库,则只需要执行在项目目录执行mvn clean install即可,如果要连接oracle测试库,则执行mvn clean install -Ptest,oracle即可,目前测试通过的数据库类型为mysql,oracle,sqlserver和sybase的任何版本,具体操作说明请参看附件中的说明文档。

TEST示例程序使用spring和hibernate的注解来管理BEAN,并演示了AOP拦截器,Struts拦截器事务管理器等等功能,集成了c3p0数据库连接池、log4j和slf4j等等插件,所有功能都能正常使用。

要运行mvn命令,你必须在机器上安装JDK1.6并配置了JAVA_HOME,同时下载maven3.0并配置M2_HOME环境变量,你需要下载附件中的struts2-spring2-hibernate3-archetype压缩包,并解压到你的maven本地库根目录,注意不要更改archetype文件夹名称,然后在命令行执行:mvn archetype:generate -DarchetypeGroupId=com.hengtiansoft.archetypes -DarchetypeArtifactId=struts2-spring2-hibernate3-archetype -DarchetypeVersion=1.0-SNAPSHOT 命令即可生成你自己的SSH框架,在执行命令过程中,你只需填写groupId和artifactId(项目名称)即可,其他默认回车即可。另外还有你最好能在eclipse或者netbeans上安装m2eclipse插件便于开发maven项目,你可以修改父POM.xml文件来指定你自己的数据库服务器地址和数据库类型,你甚至可以直接指定缺省数据库地址和类型,而不必每次打war时需要加-P参数(默认是localhost和mysql),有关详细设置,请参阅附件的说明文档。

这个archetype只是为了有些兄弟方便快速搭建SSH框架,并参照TEST示例快速开发,小弟研究不深,还望各位大侠指教,在使用过程中有任何问题请和我探讨,我将很乐意为你效劳 
0
3
分享到:
评论
37 楼 huangmin001 2011-10-09  
wangduqing1 写道
若能直接执行mvn tomcat:run或者执行mvn jrtty:run命令启动它!需要修改什么东西不需要!

1.在项目中执行mvn clean install,将web模块依赖的其他模块打成jar包;
2.在web\src\main\resources\log4j.properties里面,将log4j.appender.LOGFILE.File和log4j.appender.AspectTest.File的值改为绝对路径即可,比如D:/logs/log.log,注意logs目录需要你手动创建。
3.确保mysql的服务已经启动,并存在一张名为test的表,列为test_id和test_text,列类型都是varchar(50);
4.在web模块中执行mvn jetty:run命令启动jetty容器;
5.在浏览器栏中输入http://localhost:8080/你的项目名称/test/test.jsp
36 楼 huangmin001 2011-10-09  
huangmin001 写道
wangduqing1 写道
在DOS下执行mvn install时编译通过了;但在执行mvn tomcat:run命令启动时出错了。
SLF4J: Found binding in [jar:file:/C:/.m2/repository/org/slf4j/slf4j-simple/1.6.
2/slf4j-simple-1.6.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.

SLF4J: This version of SLF4J requires log4j version 1.2.12 or later. See also ht
tp://www.slf4j.org/codes.html#log4j_version
log4j:ERROR setFile(null,true) call failed.
java.io.FileNotFoundException: logs\log.log (系统找不到指定的路径。)
        at java.io.FileOutputStream.openAppend(Native Method)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:192)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:116)
        at org.apache.log4j.FileAppender.setFile(FileAppender.java:273)
        at org.apache.log4j.FileAppender.activateOptions(FileAppender.java:152)
        at org.apache.log4j.DailyRollingFileAppender.activateOptions(DailyRollin



你尝试把war包直接拷贝到tomcat服务器的webroot目录下,然后启动tomcat试试,还有打包的时候使用mvn clean install


1.在项目中执行mvn clean install,将web模块依赖的其他模块打成jar包;
2.在web\src\main\resources\log4j.properties里面,将log4j.appender.LOGFILE.File和log4j.appender.AspectTest.File的值改为绝对路径即可,比如D:/logs/log.log,注意logs目录需要你手动创建。
3.确保mysql的服务已经启动,并存在一张名为test的表,列为test_id和test_text,列类型都是varchar(50);
4.在web模块中执行mvn jetty:run命令启动jetty容器;
5.在浏览器栏中输入http://localhost:8080/你的项目名称/test/test.jsp
35 楼 wangduqing1 2011-10-09  
你有此框架做的项目吗?可以发一个给我吗?
34 楼 huangmin001 2011-10-08  
wangduqing1 写道
再问一下!如果我要想在你的工程中用MyEclipse再创建一个含有Java源程序和.jsp的子模块,应该如何建!jar包应该打成war还是jar!如果我希望工程中的web子模块依赖,需要再那个pom中添加什么样的信息!


test示例程序只是一个示例,最简单的办法就是对于每个模块都建立一个和test包结构一致的包,你就把test程序看成是你自己的一个包,其他包建立并没有什么特别。对于你在项目目录执行mvn clean install命令时,maven会根据每个模块的pom.xml中配置的package标签来决定打jar包还是war包,如果package是war(即web模块就是war),那么maven将会打成war包,如果没有配置或者package为jar,那么就打成jar包,一般只需要web模块打成war包即可,其他模块打成jar包被web模块依赖。

对于依赖web子模块,请参考http://wlo-o.iteye.com/blog/1163135
33 楼 huangmin001 2011-10-08  
wangduqing1 写道
你为何不愿意把你能运行的写一份报告给我看一下! 我这样做估计一个月才能运行起来!

在我的说明文档里有运行的步骤,你可以去看一下。如果需要制定数据库类型和机器IP,请到父POM.xml中直接修改机器IP,比如你要运行test环境的数据库,就修改profile标签下id为test的host标签,以此类推,数据库类型支持mysql,oracle,sqlserver和sybase标签,比如连接测试库的oracle数据库,则执行命令mvn clean install -Ptest,oracle,当然,test机器的IP就是刚才你在父pom.xml中设置的。
32 楼 wangduqing1 2011-10-08  
若能直接执行mvn tomcat:run或者执行mvn jrtty:run命令启动它!需要修改什么东西不需要!
31 楼 wangduqing1 2011-10-08  
为什么不能直接执行mvn tomcat:run或者执行mvn jrtty:run命令启动它!
30 楼 wangduqing1 2011-10-08  
再问一下!如果我要想在你的工程中用MyEclipse再创建一个含有Java源程序和.jsp的子模块,应该如何建!jar包应该打成war还是jar!如果我希望工程中的web子模块依赖,需要再那个pom中添加什么样的信息!
29 楼 wangduqing1 2011-10-08  
你为何不愿意把你能运行的写一份报告给我看一下! 我这样做估计一个月才能运行起来!
28 楼 huangmin001 2011-10-08  
wangduqing1 写道
明明是编译成功了?要怎样才能运行!mysql数据库的IP和端口如何设置!
C:\Documents and Settings\star\ssim>mvn clean install
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] ssim Project
[INFO] ssim-persist
[INFO] ssim-service
[INFO] ssim-facade
[INFO] ssim-web
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building ssim Project 1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ ssim ---
[INFO]
[INFO] --- maven-install-plugin:2.3.1:install (default-install) @ ssim ---
[INFO] Installing C:\Documents and Settings\star\ssim\pom.xml to C:\.m2\reposit
ry\net\selitech\ssim\ssim\1.0\ssim-1.0.pom
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building ssim-persist 1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ ssim-persist ---
[INFO] Deleting C:\Documents and Settings\star\ssim\persist\target
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @ ssim-pe
sist ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ ssim-persist
---
[INFO] Compiling 5 source files to C:\Documents and Settings\star\ssim\persist\
arget\classes
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:testResources (default-testResources) @
ssim-persist ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ ssim
persist ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.7.2:test (default-test) @ ssim-persist ---
[INFO] Surefire report directory: C:\Documents and Settings\star\ssim\persist\t
rget\surefire-reports

-------------------------------------------------------
T E S T S
-------------------------------------------------------
There are no tests to run.

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO]
[INFO] --- maven-jar-plugin:2.3.1:jar (default-jar) @ ssim-persist ---
[INFO] Building jar: C:\Documents and Settings\star\ssim\persist\target\ssim-pe
sist-1.0.jar
[INFO]
[INFO] --- maven-install-plugin:2.3.1:install (default-install) @ ssim-persist
--
[INFO] Installing C:\Documents and Settings\star\ssim\persist\target\ssim-persi
t-1.0.jar to C:\.m2\repository\net\selitech\ssim\ssim-persist\1.0\ssim-persist-
.0.jar
[INFO] Installing C:\Documents and Settings\star\ssim\persist\pom.xml to C:\.m2
repository\net\selitech\ssim\ssim-persist\1.0\ssim-persist-1.0.pom
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building ssim-service 1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ ssim-service ---
[INFO] Deleting C:\Documents and Settings\star\ssim\service\target
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @ ssim-se
vice ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 5 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ ssim-service
---
[INFO] Compiling 4 source files to C:\Documents and Settings\star\ssim\service\
arget\classes
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:testResources (default-testResources) @
ssim-service ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ ssim
service ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.7.2:test (default-test) @ ssim-service ---
[INFO] Surefire report directory: C:\Documents and Settings\star\ssim\service\t
rget\surefire-reports

-------------------------------------------------------
T E S T S
-------------------------------------------------------
There are no tests to run.

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO]
[INFO] --- maven-jar-plugin:2.3.1:jar (default-jar) @ ssim-service ---
[INFO] Building jar: C:\Documents and Settings\star\ssim\service\target\ssim-se
vice-1.0.jar
[INFO]
[INFO] --- maven-install-plugin:2.3.1:install (default-install) @ ssim-service
--
[INFO] Installing C:\Documents and Settings\star\ssim\service\target\ssim-servi
e-1.0.jar to C:\.m2\repository\net\selitech\ssim\ssim-service\1.0\ssim-service-
.0.jar
[INFO] Installing C:\Documents and Settings\star\ssim\service\pom.xml to C:\.m2
repository\net\selitech\ssim\ssim-service\1.0\ssim-service-1.0.pom
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building ssim-facade 1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ ssim-facade ---
[INFO] Deleting C:\Documents and Settings\star\ssim\facade\target
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @ ssim-fa
ade ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ ssim-facade
--
[INFO] Compiling 2 source files to C:\Documents and Settings\star\ssim\facade\t
rget\classes
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:testResources (default-testResources) @
ssim-facade ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ ssim
facade ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.7.2:test (default-test) @ ssim-facade ---
[INFO] Surefire report directory: C:\Documents and Settings\star\ssim\facade\ta
get\surefire-reports

-------------------------------------------------------
T E S T S
-------------------------------------------------------
There are no tests to run.

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO]
[INFO] --- maven-jar-plugin:2.3.1:jar (default-jar) @ ssim-facade ---
[INFO] Building jar: C:\Documents and Settings\star\ssim\facade\target\ssim-fac
de-1.0.jar
[INFO]
[INFO] --- maven-install-plugin:2.3.1:install (default-install) @ ssim-facade -
-
[INFO] Installing C:\Documents and Settings\star\ssim\facade\target\ssim-facade
1.0.jar to C:\.m2\repository\net\selitech\ssim\ssim-facade\1.0\ssim-facade-1.0.
ar
[INFO] Installing C:\Documents and Settings\star\ssim\facade\pom.xml to C:\.m2\
epository\net\selitech\ssim\ssim-facade\1.0\ssim-facade-1.0.pom
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building ssim-web 1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ ssim-web ---
[INFO] Deleting C:\Documents and Settings\star\ssim\web\target
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @ ssim-we
---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ ssim-web ---
[INFO] Compiling 3 source files to C:\Documents and Settings\star\ssim\web\targ
t\classes
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:testResources (default-testResources) @
ssim-web ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ ssim
web ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.7.2:test (default-test) @ ssim-web ---
[INFO] Surefire report directory: C:\Documents and Settings\star\ssim\web\targe
\surefire-reports

-------------------------------------------------------
T E S T S
-------------------------------------------------------
There are no tests to run.

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO]
[INFO] --- maven-war-plugin:2.1.1:war (default-war) @ ssim-web ---
[INFO] Packaging webapp
[INFO] Assembling webapp [ssim-web] in [C:\Documents and Settings\star\ssim\web
target\ssim]
[INFO] Processing war project
[INFO] Copying webapp webResources [C:\Documents and Settings\star\ssim\web\src
main/webapp] to [C:\Documents and Settings\star\ssim\web\target\ssim]
[INFO] Copying webapp resources [C:\Documents and Settings\star\ssim\web\src\ma
n\webapp]
[INFO] Webapp assembled in [203 msecs]
[INFO] Building war: C:\Documents and Settings\star\ssim\web\target\ssim.war
[WARNING] Warning: selected war files include a WEB-INF/web.xml which will be i
nored
(webxml attribute is missing from war task, or ignoreWebxml attribute is specif
ed as 'true')
[INFO]
[INFO] --- maven-install-plugin:2.3.1:install (default-install) @ ssim-web ---
[INFO] Installing C:\Documents and Settings\star\ssim\web\target\ssim.war to C:
.m2\repository\net\selitech\ssim\ssim-web\1.0\ssim-web-1.0.war
[INFO] Installing C:\Documents and Settings\star\ssim\web\pom.xml to C:\.m2\rep
sitory\net\selitech\ssim\ssim-web\1.0\ssim-web-1.0.pom
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] ssim Project ...................................... SUCCESS [0.516s]
[INFO] ssim-persist ...................................... SUCCESS [2.468s]
[INFO] ssim-service ...................................... SUCCESS [1.172s]
[INFO] ssim-facade ....................................... SUCCESS [1.141s]
[INFO] ssim-web .......................................... SUCCESS [7.500s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 13.125s
[INFO] Finished at: Sat Oct 08 21:25:43 CST 2011
[INFO] Final Memory: 21M/54M
[INFO] ------------------------------------------------------------------------
C:\Documents and Settings\star\ssim>


C:\Documents and Settings\star\ssim\web\target\ssim.war,你可以看到war包就在这个路径下,拷贝它到tomcat的webroot目录下启动tomcat即可,然后在浏览器里输入:http://localhost:8080/ssim/test/test.jsp
27 楼 wangduqing1 2011-10-08  
明明是编译成功了?要怎样才能运行!mysql数据库的IP和端口如何设置!
C:\Documents and Settings\star\ssim>mvn clean install
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] ssim Project
[INFO] ssim-persist
[INFO] ssim-service
[INFO] ssim-facade
[INFO] ssim-web
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building ssim Project 1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ ssim ---
[INFO]
[INFO] --- maven-install-plugin:2.3.1:install (default-install) @ ssim ---
[INFO] Installing C:\Documents and Settings\star\ssim\pom.xml to C:\.m2\reposit
ry\net\selitech\ssim\ssim\1.0\ssim-1.0.pom
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building ssim-persist 1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ ssim-persist ---
[INFO] Deleting C:\Documents and Settings\star\ssim\persist\target
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @ ssim-pe
sist ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ ssim-persist
---
[INFO] Compiling 5 source files to C:\Documents and Settings\star\ssim\persist\
arget\classes
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:testResources (default-testResources) @
ssim-persist ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ ssim
persist ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.7.2:test (default-test) @ ssim-persist ---
[INFO] Surefire report directory: C:\Documents and Settings\star\ssim\persist\t
rget\surefire-reports

-------------------------------------------------------
T E S T S
-------------------------------------------------------
There are no tests to run.

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO]
[INFO] --- maven-jar-plugin:2.3.1:jar (default-jar) @ ssim-persist ---
[INFO] Building jar: C:\Documents and Settings\star\ssim\persist\target\ssim-pe
sist-1.0.jar
[INFO]
[INFO] --- maven-install-plugin:2.3.1:install (default-install) @ ssim-persist
--
[INFO] Installing C:\Documents and Settings\star\ssim\persist\target\ssim-persi
t-1.0.jar to C:\.m2\repository\net\selitech\ssim\ssim-persist\1.0\ssim-persist-
.0.jar
[INFO] Installing C:\Documents and Settings\star\ssim\persist\pom.xml to C:\.m2
repository\net\selitech\ssim\ssim-persist\1.0\ssim-persist-1.0.pom
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building ssim-service 1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ ssim-service ---
[INFO] Deleting C:\Documents and Settings\star\ssim\service\target
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @ ssim-se
vice ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 5 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ ssim-service
---
[INFO] Compiling 4 source files to C:\Documents and Settings\star\ssim\service\
arget\classes
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:testResources (default-testResources) @
ssim-service ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ ssim
service ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.7.2:test (default-test) @ ssim-service ---
[INFO] Surefire report directory: C:\Documents and Settings\star\ssim\service\t
rget\surefire-reports

-------------------------------------------------------
T E S T S
-------------------------------------------------------
There are no tests to run.

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO]
[INFO] --- maven-jar-plugin:2.3.1:jar (default-jar) @ ssim-service ---
[INFO] Building jar: C:\Documents and Settings\star\ssim\service\target\ssim-se
vice-1.0.jar
[INFO]
[INFO] --- maven-install-plugin:2.3.1:install (default-install) @ ssim-service
--
[INFO] Installing C:\Documents and Settings\star\ssim\service\target\ssim-servi
e-1.0.jar to C:\.m2\repository\net\selitech\ssim\ssim-service\1.0\ssim-service-
.0.jar
[INFO] Installing C:\Documents and Settings\star\ssim\service\pom.xml to C:\.m2
repository\net\selitech\ssim\ssim-service\1.0\ssim-service-1.0.pom
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building ssim-facade 1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ ssim-facade ---
[INFO] Deleting C:\Documents and Settings\star\ssim\facade\target
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @ ssim-fa
ade ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ ssim-facade
--
[INFO] Compiling 2 source files to C:\Documents and Settings\star\ssim\facade\t
rget\classes
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:testResources (default-testResources) @
ssim-facade ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ ssim
facade ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.7.2:test (default-test) @ ssim-facade ---
[INFO] Surefire report directory: C:\Documents and Settings\star\ssim\facade\ta
get\surefire-reports

-------------------------------------------------------
T E S T S
-------------------------------------------------------
There are no tests to run.

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO]
[INFO] --- maven-jar-plugin:2.3.1:jar (default-jar) @ ssim-facade ---
[INFO] Building jar: C:\Documents and Settings\star\ssim\facade\target\ssim-fac
de-1.0.jar
[INFO]
[INFO] --- maven-install-plugin:2.3.1:install (default-install) @ ssim-facade -
-
[INFO] Installing C:\Documents and Settings\star\ssim\facade\target\ssim-facade
1.0.jar to C:\.m2\repository\net\selitech\ssim\ssim-facade\1.0\ssim-facade-1.0.
ar
[INFO] Installing C:\Documents and Settings\star\ssim\facade\pom.xml to C:\.m2\
epository\net\selitech\ssim\ssim-facade\1.0\ssim-facade-1.0.pom
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building ssim-web 1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ ssim-web ---
[INFO] Deleting C:\Documents and Settings\star\ssim\web\target
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @ ssim-we
---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ ssim-web ---
[INFO] Compiling 3 source files to C:\Documents and Settings\star\ssim\web\targ
t\classes
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:testResources (default-testResources) @
ssim-web ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ ssim
web ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.7.2:test (default-test) @ ssim-web ---
[INFO] Surefire report directory: C:\Documents and Settings\star\ssim\web\targe
\surefire-reports

-------------------------------------------------------
T E S T S
-------------------------------------------------------
There are no tests to run.

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO]
[INFO] --- maven-war-plugin:2.1.1:war (default-war) @ ssim-web ---
[INFO] Packaging webapp
[INFO] Assembling webapp [ssim-web] in [C:\Documents and Settings\star\ssim\web
target\ssim]
[INFO] Processing war project
[INFO] Copying webapp webResources [C:\Documents and Settings\star\ssim\web\src
main/webapp] to [C:\Documents and Settings\star\ssim\web\target\ssim]
[INFO] Copying webapp resources [C:\Documents and Settings\star\ssim\web\src\ma
n\webapp]
[INFO] Webapp assembled in [203 msecs]
[INFO] Building war: C:\Documents and Settings\star\ssim\web\target\ssim.war
[WARNING] Warning: selected war files include a WEB-INF/web.xml which will be i
nored
(webxml attribute is missing from war task, or ignoreWebxml attribute is specif
ed as 'true')
[INFO]
[INFO] --- maven-install-plugin:2.3.1:install (default-install) @ ssim-web ---
[INFO] Installing C:\Documents and Settings\star\ssim\web\target\ssim.war to C:
.m2\repository\net\selitech\ssim\ssim-web\1.0\ssim-web-1.0.war
[INFO] Installing C:\Documents and Settings\star\ssim\web\pom.xml to C:\.m2\rep
sitory\net\selitech\ssim\ssim-web\1.0\ssim-web-1.0.pom
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] ssim Project ...................................... SUCCESS [0.516s]
[INFO] ssim-persist ...................................... SUCCESS [2.468s]
[INFO] ssim-service ...................................... SUCCESS [1.172s]
[INFO] ssim-facade ....................................... SUCCESS [1.141s]
[INFO] ssim-web .......................................... SUCCESS [7.500s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 13.125s
[INFO] Finished at: Sat Oct 08 21:25:43 CST 2011
[INFO] Final Memory: 21M/54M
[INFO] ------------------------------------------------------------------------
C:\Documents and Settings\star\ssim>
26 楼 huangmin001 2011-10-08  
wangduqing1 写道
url:是怎磨写的(访问路径)

http://localhost:8080/你的项目名称/test/test.jsp
25 楼 huangmin001 2011-10-08  
wangduqing1 写道
只拷贝war不用其他子模块吗?

其他子模块已经打包到war包的WEB-INF/lib目录下了。
24 楼 wangduqing1 2011-10-08  
只拷贝war不用其他子模块吗?
23 楼 wangduqing1 2011-10-08  
url:是怎磨写的(访问路径)
22 楼 huangmin001 2011-10-07  
wangduqing1 写道
在DOS下执行mvn install时编译通过了;但在执行mvn tomcat:run命令启动时出错了。
SLF4J: Found binding in [jar:file:/C:/.m2/repository/org/slf4j/slf4j-simple/1.6.
2/slf4j-simple-1.6.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.

SLF4J: This version of SLF4J requires log4j version 1.2.12 or later. See also ht
tp://www.slf4j.org/codes.html#log4j_version
log4j:ERROR setFile(null,true) call failed.
java.io.FileNotFoundException: logs\log.log (系统找不到指定的路径。)
        at java.io.FileOutputStream.openAppend(Native Method)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:192)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:116)
        at org.apache.log4j.FileAppender.setFile(FileAppender.java:273)
        at org.apache.log4j.FileAppender.activateOptions(FileAppender.java:152)
        at org.apache.log4j.DailyRollingFileAppender.activateOptions(DailyRollin



你尝试把war包直接拷贝到tomcat服务器的webroot目录下,然后启动tomcat试试,还有打包的时候使用mvn clean install
21 楼 huangmin001 2011-10-07  
wangduqing1 写道
这个框架的依赖关系是什么?(意思是谁依赖谁)

模块之间的依赖不允许存在环依赖,所以框架的依赖时单向依赖,web模块和facade模块依赖service模块,service模块依赖persist模块,你可以在每个模块的pom中看到依赖关系。
20 楼 huangmin001 2011-10-07  
wangduqing1 写道
我在运行你的这个框架的时候需不需要将MySQL数据库装到机子上。我要想用oral数据库该怎磨办!

如果你是本地运行的话,是需要装mysql数据库的,然后运行命令mvn clean install即可;
但如果你在其他机器上已经装了mysql,那么你可以在打包的时候指定那个机器的IP,而不必在本地装mysql,但是这样的话,你需要在父POM中指定机器IP,比如修改id为test的profile元素,将host的IP改成机器的IP,然后在打包的时候运行命令mvn clean install -Ptest,mysql即可。

对于oracle也是一样的,在父pom中修改机器的IP,比如你的oracle是装在本地开发环境的,那么就不必修改机器IP,默认localhost地址就可以,如果你的oracle是装在其他机器的开发环境的,那么就需要修改id为dev的host标签为机器的IP,如果oracle装在其他机器的测试环境,就修改id为test的host标签为机器IP,然后执行命令mvn clean install -Pdev,oracle或者mvn clean install -Ptest,oracle即可,所谓的dev,test,prod只是为了区分不同环境的数据库而已。
19 楼 wangduqing1 2011-10-07  
这个框架的依赖关系是什么?(意思是谁依赖谁)
18 楼 wangduqing1 2011-10-07  
我在运行你的这个框架的时候需不需要将MySQL数据库装到机子上。我要想用oral数据库该怎磨办!

相关推荐

    基于Maven的SSH框架搭建

    在这个基于Maven的SSH框架搭建实例中,我们将探讨如何利用这些框架以及Maven构建工具来搭建一个完整的Web项目。 首先,Spring框架是核心,它提供了依赖注入(DI)和面向切面编程(AOP)的功能,以实现松耦合和更好...

    SSH框架+Maven整合(链路信息系统)

    通过上述步骤,一个整合了SSH框架和Maven的项目就构建完成了。这种整合方式能够有效地提高开发效率,减少重复工作,同时也便于团队协作和项目维护。对于初学者来说,理解并掌握SSH与Maven的整合,无疑会为今后的Java...

    Maven下ssh项目框架搭建

    1. **创建Maven项目**:首先,使用Maven的archetype插件创建一个新的Maven项目,选择合适的 archetype 模板,如`maven-archetype-webapp`。 2. **添加SSH依赖**:在pom.xml文件中,添加Spring、Struts2和Hibernate...

    [SSH+Maven+Bootstrap视频教程]_03. 项目的安装部署.zip

    项目的安装部署"中,我们将深入探讨如何在Java环境下使用SSH(Struts2、Spring、Hibernate)框架、Maven构建工具以及Bootstrap前端框架来搭建并部署一个完整的Web项目。这个教程面向的是有一定Java基础,希望进一步...

    maven搭建ssh

    在IT行业中,SSH(Spring、Struts、...通过以上步骤和知识点的学习,你可以成功地使用Maven搭建一个SSH框架的应用,为Java Web开发提供强大的基础。同时,这也会加深你对Maven、SSH框架以及Java Web开发的整体理解。

    基于maven的ssh例子

    接下来,你需要创建一个新的Maven工程,并在`pom.xml`文件中添加SSH框架的依赖,这些依赖会自动从Maven仓库下载到本地。 在Eclipse中,你可以使用Maven的`archetype插件`来快速生成SSH的项目结构。之后,配置Spring...

    [SSH+Maven+Bootstrap视频教程]_第 九 讲.zip

    Maven则是一个强大的项目管理工具,而Bootstrap则是流行的前端开发框架,用于快速构建响应式和移动优先的网站。 首先,让我们详细了解SSH框架: 1. **Struts**:Struts 是一个基于MVC设计模式的Java Web应用框架,...

    Maven的简单使用以及Maven搭建SSH

    2. **创建项目**:使用`mvn archetype:generate`命令可以快速生成一个基本的Maven项目结构。你需要提供groupId、artifactId和version等基本信息。 3. **项目结构**:Maven项目遵循标准目录结构,包括`src/main/java...

    maven ssh实例

    在命令行中,使用`mvn archetype:create`命令,指定相关的groupId、artifactId和version,来生成一个基本的Maven项目结构。 接下来,我们需要在pom.xml文件中添加SSH相关依赖。Spring、Struts2和Hibernate的最新...

    用IDEA创建一个SSH项目.doc

    在本文中,我们将详细介绍如何使用 IDEA 创建一个 SSH 项目,包括项目的创建、配置和启动过程。 创建 Maven Web 项目 首先,我们需要在 IDEA 中创建一个新的 Maven 项目。在 IDEA 中,单击 "File" -&gt; "New" -&gt; ...

    基于intellij的Java ee 的SSH框架的整合文档

    在IntelliJ IDEA中整合SSH框架,可以创建一个功能齐全的Java EE应用程序。 **1. 安装准备** 在开始整合之前,确保已经安装了以下软件: - IntelliJ IDEA 13.1.1:这是一个强大的Java IDE,支持多种框架的开发。 - ...

    Maven简介_SSH整合教程

    1. **创建Maven项目**:首先,使用Maven的archetype插件生成一个基本的Maven项目结构。 2. **添加SSH依赖**:在pom.xml中添加Struts2、Spring、Hibernate以及它们相关依赖的坐标。 3. **配置SSH**:分别配置Struts...

    maven教程-maven教程-maven教程

    Maven还提供了与SSH框架的整合,SSH是指Spring、Struts和Hibernate这三个框架的集合。开发者可以使用Maven来管理这些框架的依赖和构建过程。多模块和继承是Maven的核心特性,允许开发者以模块化的方式来组织和构建...

    maven2搭建hibernate+spring+struts2项目

    本文主要介绍如何使用Maven2搭建一个基于SSH的Web项目。 首先,我们需要理解Maven2的核心功能——项目管理和依赖管理。Maven通过使用一个POM(Project Object Model)文件来定义项目的构建过程和依赖关系,从而简化...

    Maven构建Struts项目

    1. **创建Maven项目**:首先,我们需要创建一个新的Maven项目,通过`mvn archetype:generate`命令可以选择Struts2的archetype来生成基础项目结构。 2. **配置POM.xml**:在POM.xml文件中,添加Struts2、Spring、...

    ssh-idea-maven-create.docx

    在本文中,我们将详细介绍如何使用IntelliJ IDEA (Idea) 2018版本搭建一个基于SSH(Spring、Hibernate、Spring MVC)的Web项目,同时结合Maven 3.x和阿里云镜像,以及Java JDK 1.8。整个过程涉及到项目创建、配置、...

Global site tag (gtag.js) - Google Analytics