ConsumerPortal
org.csource
fastdfs-client-java
org.springframework.boot
spring-boot-starter-web
org.springframework.cloud
spring-cloud-starter-eureka
org.springframework.cloud
spring-cloud-starter-ribbon
org.springframework.cloud
spring-cloud-starter-config
org.springframework.boot
spring-boot-starter-freemarker
com
CommonBean
0.0.1-SNAPSHOT
com
CommonFeign
0.0.1-SNAPSHOT
com
CommonUtil
0.0.1-SNAPSHOT
jar包出错
网上解决方案 如果还有问题可能是maven环境配置有问题,或者是父工程没有加版本号
在ConsumerManager子工程的pom.xml中创建依赖管理和构建管理
4.0.0
com
CrowdFundingParent
0.0.1-SNAPSHOT
ConsumerManager
org.springframework.boot
spring-boot-starter-web
org.springframework.cloud
spring-cloud-starter-eureka
org.springframework.cloud
spring-cloud-starter-ribbon
org.springframework.cloud
spring-cloud-starter-config
org.springframework.boot
spring-boot-starter-freemarker
com
CommonBean
0.0.1-SNAPSHOT
com
CommonFeign
0.0.1-SNAPSHOT
com
CommonUtil
0.0.1-SNAPSHOT
在ProviderActiviti子工程的pom.xml中创建依赖管理和构建管理
4.0.0
com
CrowdFundingParent
0.0.1-SNAPSHOT
ProviderActiviti
mysql
mysql-connector-java
com.alibaba
druid
org.mybatis.spring.boot
mybatis-spring-boot-starter
org.springframework.boot
spring-boot-starter-web
org.springframework.boot
spring-boot-starter-test
test
org.springframework.cloud
spring-cloud-starter-eureka
org.springframework.cloud
spring-cloud-starter-config
com
CommonBean
0.0.1-SNAPSHOT
com
CommonFeign
0.0.1-SNAPSHOT
com
CommonUtil
0.0.1-SNAPSHOT
org.activiti
activiti-spring-boot-starter-basic
在ProviderDatabase子工程的pom.xml中创建依赖管理和构建管理
4.0.0
com
CrowdFundingParent
0.0.1-SNAPSHOT
ProviderDatabase
mysql
mysql-connector-java
com.alibaba
druid
org.mybatis.spring.boot
mybatis-spring-boot-starter
org.springframework.boot
spring-boot-starter-web
org.springframework.boot
spring-boot-starter-test
test
org.springframework.cloud
spring-cloud-starter-eureka
org.springframework.cloud
spring-cloud-starter-config
com
CommonBean
0.0.1-SNAPSHOT
com
CommonFeign
0.0.1-SNAPSHOT
com
CommonUtil
0.0.1-SNAPSHOT
在RegisterCenterEureka子工程的pom.xml中创建依赖管理和构建管理
4.0.0
com
CrowdFundingParent
0.0.1-SNAPSHOT
RegisterCenterEureka
org.springframework.cloud
spring-cloud-starter-eureka-server
在CommonFeign子工程的pom.xml中创建依赖管理和构建管理
4.0.0
com
CrowdFundingParent
0.0.1-SNAPSHOT
CommonFeign
org.springframework.cloud
spring-cloud-starter-feign
com
CommonBean
0.0.1-SNAPSHOT
其他工程无依赖管理和构建管理,后期如果需要在加即可
创建各工程主启动类
RegisterCenterEureka
@EnableEurekaServer
@SpringBootApplication
ProviderDatabase
@EnableEurekaClient
@MapperScan(“com.mapper”)
@SpringBootApplication
ProviderActiviti
@EnableEurekaClient
@EnableFeignClients
@SpringBootApplication
ConsumerPortal
@EnableEurekaClient
@EnableFeignClients
@SpringBootApplication
ConsumerManager
@EnableEurekaClient
@EnableFeignClients
@SpringBootApplication
例图:
创建各工程yml文件
RegisterCenterEureka
server:
port: 84
eureka:
instance:
hostname: localhost
client:
register-with-eureka: false
fetch-registry: false
service-url:
defaultZone: http://localhost:84/eureka
ProviderDatabase
server:
port: 83
mybatis:
config-location: classpath:mybatis/mybatis.cfg.xml
mapper-locations:
- classpath:mybatis/mapper/*Mapper.xml
spring:
application:
name: ProviderDatabase
datasource:
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: org.gjt.mm.mysql.Driver
url: jdbc:mysql://localhost:3306/atcrowdfunding?rewriteBatchedStatements=true&useUnicode=true&characterEncoding=utf8
username: root
password: root
dbcp2:
min-idle: 5
initial-size: 5
max-total: 5
max-wait-millis: 200
eureka:
client:
service-url:
defaultZone: http://localhost:84/eureka
创建mybatis目录
创建mybatis.cfg.xml
<?xml version="1.0" encoding="UTF-8"?>ProviderActiviti
server:
port: 82
spring:
application:
name: ProviderActiviti
datasource:
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: org.gjt.mm.mysql.Driver
url: jdbc:mysql://localhost:3306/atcrowdfunding?rewriteBatchedStatements=true&useUnicode=true&characterEncoding=utf8
username: root
password: root
dbcp2:
min-idle: 5
initial-size: 5
max-total: 5
max-wait-millis: 200
eureka:
client:
service-url:
defaultZone: http://localhost:84/eureka
ConsumerPortal
server:
port: 80
eureka:
client:
register-with-eureka: false
service-url:
defaultZone: http://localhost:84/eureka
spring:
freemarker:
template-loader-path: classpath:/templates/
suffix: .page
crowdfunding.tracker.config.location: classpath:/tracker.conf
创建templates目录
创建tracker.conf
tracker_server=192.168.0.100:22122
ConsumerManager
server:
port: 81
eureka:
client:
register-with-eureka: false
service-url:
defaultZone: http://localhost:84/eureka
spring:
freemarker:
template-loader-path: classpath:/templates/
suffix: .page
创建templates目录
现在写一个首页显示功能测试一下
显示首页:使用Freemarker作为SpringBoot环境下的视图技术,创建一个index.page,将前端页面摸板的index.html复制j进去
修改页面
修改后
在路径前加/表示在类路径下
修改后