1、配置链接参数:jdbc.properties
#数据源data1
datasourcedata1.url=jdbc:mysql://localhost:3306/data1?autoReconnect=true&useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false&serverTimezone=Asia/Shanghai
datasourcedata1.username=data1
datasourcedata1.password=data1
#数据源data2
datasourcedata2.url=jdbc:mysql://localhost:3306/data2?autoReconnect=true&useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false&serverTimezone=Asia/Shanghai
datasourcedata2.username=data2
datasourcedata2.password=data1
#JDBC驱动程序的完全限定类名
datasource.driverClassName=com.mysql.jdbc.Driver
##项目目录下执行命令:mvn mybatis-generator:generate 生成目录文件
targetJavaProject=src/main/java
targetMapperBasePackage=com.riskeys.ai.test
targetModelPackagedata1=com.data.ai.test.entity.data1
targetMapperPackagedata1=com.data.ai.test.mapper.data1
targetModelPackagedata2=com.data.ai.test.entity.data2
targetMapperPackagedata2=com.riskeys.ai.test.mapper.data2
targetResourcesProject=src/main/java
targetXMLPackage=/
2、配置generatorConfig.xml,多数据源配置多个标签
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE generatorCo