使用eclipse创建maven项目需要的一些基础步骤

使用eclipse创建maven项目需要的一些基础步骤

首先是环境搭建
1.环境变量
a.maven_home: D:\Program Files\apache-maven-3.6.3
b.path:%maven_home%\bin
2.config
settings
a.仓库位置
E:\m2\repository
b.中央仓库

nexus-aliyun
central
Nexus aliyun
http://maven.aliyun.com/nexus/content/groups/public

3.集成到eclipse中
a.安装路径(window/preferences/maven/)
b.settings文件引入
application.yml
generatorConfig.xml
pom.xml
App.java
MyBatisGeneratorUtil.java

application.yml 内容如下(resources目录下)
server:
port: 8080

spring:
datasource:
name: test
url: jdbc:mysql://localhost/power?useUnicode=true&characterEncoding=utf8&useSSL=false
username: root
password: root
# 使用druid数据源
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.jdbc.Driver
filters: stat
maxActive: 20
initialSize: 1
maxWait: 60000
minIdle: 1
timeBetweenEvictionRunsMillis: 60000
minEvictableIdleTimeMillis: 300000
validationQuery: select ‘x’
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
poolPreparedStatements: true
maxOpenPreparedStatements: 20
mvc:
view:
prefix: /WEB-INF/page/ # 页面默认前缀目录
suffix: .jsp # 响应页面默认后缀
resources:
static-locations:/static/

# 该配置节点为独立的节点,有很多同学容易将这个配置放在spring的节点下,导致配置无法被识别
mybatis:
mapper-locations: classpath:mapper/*.xml #注意:一定要对应mapper映射xml文件的所在路径
type-aliases-package: com.tf.pojo # 注意:对应实体类的路径

#pagehelper分页插件
pagehelper:
offsetAsPageNum: true
rowBoundsWithCount: true
dialect: mysql
reasonable: true

generatorConfig.xml内容如下:

<?xml version="1.0" encoding="UTF-8"?>
	<!-- true:使用BigDecimal对应DECIMAL和 NUMERIC数据类型 -->
	<!-- false:默认, scale>0;length>18ÿ
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值