彩神大发快三_神彩大发快三官方

spring boot 多模块简单示例

时间:2020-01-11 13:43:32 出处:彩神大发快三_神彩大发快三官方

数据库操作

数据库实体类 User

dao模块是用来操作数据库的,创建包

直接加进parent,继承spring-boot的pom依赖

reference: http://www.jianshu.com/p/69b9fbb97574

if occur ==IllegalStateException: No supported DataSource type found== error

项目逻辑

包下新建MyBatisConfig.java

if you want to add some filter in you web application

mybatis xml文件

you can create application.properties under resources in web module.

创建接口

then, each file's content are follow:

make sure the dependency of commons-dbcp, or tomcat-jdbc or hikaricp in your pom.xml file

reference: https://springframework.guru/jackson-dependency-issue-spring-boot-maven/

web api,与前端交互

now, you dao module's structure may look like this:

if you want to use another port ,

mybatis配置

define your filter

github: https://github.com/jjzhu-ncu/bg-study/tree/master/spring-boot/spring-boot-mult-module

finally, the structure of dao module may look like this:

在main文件夹下创建resources文件夹,并加进文件

reference: https://stackoverflow.com/questions/31942908/spring-boot-application-with-hive-connection-doesnt-start-embedded-tomcat

肯能你项目所含这名的父类,就没法用method-1中的继承了,就你会会随随后管理spring-boot的依赖

spring-boot-mult-module项目下配置spring-boot的依赖。

可还上能 能有四种 生活法律法律依据来引入spring-boot

最近花了半个月看spring-boot.简单记录下SpringBoot的多模块示例

then configure your filter in your ApplicationConfig.java

then run all the tests and check the database to see whether or not the insert test is successful.

本例中用的是method-1,详细的pom.xml如下:

reference: https://stackoverflow.com/questions/34790924/i-am-getting-datasource-not-supported-when-using-datasoucebuilder

数据库配置

有有4个多多多项目中用到了hive和hadoop,在用spring-boot搭个任务导入平台的随后,启动的随后报错了

run your application and you will see the filter is load.

now, you want to use another version of jackson, you can add the follow dependency in you pom.xml

项目有如下有有4个多多多模块

and add the follow property to change server port

reference: http://www.jianshu.com/p/05c8be17c50a

for example:

the version of jackson in spring-boot-1.5.4.RELEASE is

这里可还上能 能注意的,spring-boot肯能加进了好多好多 依赖的包,肯能你想使用不同版本的库,你会用来移除,随后加进当事人版本的库

项目右键-> 新建module.

项目社会形态look like this

the default port of tomcat server is 5050,

这名是肯能hadoop中的servlet-api的版本和spring-boot中的版本冲突了

hadoop中的是 2.5,而spring-boot中的是3.1,好多好多 在pom.xml加入如下配置

热门

热门标签