build.gradle 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. apply plugin: 'java'
  2. apply plugin: 'maven'
  3. ext {
  4. configuration = [
  5. javaVersion = JavaVersion.VERSION_1_7
  6. ]
  7. libraries = [
  8. mybatisSpringVersion = '1.3.1',
  9. mybatisVersion = '3.4.4',
  10. springVersion = '4.3.5.RELEASE',
  11. ]
  12. }
  13. group = 'com.baomidou'
  14. version = '2.0.9'
  15. description = "Mybatis 增强工具包 - 只做增强不做改变,简化CRUD操作"
  16. sourceCompatibility = "${javaVersion}"
  17. targetCompatibility = "${javaVersion}"
  18. tasks.withType(JavaCompile) {
  19. options.encoding = 'UTF-8'
  20. }
  21. repositories {
  22. mavenLocal()
  23. maven { url 'http://repo.spring.io/plugins-release' }
  24. maven { url "https://plugins.gradle.org/m2/" }
  25. maven { url 'http://maven.aliyun.com/nexus/content/groups/public/'}
  26. mavenCentral()
  27. jcenter()
  28. }
  29. task sourcesJar(type: Jar, dependsOn: classes) {
  30. classifier = 'sources'
  31. from sourceSets.main.allSource
  32. }
  33. javadoc {
  34. options {
  35. encoding "UTF-8"
  36. charSet 'UTF-8'
  37. author true
  38. version true
  39. failOnError false
  40. links "http://docs.oracle.com/javase/7/docs/api"
  41. }
  42. }
  43. task javadocJar(type: Jar, dependsOn: javadoc) {
  44. classifier = 'javadoc'
  45. from 'build/docs/javadoc'
  46. }
  47. artifacts {
  48. archives sourcesJar
  49. archives javadocJar
  50. }
  51. uploadArchives {
  52. def repositoryUrl = "http://172.16.111.124:8081/nexus/content/repositories/releases/"
  53. repositories {
  54. mavenDeployer {
  55. repository(url: "$repositoryUrl") {
  56. authentication(userName: "deployment", password: "deployment123")
  57. }
  58. pom.version = "$project.version"
  59. pom.artifactId = "$project.name"
  60. pom.groupId = "$project.group"
  61. }
  62. }
  63. }
  64. def common = [
  65. "org.springframework:spring-tx:${springVersion}",
  66. "org.springframework:spring-jdbc:${springVersion}",
  67. "org.springframework:spring-context-support:${springVersion}",
  68. "com.alibaba:druid:1.0.29",
  69. "org.apache.velocity:velocity:1.7"
  70. ]
  71. dependencies {
  72. compile ("org.mybatis:mybatis-spring:${mybatisSpringVersion}")
  73. compile ("org.mybatis:mybatis:${mybatisVersion}")
  74. compile ("com.github.jsqlparser:jsqlparser:1.0")
  75. compileOnly common
  76. testCompileOnly("javax.servlet:servlet-api:2.5")
  77. testCompile("org.mybatis.caches:mybatis-ehcache:1.1.0")
  78. testCompile("ch.qos.logback:logback-classic:1.2.2")
  79. testCompile("junit:junit:4.12")
  80. testCompile("org.apache.commons:commons-dbcp2:2.1.1") {
  81. exclude(module: 'commons-logging')
  82. }
  83. testCompile("org.apache.commons:commons-pool2:2.4.2")
  84. testCompile("com.microsoft.sqlserver:sqljdbc4:4.0")
  85. testCompile("org.postgresql:postgresql:9.4.1212")
  86. testCompile("com.oracle:ojdbc14:10.2.0.5.0")
  87. testCompile("com.h2database:h2:1.4.194")
  88. testCompile("mysql:mysql-connector-java:5.1.38")
  89. testCompile common
  90. testCompile("org.slf4j:slf4j-api:1.7.25")
  91. testCompile("org.slf4j:jcl-over-slf4j:1.7.25")
  92. testCompile("org.springframework:spring-test:${springVersion}")
  93. testCompile("org.springframework:spring-webmvc:${springVersion}")
  94. testCompile("org.aspectj:aspectjweaver:1.8.9")
  95. testCompile("javax.servlet:servlet-api:2.5")
  96. testCompile("org.projectlombok:lombok:1.16.16")
  97. }