- WARNING不是错误, 不予理会
[WARNING] The POM for com.alibaba:druid:jar:1.1.16 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
- generator/genConfig.xml中导入外部jdbc信息,仅支持以*.properties作为扩展名的文件, 例如application.properties或者jdbc.properties, 但是以 *.yml为扩展名的文件, 不支持的。
1) 支持 resources/jdbc.properties
spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
spring.datasource.url=jdbc:mysql://localhost:3306/study8001?characterEncoding=utf-8&useSSL=true&allowMultiQueries=true
spring.datasource.username=root
spring.datasource.password=password
2) 不支持 resources/application.yml
spring:
datasource:
url: jdbc:mysql://localhost:3306/study8001?characterEncoding=utf-8&useSSL=true&allowMultiQueries=true
username: root
password: password
type: com.alibaba.druid.pool.DruidDataSource
- <properties resource="jdbc.properties"/>
<jdbcConnection driverClass="com.mysql.jdbc.Driver"
connectionURL="${spring.datasource.url}"
userId="${spring.datasource.username}"
password="${spring.datasource.password}"/>