代码拉取完成,页面将自动刷新
group 'person.xjl'
version '1.0-SNAPSHOT'
apply plugin: 'java'
apply plugin: 'war'
sourceCompatibility = 1.8
configurations {
mybatisGenerator
}
repositories {
mavenCentral()
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.11'
// testCompile group: 'junit', name: 'junit', version: '4.12'
// https://mvnrepository.com/artifact/org.springframework/spring-core
compile group: 'org.springframework', name: 'spring-web', version: '5.1.5.RELEASE'
compile group: 'org.springframework', name: 'spring-webmvc', version: '5.1.5.RELEASE'
compile group: 'javax.servlet.jsp.jstl', name: 'jstl', version: '1.2'
// https://mvnrepository.com/artifact/org.projectlombok/lombok
providedCompile group: 'org.projectlombok', name: 'lombok', version: '1.18.10'
// https://mvnrepository.com/artifact/mysql/mysql-connector-java
compile group: 'mysql', name: 'mysql-connector-java', version: '5.1.38'
// https://mvnrepository.com/artifact/log4j/log4j
compile group: 'log4j', name: 'log4j', version: '1.2.17'
//vue框架分离
// https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-core
compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.9.9'
// https://mvnrepository.com/artifact/org.codehaus.jackson/jackson-core-asl
compile group: 'org.codehaus.jackson', name: 'jackson-core-asl', version: '1.9.13'
// https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind
compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.9.9'
//Alibaba Durid数据连接池
// https://mvnrepository.com/artifact/com.alibaba/druid
compile group: 'com.alibaba', name: 'druid', version: '1.1.10'
//log4j2输出Alibaba Durid sql语句到控制台
// https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-core
compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.12.1'
// https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-api
compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.12.1'
// https://mvnrepository.com/artifact/org.slf4j/slf4j-api
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
// https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-slf4j-impl
compile group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: '2.12.1'
//MyBatis
compile "org.mybatis:mybatis:3.4.1"
//pagehelper
//mvnrepository.com/artifact/com.github.pagehelper/pagehelper
compile group: 'com.github.pagehelper', name: 'pagehelper', version: '5.1.2'
// https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api
providedCompile group: 'javax.servlet', name: 'javax.servlet-api', version: '3.1.0'
//MyBatis Spring 插件
compile "org.mybatis:mybatis-spring:1.3.1"
// https://mvnrepository.com/artifact/mysql/mysql-connector-java
compile group: 'mysql', name: 'mysql-connector-java', version: '5.1.18'
// https://mvnrepository.com/artifact/org.springframework/spring-jdbc
compile group: 'org.springframework', name: 'spring-jdbc', version: '4.3.18.RELEASE'
// https://mvnrepository.com/artifact/org.springframework/Spring-tx
compile group: 'org.springframework', name: 'spring-tx', version: '4.3.18.RELEASE'
// https://mvnrepository.com/artifact/org.aspectj/aspectjweaver
compile group: 'org.aspectj', name: 'aspectjweaver', version: '1.9.2'
//公共资源包
compile "commons-logging:commons-logging:1.2"
compile "commons-lang:commons-lang:2.6"
compile "org.apache.commons:commons-collections4:4.0"
compile "commons-beanutils:commons-beanutils:1.8.3"
compile "commons-dbcp:commons-dbcp:1.4"
compile "commons-pool:commons-pool:1.6"
mybatisGenerator 'org.mybatis.generator:mybatis-generator-core:1.3.2'
mybatisGenerator 'mysql:mysql-connector-java:5.1.37'
mybatisGenerator 'tk.mybatis:mapper:3.3.1'
implementation 'junit:junit:4.12'
def getDbProperties = {
def properties = new Properties()
file("src/main/resources/mybatis/db-mysql.properties").withInputStream { inputStream ->
properties.load(inputStream)
}
properties;
}
task mybatisGenerate {
def properties = getDbProperties()
ant.properties['targetProject'] = projectDir.path
ant.properties['driverClass'] = properties.getProperty("jdbc.driverClassName")
ant.properties['connectionURL'] = properties.getProperty("jdbc.url")
ant.properties['userId'] = properties.getProperty("jdbc.user")
ant.properties['password'] = properties.getProperty("jdbc.pass")
ant.properties['src_main_java'] = sourceSets.main.java.srcDirs[0].path
ant.properties['src_main_resources'] = sourceSets.main.resources.srcDirs[0].path
ant.properties['modelPackage'] = properties.getProperty("package.model")
ant.properties['mapperPackage'] = properties.getProperty("package.mapper")
ant.properties['sqlMapperPackage'] =properties.getProperty("package.xml")
ant.taskdef(
name: 'mbgenerator',
classname: 'org.mybatis.generator.ant.GeneratorAntTask',
classpath: configurations.mybatisGenerator.asPath
)
ant.mbgenerator(overwrite: true,
configfile: 'src/main/resources/mybatis/generatorConfig.xml', verbose: true) {
propertyset {
propertyref(name: 'targetProject')
propertyref(name: 'userId')
propertyref(name: 'driverClass')
propertyref(name: 'connectionURL')
propertyref(name: 'password')
propertyref(name: 'src_main_java')
propertyref(name: 'src_main_resources')
propertyref(name: 'modelPackage')
propertyref(name: 'mapperPackage')
propertyref(name: 'sqlMapperPackage')
}
}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。