由于公司需要,现需组建一套新的框架技术整合开发。经再三衡量,最终选择使用的框架如下:
springmvc4.2.2(web处理)+spring4.2.2(IOC+AOP)+mybatis3.2.8(与数据库的数据交互,持久层)+oscache2.4(缓存)+dubbo2.5.3(系统交互)+activityMq5.7.0(消息交互)+mysql5.6数据库+tomcat7服务+jdk1.7
maven工程 + git(版本控制) + nexus(私服)+ zookeeper(服务注册中心(dubbo使用)) + eclipse(开发工具)
工程结构:
batchJob的pom.xml
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.iafclub</groupId> <artifactId>batchJob</artifactId> <packaging>pom</packaging> <version>1.0.0-SNAPSHOT</version> <name>batchJob-parent</name> <url>http://maven.apache.org</url> <modules> <module>batchJob-core</module> <module>batchJob-task</module> <module>batchJob-remote</module> </modules> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> <dependencies> </dependencies> <distributionManagement> <repository> <id>releases</id> <name>Nexus Release Repository</name> <url>http://192.168.10.102:8081/nexus/content/repositories/releases/</url> </repository> <snapshotRepository> <id>snapshots</id> <name>Nexus Snapshot Repository</name> <url>http://192.168.10.102:8081/nexus/content/repositories/snapshots/</url> </snapshotRepository> </distributionManagement> <repositories> <repository> <id>nexus</id> <name>nexus</name> <url>http://192.168.10.102:8081/nexus/content/groups/public/</url> </repository> </repositories> <!-- 打包插件 --> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-source-plugin</artifactId> <executions> <execution> <id>attach-sources</id> <goals> <goal>jar</goal> </goals> </execution> </executions> </plugin> <!-- 解决dynmic Web module 3.0问题 --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.3</version> <configuration> <!-- 指定source和target的版本 --> <source>1.7</source> <target>1.7</target> </configuration> </plugin> </plugins> </build> </project>
batchJob-core的pom.xml
<?xml version="1.0"?> <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>com.iafclub</groupId> <artifactId>batchJob</artifactId> <version>1.0.0-SNAPSHOT</version> </parent> <artifactId>batchJob-core</artifactId> <packaging>jar</packaging> <name>batchJob-core</name> <url>http://maven.apache.org</url> <dependencies> <!-- 精融汇工具类包 --> <dependency> <groupId>com.iafclub</groupId> <artifactId>baseTools-util</artifactId> <version>1.0.0-SNAPSHOT</version> </dependency> <!-- 接口信息 --> <dependency> <groupId>com.iafclub</groupId> <artifactId>batchJob-remote</artifactId> <version>1.0.0-SNAPSHOT</version> </dependency> <!-- 调用gateway的接口 --> <dependency> <groupId>com.iafclub</groupId> <artifactId>gateway-remote</artifactId> <version>1.0.0-SNAPSHOT</version> </dependency> <!-- 添加Spring-core包 --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> <version>4.2.2.RELEASE</version> </dependency> <!-- 添加spring-context包 --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>4.2.2.RELEASE</version> </dependency> <!-- 添加spring-tx包 --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-tx</artifactId> <version>4.2.2.RELEASE</version> </dependency> <!-- 添加spring-jdbc包 --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-jdbc</artifactId> <version>4.2.2.RELEASE</version> </dependency> <!-- 为了方便进行单元测试,添加spring-test包 --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-test</artifactId> <version>4.2.2.RELEASE</version> </dependency> <!--添加spring-web包 --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-web</artifactId> <version>4.2.2.RELEASE</version> </dependency> <!--添加aspectjweaver包 --> <dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjweaver</artifactId> <version>1.8.5</version> </dependency> <!--添加spring-aop包 --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-aop</artifactId> <version>4.2.2.RELEASE</version> </dependency> <!--添加spring-dispatch依赖包 --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>4.2.2.RELEASE</version> </dependency> <!-- 添加mybatis的核心包 --> <dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis</artifactId> <version>3.2.8</version> </dependency> <!-- 添加mybatis与Spring整合的核心包 --> <dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis-spring</artifactId> <version>1.2.2</version> </dependency> <!-- 添加servlet3.0核心包 --> <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> <version>3.0.1</version> </dependency> <dependency> <groupId>javax.servlet.jsp</groupId> <artifactId>javax.servlet.jsp-api</artifactId> <version>2.3.2-b01</version> </dependency> <!-- jstl --> <dependency> <groupId>javax.servlet</groupId> <artifactId>jstl</artifactId> <version>1.2</version> </dependency> <!-- 添加mysql驱动包 --> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>5.1.34</version> </dependency> <!-- 添加druid连接池包 --> <dependency> <groupId>com.alibaba</groupId> <artifactId>druid</artifactId> <version>1.0.12</version> </dependency> <!-- json start --> <dependency> <groupId>net.sf.json-lib</groupId> <artifactId>json-lib</artifactId> <version>2.4</version> <classifier>jdk15</classifier> </dependency> <!-- json end --> <!-- log4j start--> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.17</version> </dependency> <dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> <version>1.2</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> <version>1.7.13</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> <version>1.7.13</version> </dependency> <!-- log4j end--> <!-- pdf工具类 start--> <dependency> <groupId>com.itextpdf</groupId> <artifactId>itext-asian</artifactId> <version>5.2.0</version> </dependency> <dependency> <groupId>itext</groupId> <artifactId>itext</artifactId> <version>1.3.1</version> </dependency> <dependency> <groupId>com.itextpdf.tool</groupId> <artifactId>xmlworker</artifactId> <version>5.5.8</version> </dependency> <!-- pdf工具类 end--> <!-- 添加junit单元测试包 --> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.12</version> <scope>test</scope> </dependency> <!-- 使用activeMq消息队列 --> <dependency> <groupId>org.apache.activemq</groupId> <artifactId>activemq-core</artifactId> <version>5.7.0</version> </dependency> <dependency> <groupId>org.apache.activemq</groupId> <artifactId>activemq-spring</artifactId> <version>5.7.0</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-jms</artifactId> <version>4.2.2.RELEASE</version> </dependency> <dependency> <groupId>ehcache</groupId> <artifactId>ehcache</artifactId> <version>1.2.3</version> </dependency> <!-- 引入缓存组件 --> <dependency> <groupId>opensymphony</groupId> <artifactId>oscache</artifactId> <version>2.4</version> <exclusions> <exclusion> <artifactId>jms</artifactId> <groupId>javax.jms</groupId> </exclusion> </exclusions> </dependency> <!-- 引入dubbo服务 start--> <dependency> <groupId>com.alibaba</groupId> <artifactId>dubbo</artifactId> <version>2.5.3</version> <exclusions> <exclusion> <groupId>org.springframework</groupId> <artifactId>spring</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>com.github.sgroschupf</groupId> <artifactId>zkclient</artifactId> <version>0.1</version> </dependency> <!-- 引入dubbo服务 end--> </dependencies> </project>
batchJob-remote的pom.xml
<?xml version="1.0"?> <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>com.iafclub</groupId> <artifactId>batchJob</artifactId> <version>1.0.0-SNAPSHOT</version> </parent> <groupId>com.iafclub</groupId> <artifactId>batchJob-remote</artifactId> <version>1.0.0-SNAPSHOT</version> <name>batchJob-remote</name> <url>http://maven.apache.org</url> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> </dependencies> </project>
batchJob-task的pom.xml
<?xml version="1.0"?> <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>com.iafclub</groupId> <artifactId>batchJob</artifactId> <version>1.0.0-SNAPSHOT</version> </parent> <artifactId>batchJob-task</artifactId> <packaging>war</packaging> <name>batchJob-task</name> <url>http://maven.apache.org</url> <dependencies> <dependency> <groupId>com.iafclub</groupId> <artifactId>batchJob-core</artifactId> <version>${parent.version}</version> </dependency> <!-- 添加junit单元测试包 --> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.12</version> <scope>test</scope> </dependency> </dependencies> <build> <finalName>batchJob-task</finalName> </build> </project>
时间: 2024-11-06 22:01:03