ant-framework是ant分布式框架的基础核心框架,其中包括CRUD,MVC等一系列基类和模板。另外定义了spring,mybatis,wink等底层框架扩展项目,具体内容包括:
其中ant-framework是ant分布式框架的基础核心框架,其中包括CRUD,MVC等一系列基类和模板。另外定义了spring,mybatis,wink等底层框架扩展项目,具体内容包括:
- annotation相关注解:数据签名注解、用户是否走sso登录注解等;
- Bean的相关认证;
- filter过滤器:分页、sso单点登录等;
- 对象转换封装,如:json;
- 基础controller、dao、service、basebean、xml的封装;
- security权限的封装;
- 基础CRUD的封装;
- 基础servlet的封装;
- 通用管理的封装,如:用户、角色、权限、数据字典、菜单、日子、部门机构等。
提示:当前只列了其中的一小部分核心,在后面的章节中会将所有涉及的内容一一讲解且附上相关代码。
今天我们只做简单的项目创建,创建ant-framework项目,并继承ant-parent项目,其中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.sml.sz</groupId>
<artifactId>ant-project</artifactId>
<version>1.0.0</version>
</parent>
<artifactId>ant-framework</artifactId>
<name>ant-framework</name>
<url>http://maven.apache.org</url>
<description>此项目定义了ant的代码框架,包括CRUD,MVC等一系列基类和模板。另外定义了spring,mybatis,wink等底层框架扩展</description>
<dependencies>
<!-- spring begin -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>${spring.version}</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-oxm</artifactId>
<version>${spring.version}</version>
</dependency>
<!-- spring end -->
<!-- shiro begin -->
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-core</artifactId>
<version>${shiro.version}</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-spring</artifactId>
<version>${shiro.version}</version>
</dependency>
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-web</artifactId>
<version>${shiro.version}</version>
</dependency>
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-ehcache</artifactId>
<version>${shiro.version}</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- shiro end -->
<!-- mybatis begin -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>${mybatis.version}</version>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>${mybatis-spring.version}</version>
</dependency>
<!-- mybatis end -->
<!-- hibernate validate begin -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>${validator.version}</version>
</dependency>
<!-- hibernate validate end -->
<!-- 框架工具jar包 -->
<dependency>
<groupId>com.sml.sz</groupId>
<artifactId>ant-utils</artifactId>
<exclusions>
<exclusion>
<artifactId>slf4j-log4j12</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</project>
架构代码如下:
更多资料欢迎球球2042849237
特别提醒:
由于ant-utils项目是整个分布式架构的通用工具jar包,故ant-utils项目在ant-framework的pom文件中进行配置,也就是说以后所有的项目都必须依赖ant-framework。
原文地址:http://blog.51cto.com/13833251/2163714
时间: 2024-10-07 16:35:20