整合spring roo,maven,mybatis,spring-flex,blazeds,mysql
1.
下载spring roo,设置环境变量ROO_HOME
,和path,classpath.
使用CMD命令行找到工作区间,新建工程目录转到工程目录;mkdir ten-minutes
$ cdten-minutes
2. project--topLevelPackage com.tenminutes
3. roo>jpa setup --provider HIBERNATE--database HYPERSONIC_IN_MEMORY
4. roo>hint
5. roo>entity jpa --class ~.Timer--testAutomatically
6. roo>hint
7. roo>field string --fieldName message--notNull
8. roo>hint web mvc
9. roo>web mvc setup
10. roo>web mvc all --package ~.web
11. roo>selenium test --controller~.web.TimerController
12. roo>perform tests
13. roo>perform package
14. roo>perform eclipse
15. roo>quit
16. $mvn tomcat:run
添加<blazeds.version>4.0.0.14931</blazeds.version>为项目添加blazeds开发版本号
2.添加mybatis开发生成器:<!--mybatisgenerator -->
<repository>
<id>mybatis-snapshot</id>
<name>MyBatisSnapshot Repository</name>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</repository>
3.添加类库依赖<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.0.1</version>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>1.1.0</version>
</dependency>
<!-- springflex-->
<dependency>
<groupId>org.springframework.flex</groupId>
<artifactId>spring-flex-core</artifactId>
<version>1.5.2.RELEASE</version>
</dependency>
<!-- Blazeds-->
<dependency>
<groupId>com.adobe.blazeds</groupId>
<artifactId>blazeds-core</artifactId>
<version>${blazeds.version}</version>
</dependency>
<dependency>
<groupId>com.adobe.blazeds</groupId>
<artifactId>blazeds-common</artifactId>
<version>${blazeds.version}</version>
</dependency>
<dependency>
<groupId>com.adobe.blazeds</groupId>
<artifactId>blazeds-proxy</artifactId>
<version>${blazeds.version}</version>
</dependency>
<dependency>
<groupId>com.adobe.blazeds</groupId>
<artifactId>blazeds-remoting</artifactId>
<version>${blazeds.version}</version>
</dependency>
4.mybatis插件<plugin>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-maven-plugin</artifactId>
<version>1.3.1</version>
<configuration>
<verbose>true</verbose>
<overwrite>true</overwrite>
</configuration>
</plugin>
5.可能需要转到Blazeds目录将一些类库打进去maven类库,命令行如下:mvn install:install-file -Dpackaging=jar -DgroupId=com.adobe.blazeds -Dversion=4.0.0.14931 -DartifactId=blazeds-common -Dfile=flex-messaging-common.jar
mvn install:install-file -Dpackaging=jar -DgroupId=com.adobe.blazeds-Dversion=4.0.0.14931 -DartifactId=blazeds-core -Dfile=flex-messaging-core.jar
mvn install:install-file -Dpackaging=jar -DgroupId=com.adobe.blazeds-Dversion=4.0.0.14931 -DartifactId=blazeds-opt -Dfile=flex-messaging-opt.jar
mvn install:install-file -Dpackaging=jar -DgroupId=com.adobe.blazeds-Dversion=4.0.0.14931 -DartifactId=blazeds-proxy -Dfile=flex-messaging-proxy.jar
mvn install:install-file -Dpackaging=jar -DgroupId=com.adobe.blazeds-Dversion=4.0.0.14931 -DartifactId=blazeds-remoting -Dfile=flex-messaging-remoting.jar
mvn install:install-file -Dpackaging=jar -DgroupId=com.adobe.blazeds-Dversion=4.0.0.14931 -DartifactId=blazeds-rds-server -Dfile=flex-rds-server.jar
修改一下propertis,数据库配置文件,格式如下:#Updated at Mon Apr 09 09:15:39 CST 2012
#Mon Apr09 09:15:39 CST 2012
database.driverClassName=com.mysql.jdbc.Driver
database.url=jdbc\:mysql\://localhost\:3306/managerplatform
database.username=root
database.password=qwer123456
使用 database introspect --schemafeedback_schema
来内部检查数据库模式。
完成数据库模式内部检查以后,您可以用 database reverse engineer --schemafeedback_schema --package ~.domain
对模式进行反向工程。
准备好mybatis的生成器配置文件,利用命令行运行mvn mybatis-generator:generate。
6.上下文配置:<?xmlversion="1.0"encoding="UTF-8"standalone="no"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/aophttp://www.springframework.org/schema/aop/spring-aop-3.1.xsd http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans-3.1.xsd http://www.springframework.org/schema/contexthttp://www.springframework.org/schema/context/spring-context-3.1.xsd http://www.springframework.org/schema/jeehttp://www.springframework.org/schema/jee/spring-jee-3.1.xsd http://www.springframework.org/schema/txhttp://www.springframework.org/schema/tx/spring-tx-3.1.xsd">
<context:property-placeholderlocation="classpath*:META-INF/spring/*.properties"/>
<!-- enable autowire-->
<context:annotation-config/>
<context:component-scanbase-package="com.bingya">
</context:component-scan>
<tx:annotation-driven/>
<beanclass="org.springframework.jdbc.datasource.DriverManagerDataSource"
id="dataSource">
<propertyname="driverClassName"value="${database.driverClassName}"/>
<propertyname="url"value="${database.url}"/>
<propertyname="username"value="${database.username}"/>
<propertyname="password"value="${database.password}"/>
</bean>
<beanid="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<propertyname="dataSource"ref="dataSource"/>
</bean>
<!-- define the SqlSessionFactory-->
<beanid="sqlSessionFactory"class="org.mybatis.spring.SqlSessionFactoryBean">
<propertyname="dataSource"ref="dataSource"/>
<propertyname="typeAliasesPackage"value="com.bingya"/>
</bean>
<!-- scan formappers andlet them beautowired -->
<beanclass="org.mybatis.spring.mapper.MapperScannerConfigurer">
<propertyname="basePackage"value="com.bingya"/>
</bean>
</beans>
web.xml
- <?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
- <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- version="2.5"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
- <display-name>SpringRoo</display-name>
- <description>Roo generated SpringRoo application</description>
- <context-param>
- <param-name>contextConfigLocation</param-name>
- <param-value>classpath*:META-INF/spring/applicationContext*.xml</param-value>
- </context-param>
- <!-- Creates the Spring Container shared by all Servlets and Filters -->
- <listener>
- <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
- </listener>
- <!-- Handles Spring requests -->
- <servlet>
- <servlet-name>SpringRoo</servlet-name>
- <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
- <init-param>
- <param-name>contextConfigLocation</param-name>
- <param-value>WEB-INF/spring/webmvc-config.xml</param-value>
- </init-param>
- <load-on-startup>1</load-on-startup>
- </servlet>
- <servlet-mapping>
- <servlet-name>SpringRoo</servlet-name>
- <url-pattern>/messagebroker/*</url-pattern>
- </servlet-mapping>
- </web-app>
整合spring roo,maven,mybatis,spring-flex,blazeds,mysql的更多相关文章
- spring-第N篇整合SSM,即Mybatis+Spring+Spring MVC
1.Mybatis的配置使用 1>Jar包:mybatis-3.4.5.jar.mysql-connector-6.0.2或者ojdbc6-11.2.0.4.jar. 2>编写conf.x ...
- Eclipse+Spring+SpringMVC+Maven+Mybatis+MySQL+Tomcat项目搭建
---恢复内容开始--- 1. 建表语句及插入数据 CREATE TABLE `book_user` ( user_id INT(11) NOT NULL AUTO_INCREMENT, user_n ...
- Maven+Mybatis+Spring+SpringMVC实现分页查询
转载:http://www.cnblogs.com/zhangtan/p/5846955.html 一.项目搭建 关于项目搭建,小宝鸽以前写过一篇Spirng+SpringMVC+Maven+Myba ...
- Maven+Mybatis+Spring+SpringMVC实现分页查询(附源代码)
以下小宝鸽将分享一篇Mybatis分页功能的博文,以下将给出具体的步骤.跟着博主的节奏肯定能实现.另外最后还会附上整个project的源代码.假设是没有使用过maven的猿友可自行下载相关的jar包就 ...
- spring+springmvc+maven+mybatis整合
jar包依赖:网址search.maven.org 1.spring :spring-core 2. myhabits:myhabits 3.整合spring和myhabits: ...
- spring boot:使用mybatis访问多个mysql数据源/查看Hikari连接池的统计信息(spring boot 2.3.1)
一,为什么要访问多个mysql数据源? 实际的生产环境中,我们的数据并不会总放在一个数据库, 例如:业务数据库:存放了用户/商品/订单 统计数据库:按年.月.日的针对用户.商品.订单的统计表 因为统计 ...
- Spring Roo
Spring Roo 是SpringSource新的开放源码技术,该技术主要面向企业中的Java开发者,使之更富有成效和愉快的进行开发工作,而不会牺牲工程完整或灵活性.无论你是一个新的Java开发人员 ...
- spring boot 打包方式 spring boot 整合mybaits REST services
<build> <sourceDirectory>src/main/java</sourceDirectory> <plugins> <plugi ...
- Spring顶级项目以及Spring cloud组件
作为java的屌丝,基本上跟上spring屌丝的步伐,也就跟上了主流技术. spring 顶级项目: Spring IO platform:用于系统部署,是可集成的,构建现代化应用的版本平台,具体来说 ...
- Spring Boot入门(2)使用MySQL数据库
介绍 本文将介绍如何在Spring项目中连接.处理MySQL数据库. 该项目使用Spring Data JPA和Hibernate来连接.处理MySQL数据库,当然,这仅仅是其中一种方式,你也 ...
随机推荐
- Python 获得命令行参数的方法
如果想对python脚本传参数,python中对应的argc, argv(c语言的命令行参数)是什么呢?需要模块:sys参数个数:len(sys.argv)脚本名: sys.argv[0]参数1 ...
- nginx中针对目录进行IP限制
一个不错的nginx中针对目录进行IP限制 ,这里我以phpmyadmin目录只能让内网IP访问,而外网不能访问的配置方法,有需要的同学可参考. nginx phpmyadmin 针对内网ip用户开放 ...
- [转]linux之less命令
转自:http://www.cnblogs.com/peida/archive/2012/11/02/2750588.html less 工具也是对文件或其它输出进行分页显示的工具,应该说是linux ...
- 【调试】DLL EXE 调试技巧
0.随便说点 最近因为一些原因一直都没有更新博客,从今天开始要逐渐恢复了,也是对自己的鞭策. 1.本文目标 本文要说在有DLL 和 EXE源码的情况下调试DLL 和 EXE, 工具是VC++2010, ...
- IntelliJ IDEA 13 Keygen
import java.math.BigInteger; import java.util.Date; import java.util.Random; import java.util.zip.CR ...
- 对人脑处理视觉的描述(摘《学习OpenCV(中文版)》)
人脑将视觉信号划分入很多个通道,将各种不同的信息输入你的大脑.你的大脑有一个关注系统,会根据任务识别出图像的重要部分,并做重点分析,而其他部分则分析得较少 .在人类视觉流中存在大量的反馈,但是目前我们 ...
- python在linux上的GUI无法弹出界面
在进行python写GUI程序的时候,使用Tkinter,发现无法执行程序,报错如下: X connection to localhost:10.0 broken(explicit kill or s ...
- nagios高可用性设置
1. 前言 如何来实现nagios监控系统的高可用,监控是很重要的,在关键时刻进行通知报警,通知人员进行相应的处理. 在进行配置的时候,需要配置两台相同服务的nagios服务器,配置相同,同时在运行, ...
- Shell Scipt 命令行带参数,输出log
命令行带参数,以及字符串参数放到ssh命令里可以这么放: #!/bin/bash 这行保证运行bash可以这样: ./data.sh if [ $# != 4 ]; then echo ...
- 如何创建Asp.net MVC ViewModel
ASP.NET MVC View Model Patterns Since MVC has been released I have observed much confusion about how ...