现场情景:

初次搭建springboot工程,原本要搭建一个springboot+mybatis的maven工程,听说springboot会把一切给配置好,天真的在执行完mybatis自动生成mapper文件后进行打包,当前springboot工程只有一个空的application.properties文件,没有进行任何配置,故进行打包时(执行run as maven install命令)报以下错误:

_            __ _ _/\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \\\/  ___)| |_)| | | | | || (_| |  ) ) ) )'  |____| .__|_| |_|_| |_\__, | / / / /=========|_|==============|___/=/_/_/_/:: Spring Boot ::  (v2.2.0.BUILD-SNAPSHOT)2019-06-04 07:02:35.185  INFO 8784 --- [           main] com.swyx.tools.SwyxFormApplicationTests  : Starting SwyxFormApplicationTests on iZkdeowwn5dyxdZ with PID 8784 (started by Administrator in H:\swyx\codes\swyx_form\swyx_form_api)
2019-06-04 07:02:35.188  INFO 8784 --- [           main] com.swyx.tools.SwyxFormApplicationTests  : No active profile set, falling back to default profiles: default
2019-06-04 07:02:37.296  WARN 8784 --- [           main] o.m.s.mapper.ClassPathMapperScanner      : No MyBatis mapper was found in '[com.swyx.form.api]' package. Please check your configuration.
2019-06-04 07:02:39.294  INFO 8784 --- [           main] o.s.s.concurrent.ThreadPoolTaskExecutor  : Initializing ExecutorService 'applicationTaskExecutor'
2019-06-04 07:02:39.700  WARN 8784 --- [           main] o.s.w.c.s.GenericWebApplicationContext   : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Failed to determine a suitable driver class
2019-06-04 07:02:39.701  INFO 8784 --- [           main] o.s.s.concurrent.ThreadPoolTaskExecutor  : Shutting down ExecutorService 'applicationTaskExecutor'
2019-06-04 07:02:39.716  INFO 8784 --- [           main] ConditionEvaluationReportLoggingListener : Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2019-06-04 07:02:39.719 ERROR 8784 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : ***************************
APPLICATION FAILED TO START
***************************Description:Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.Reason: Failed to determine a suitable driver classAction:Consider the following:If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).2019-06-04 07:02:39.729 ERROR 8784 --- [           main] o.s.test.context.TestContextManager      : Caught exception while allowing TestExecutionListener [org.springframework.test.context.web.ServletTestExecutionListener@126945f9] to prepare test instance [com.swyx.tools.SwyxFormApplicationTests@53ce2392]java.lang.IllegalStateException: Failed to load ApplicationContextat org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:132) ~[spring-test-5.2.0.BUILD-SNAPSHOT.jar:5.2.0.BUILD-SNAPSHOT]at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:122) ~[spring-test-5.2.0.BUILD-SNAPSHOT.jar:5.2.0.BUILD-SNAPSHOT]at org.springframework.test.context.web.ServletTestExecutionListener.setUpRequestContextIfNecessary(ServletTestExecutionListener.java:190) ~[spring-test-5.2.0.BUILD-SNAPSHOT.jar:5.2.0.BUILD-SNAPSHOT]at org.springframework.test.context.web.ServletTestExecutionListener.prepareTestInstance(ServletTestExecutionListener.java:132) ~[spring-test-5.2.0.BUILD-SNAPSHOT.jar:5.2.0.BUILD-SNAPSHOT]at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:244) ~[spring-test-5.2.0.BUILD-SNAPSHOT.jar:5.2.0.BUILD-SNAPSHOT]at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:227) ~[spring-test-5.2.0.BUILD-SNAPSHOT.jar:5.2.0.BUILD-SNAPSHOT]at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:289) ~[spring-test-5.2.0.BUILD-SNAPSHOT.jar:5.2.0.BUILD-SNAPSHOT]at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) ~[junit-4.12.jar:4.12]at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:291) ~[spring-test-5.2.0.BUILD-SNAPSHOT.jar:5.2.0.BUILD-SNAPSHOT]at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:246) ~[spring-test-5.2.0.BUILD-SNAPSHOT.jar:5.2.0.BUILD-SNAPSHOT]at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:97) ~[spring-test-5.2.0.BUILD-SNAPSHOT.jar:5.2.0.BUILD-SNAPSHOT]at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) ~[junit-4.12.jar:4.12]at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) ~[junit-4.12.jar:4.12]at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) ~[junit-4.12.jar:4.12]at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) ~[junit-4.12.jar:4.12]at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) ~[junit-4.12.jar:4.12]at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) ~[spring-test-5.2.0.BUILD-SNAPSHOT.jar:5.2.0.BUILD-SNAPSHOT]at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70) ~[spring-test-5.2.0.BUILD-SNAPSHOT.jar:5.2.0.BUILD-SNAPSHOT]at org.junit.runners.ParentRunner.run(ParentRunner.java:363) ~[junit-4.12.jar:4.12]at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:190) ~[spring-test-5.2.0.BUILD-SNAPSHOT.jar:5.2.0.BUILD-SNAPSHOT]at org.junit.runner.JUnitCore.run(JUnitCore.java:137) ~[junit-4.12.jar:4.12]at org.junit.runner.JUnitCore.run(JUnitCore.java:115) ~[junit-4.12.jar:4.12]at org.junit.vintage.engine.execution.RunnerExecutor.execute(RunnerExecutor.java:40) ~[junit-vintage-engine-5.4.2.jar:5.4.2]at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183) ~[na:na]at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195) ~[na:na]at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133) ~[na:na]at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801) ~[na:na]at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) ~[na:na]at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) ~[na:na]at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150) ~[na:na]at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173) ~[na:na]at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[na:na]at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497) ~[na:na]at org.junit.vintage.engine.VintageTestEngine.executeAllChildren(VintageTestEngine.java:80) ~[junit-vintage-engine-5.4.2.jar:5.4.2]at org.junit.vintage.engine.VintageTestEngine.execute(VintageTestEngine.java:71) ~[junit-vintage-engine-5.4.2.jar:5.4.2]at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:220) ~[junit-platform-launcher-1.3.1.jar:1.3.1]at org.junit.platform.launcher.core.DefaultLauncher.lambda$execute$6(DefaultLauncher.java:188) ~[junit-platform-launcher-1.3.1.jar:1.3.1]at org.junit.platform.launcher.core.DefaultLauncher.withInterceptedStreams(DefaultLauncher.java:202) ~[junit-platform-launcher-1.3.1.jar:1.3.1]at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:181) ~[junit-platform-launcher-1.3.1.jar:1.3.1]at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:128) ~[junit-platform-launcher-1.3.1.jar:1.3.1]at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:150) ~[surefire-junit-platform-2.22.2.jar:2.22.2]at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:124) ~[surefire-junit-platform-2.22.2.jar:2.22.2]at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:384) ~[surefire-booter-2.22.2.jar:2.22.2]at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:345) ~[surefire-booter-2.22.2.jar:2.22.2]at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:126) ~[surefire-booter-2.22.2.jar:2.22.2]at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:418) ~[surefire-booter-2.22.2.jar:2.22.2]
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Failed to determine a suitable driver classat org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:638) ~[spring-beans-5.2.0.BUILD-SNAPSHOT.jar:5.2.0.BUILD-SNAPSHOT]at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:618) ~[spring-beans-5.2.0.BUILD-SNAPSHOT.jar:5.2.0.BUILD-SNAPSHOT]at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1325) ~[spring-beans-5.2.0.BUILD-SNAPSHOT.jar:5.2.0.BUILD-SNAPSHOT]at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1164) ~[spring-beans-5.2.0.BUILD-SNAPSHOT.jar:5.2.0.BUILD-SNAPSHOT]at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555) ~[spring-beans-5.2.0.BUILD-SNAPSHOT.jar:5.2.0.BUILD-SNAPSHOT]at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) ~[spring-beans-5.2.0.BUILD-SNAPSHOT.jar:5.2.0.BUILD-SNAPSHOT]at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.2.0.BUILD-SNAPSHOT.jar:5.2.0.BUILD-SNAPSHOT]at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.2.0.BUILD-SNAPSHOT.jar:5.2.0.BUILD-SNAPSHOT]at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.2.0.BUILD-SNAPSHOT.jar:5.2.0.BUILD-SNAPSHOT]at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.2.0.BUILD-SNAPSHOT.jar:5.2.0.BUILD-SNAPSHOT]at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:868) ~[spring-beans-5.2.0.BUILD-SNAPSHOT.jar:5.2.0.BUILD-SNAPSHOT]at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:877) ~[spring-context-5.2.0.BUILD-SNAPSHOT.jar:5.2.0.BUILD-SNAPSHOT]at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549) ~[spring-context-5.2.0.BUILD-SNAPSHOT.jar:5.2.0.BUILD-SNAPSHOT]at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:782) ~[spring-boot-2.2.0.BUILD-SNAPSHOT.jar:2.2.0.BUILD-SNAPSHOT]at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:404) ~[spring-boot-2.2.0.BUILD-SNAPSHOT.jar:2.2.0.BUILD-SNAPSHOT]at org.springframework.boot.SpringApplication.run(SpringApplication.java:319) ~[spring-boot-2.2.0.BUILD-SNAPSHOT.jar:2.2.0.BUILD-SNAPSHOT]at org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:132) ~[spring-boot-test-2.2.0.BUILD-SNAPSHOT.jar:2.2.0.BUILD-SNAPSHOT]at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:99) ~[spring-test-5.2.0.BUILD-SNAPSHOT.jar:5.2.0.BUILD-SNAPSHOT]at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:124) ~[spring-test-5.2.0.BUILD-SNAPSHOT.jar:5.2.0.BUILD-SNAPSHOT]... 45 common frames omitted
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Failed to determine a suitable driver classat org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) ~[spring-beans-5.2.0.BUILD-SNAPSHOT.jar:5.2.0.BUILD-SNAPSHOT]at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:633) ~[spring-beans-5.2.0.BUILD-SNAPSHOT.jar:5.2.0.BUILD-SNAPSHOT]... 63 common frames omitted
Caused by: org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Failed to determine a suitable driver classat org.springframework.boot.autoconfigure.jdbc.DataSourceProperties.determineDriverClassName(DataSourceProperties.java:236) ~[spring-boot-autoconfigure-2.2.0.BUILD-SNAPSHOT.jar:2.2.0.BUILD-SNAPSHOT]at org.springframework.boot.autoconfigure.jdbc.DataSourceProperties.initializeDataSourceBuilder(DataSourceProperties.java:176) ~[spring-boot-autoconfigure-2.2.0.BUILD-SNAPSHOT.jar:2.2.0.BUILD-SNAPSHOT]at org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration.createDataSource(DataSourceConfiguration.java:44) ~[spring-boot-autoconfigure-2.2.0.BUILD-SNAPSHOT.jar:2.2.0.BUILD-SNAPSHOT]at org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration$Hikari.dataSource(DataSourceConfiguration.java:88) ~[spring-boot-autoconfigure-2.2.0.BUILD-SNAPSHOT.jar:2.2.0.BUILD-SNAPSHOT]at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.2.0.BUILD-SNAPSHOT.jar:5.2.0.BUILD-SNAPSHOT]... 64 common frames omitted[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 5.429 s<<< FAILURE! - in com.swyx.tools.SwyxFormApplicationTests
[ERROR] contextLoads  Time elapsed: 0.008 s  <<< ERROR!
java.lang.IllegalStateException: Failed to load ApplicationContext
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Failed to determine a suitable driver class
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Failed to determine a suitable driver class
Caused by: org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Failed to determine a suitable driver class[INFO]
[INFO] Results:
[INFO]
[ERROR] Errors:
[ERROR]   SwyxFormApplicationTests.contextLoads ? IllegalState Failed to load Applicatio...
[INFO]
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  14.815 s
[INFO] Finished at: 2019-06-04T07:02:40+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test) on project swyx_form_api: There are test failures.
[ERROR]
[ERROR] Please refer to H:\swyx\codes\swyx_form\swyx_form_api\target\surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
[ERROR] ->[Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

pom.xml文件:

<?xml version="1.0" encoding="UTF-8"?>
<projectxmlns="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.2.0.BUILD-SNAPSHOT</version><relativePath/> <!--lookup parent from repository--></parent><groupId>com.swyx</groupId><artifactId>swyx_form_api</artifactId><version>0.0.1-SNAPSHOT</version><name>swyx_form_api</name><description>守望一心表单引擎后台支持工程</description><properties><java.version>1.8</java.version></properties><dependencies><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency><dependency><groupId>org.mybatis.spring.boot</groupId><artifactId>mybatis-spring-boot-starter</artifactId><version>2.0.0</version></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-test</artifactId><scope>test</scope></dependency><!--mysql--><dependency><groupId>mysql</groupId><artifactId>mysql-connector-java</artifactId><scope>runtime</scope></dependency><dependency><groupId>org.mybatis.generator</groupId><artifactId>mybatis-generator-core</artifactId><version>1.3.7</version></dependency></dependencies><build><plugins><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId></plugin><plugin><groupId>org.mybatis.generator</groupId><artifactId>mybatis-generator-maven-plugin</artifactId><version>1.3.2</version><configuration><configurationFile>src/main/resources/generatorConfig.xml</configurationFile><verbose>true</verbose><overwrite>true</overwrite></configuration></plugin></plugins></build><repositories><repository><id>spring-snapshots</id><name>Spring Snapshots</name><url>https://repo.spring.io/snapshot</url><snapshots><enabled>true</enabled></snapshots></repository><repository><id>spring-milestones</id><name>Spring Milestones</name><url>https://repo.spring.io/milestone</url></repository></repositories><pluginRepositories><pluginRepository><id>spring-snapshots</id><name>Spring Snapshots</name><url>https://repo.spring.io/snapshot</url><snapshots><enabled>true</enabled></snapshots></pluginRepository><pluginRepository><id>spring-milestones</id><name>Spring Milestones</name><url>https://repo.spring.io/milestone</url></pluginRepository></pluginRepositories>
</project>

观察错误意为有数据源的依赖包但没有配置数据源:

添加两个配置文件(个人偏好使用yml文件,故删掉类application.properties文件添加了yml文件进行配置):

application.yml:

spring:profiles:active: dev

application-dev.yml:

server:port: 8080spring:datasource:username: rootpassword: wbj@1992*url: jdbc:mysql://localhost:3306/swyx_form?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=UTCdriver-class-name: com.mysql.jdbc.Drivermybatis:mapper-locations: classpath:mapping/*Mapper.xmltype-aliases-package: com.example.entity#showSql
logging:level:com:example:mapper : debug

重新执行打包命令,再无异常

转载于:https://www.cnblogs.com/ShouWangYiXin/p/10971302.html

BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [相关推荐

  1. 启动springboot报错Error creating bean with name 'dataSource' defined in class path resource

    2019独角兽企业重金招聘Python工程师标准>>> 启动springboot报错Error creating bean with name 'dataSource' define ...

  2. 解决 Error creating bean with name ‘dataSource‘ defined in class path resource 问题

    报错如下: java.lang.IllegalStateException: Failed to load ApplicationContextat org.springframework.test. ...

  3. Error creating bean with name ‘dataSource‘ defined in class path resource解决

    报错信息 ERROR 3592 - [ restartedMain] o.s.boot.SpringApplication : Application run failed org.springfra ...

  4. Error creating bean with name 'dataSource' defined in class path resource [spring/spring-dao.xml]:

    Error creating bean with name 'dataSource' defined in class path resource [spring/spring-dao.xml]: B ...

  5. 【J】BeanCreationException: Error creating bean with name 'shiroFilter' defined in class path resource

    在做SSM博客系统的时候遇到以下报错:org.springframework.beans.factory.BeanCreationException: Error creating bean with ...

  6. 记一次SpringBoot操作redis报错 Error creating bean with name ‘dataSource‘ defined in class path resource解决方法

    代码块 以下为Springboot操作Redis一些简单的测试代码 maven依赖 <dependency><groupId>org.springframework.boot& ...

  7. Error creating bean with name 'servletEndpointRegistrar' defined in class path resource

    记一次配置内容丢失导致报错问题:Error creating bean with name 'servletEndpointRegistrar' defined in class path resou ...

  8. 解决Error creating bean with name ‘redisConnectionFactory‘ defined in class path resource...问题

    文章目录 1. 复现问题 2. 分析问题 3. 解决问题 1. 复现问题 今天在启动spring boot项目时,出现如下错误: org.springframework.beans.factory.B ...

  9. Error creating bean with name ‘sqlSessionFactory‘ defined in class path resource [applicationContext

    学习spring框架时遇到一个问题,找了很久. 记录一个错误, D:\Java\jdk-14.0.2\bin\java.exe -ea -Didea.test.cyclic.buffer.size=1 ...

最新文章

  1. Spring中@Import注解的作用和使用
  2. 玛塔机器人函数_玛塔创想编程机器人套装包含什么?
  3. 奔跑吧linux内核_别了,Linux 的魔法时代!
  4. 基于.NET Framework 4.0的解决方案部署
  5. 使用PostgreSQL使用Spring Boot和JPA构建基本应用
  6. gazebo 直接获取传感器数据_【ROS-Gazebo】IMU插件使用与数据采集——以四足机器人pigot为例...
  7. L2-037 包装机 (25 分)-PAT 团体程序设计天梯赛 GPLT
  8. 【项目记录】雪球网股票组合数据爬虫(包括雪球模拟登录代码)
  9. 中软国际软件测试培训中心,中软国际准员工培养计划C++开发/软件测试方向开班典礼...
  10. 2015年1月工作记录和阅读记录
  11. 联想thinkpad待机怎么唤醒_联想电脑睡眠无法唤醒_联想电脑睡眠怎么唤醒
  12. 我打算写一个《程序员的成长课》
  13. 在c#中using和new这两个关键字有什么意义
  14. Error: Couldn‘t find preset “stage-2“ relative to directory
  15. android 时间颜色,android修改状态栏时间和日期颜色.docx
  16. python爬取网站的图片
  17. python的金融计算器_货币的时间价值 —— 带着Python玩金融(1)
  18. 论企业集成平台的架构设计
  19. FFmpeg----图片处理
  20. 轻松搭建自己的Ngrok服务器

热门文章

  1. ADO,OLEDB,ODBC,DAO的区别
  2. 预览文章: c++ primer学习笔记,二:标准库类型
  3. 120.数据缓存cache的基本概念
  4. 中国量化投资将呈现三大发展趋势
  5. 数据科学家技能地铁图
  6. 人工智能时代,Python机器学习及分析工具
  7. 007_Checkbox多选框
  8. 006_FastDFS文件上传
  9. 擅长排列的小明 II
  10. php memcached 扩展下载,编译安装 PHP 的 Memcached 扩展