IDEA最全的正确打包姿势 | 您所在的位置:网站首页 › jar文件是什么类型的 › IDEA最全的正确打包姿势 |
文章适合新手了解IDEA怎么正确打包。文章在编写过程中难免有疏漏和错误,欢迎大佬指出文章的不足之处;更多内容请点进👉 Lino_White 👈查看。 未来的世界充满着各式各样的数据,我们该怎么好好利用起来呢?开启正文吧~~~ IDEA分三种打包方式,接下来我们将逐一使用截图来介绍,哪一种都可以使用哟! 三种打包方式——以及出现错误的解决方法 第一种:集所有依赖包在项目中打包成jar,一个jar第二种:打包成所有依赖包+项目包,多个jar第三种(小编推荐):maven打成一个jar包,一个jar 不要着急,收藏一波,看看运行常常出现的bug!!! 第一种:集所有依赖包在项目中打包成jar,一个jar
1、Failed to configure a DataSource: ‘url’ attribute is … Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method ‘dataSource‘ threw except... *************************** 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 class Action: 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). 首先,在你的配置文件当中,先确定自己的项目有没有使用到HikariDataSource,如果没有移除即可;如果有,那么就看看你的配置文件中spring:datasource有没有配置少或者错误;都没问题,那么就看看pom.xml文件是不是配置正确了。pom.xml文件必须扫包的时候配置有扫描项目下的**/* .yml、** /* .xml、**/* .properties的相关配置,如下: org.springframework.boot spring-boot-maven-plugin 2.2.2.RELEASE src/main/java **/*.xml **/*.yml **/*.properties src/main/resources **/*.yml **/*.xml **/*.properties2、错误: 找不到或无法加载主类 com.xxx.cn.AppApplication 如果你选择的是第一种,那么你应该就会遇到这种错误,这时候只需要将jar打开,将
spring自带的slf4j包跟其他自带的包冲突所产生,去除冲突的包,在pom.xml文件中添加以下相关配置即可: org.springframework.boot spring-boot-starter-web org.springframework.boot spring-boot-starter-logging org.slf4j slf4j-log4j12 ch.qos.logback logback-classic如果提示没有log4j包的话,再单独导包进去,如以下配置: org.apache.logging.log4j log4j-slf4j-impl |
CopyRight 2018-2019 实验室设备网 版权所有 |