这个Villa框架适用于中小型公司,因为没做微服务,所以只能用在单体或集群中
Core包顾名思义代表核心,是整套框架的基础设施,使用其他villa包可能需要依赖此包
具体链接 点此进入github仓库
简单贴一下这个包有哪些能力:
- springboot+mybatis框架基础
- 核心工具集
- 登录/签名拦截器
- 参数防篡改
- 参数加密
- 用户授权token验证
- 白名单
- 黑名单
- redis
- 验证
- 缓存
- 事件机制
- 多数据源
- SSH链接数据库
还有一些其他的,具体如果有用户愿意使用可以交流一下
使用方式: pom.xml配置--这是我一个真实项目的pom.xml配置,因为把代码部署到了maven,所以这里都是使用maven依赖,里面包含了比较多的其他组件,包括代码生成器、长链接包、上传、版本管理、流水记录、后台用户模块、邮箱等等
<?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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.1</version>
<relativePath/>
</parent>
<groupId>com.villa</groupId>
<artifactId>xxx</artifactId>
<version>1.0</version>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>com.villa</groupId>
<artifactId>cms</artifactId>
<version>4.0.9</version>
</dependency>
<dependency>
<groupId>com.villa</groupId>
<artifactId>core</artifactId>
<version>2.4.6.6</version>
</dependency>
<dependency>
<groupId>com.villa</groupId>
<artifactId>im_sdk</artifactId>
<version>1.0.0.cluster</version>
</dependency>
<dependency>
<groupId>com.villa</groupId>
<artifactId>upload</artifactId>
<version>3.0.6</version>
</dependency>
<dependency>
<groupId>com.villa</groupId>
<artifactId>version</artifactId>
<version>1.0.2</version>
</dependency>
<dependency>
<groupId>com.villa</groupId>
<artifactId>cash_flow</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.villa</groupId>
<artifactId>admin</artifactId>
<version>1.2.6</version>
</dependency>
<dependency>
<groupId>com.villa</groupId>
<artifactId>email</artifactId>
<version>1.0.2</version>
</dependency>
<!--谷歌二维码-->
<dependency>
<groupId>com.google.zxing</groupId>
<artifactId>core</artifactId>
<version>3.5.0</version>
</dependency>
<dependency>
<groupId>com.google.zxing</groupId>
<artifactId>javase</artifactId>
<version>3.5.0</version>
</dependency>
<!--<dependency>
<groupId>net.coobird</groupId>
<artifactId>thumbnailator</artifactId>
<version>0.4.19</version>
</dependency>-->
</dependencies>
<build>
<resources>
<!--将resources下的配置文件拷贝到target/config目录下 -->
<resource>
<directory>src/main/resources</directory>
<targetPath>${project.build.directory}/config</targetPath>
</resource>
<!--编译的时候,类路径下也复制一份配置文件(防止开发启动的时候读取不到配置的情况) -->
<resource>
<directory>src/main/resources</directory>
<targetPath>${project.build.directory}/classes</targetPath>
</resource>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
<include>**/*.yml</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<!-- 将所依赖的第三方jar包打入target下的lib目录 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.1.2</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<!-- 解决资源文件的编码问题 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<encoding>UTF-8</encoding>
<nonFilteredFileExtensions>
<nonFilteredFileExtension>jks</nonFilteredFileExtension>
</nonFilteredFileExtensions>
</configuration>
</plugin>
<!-- 打jar包的main方法配置 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.2</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
<mainClass>com.villa.StartApplication</mainClass>
</manifest>
<!-- 给清单文件添加键值对(配置文件外置) -->
<manifestEntries>
<Class-Path>config/</Class-Path>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<configuration>
<nonFilteredFileExtensions>
<nonFilteredFileExtension>ttf</nonFilteredFileExtension>
<nonFilteredFileExtension>woff</nonFilteredFileExtension>
<nonFilteredFileExtension>woff2</nonFilteredFileExtension>
</nonFilteredFileExtensions>
</configuration>
</plugin>
</plugins>
</build>
</project>