build.gradle 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. ext {
  2. configuration = [
  3. javaVersion = JavaVersion.VERSION_1_7
  4. ]
  5. libraries = [
  6. mybatisSpringVersion = '1.3.1',
  7. mybatisVersion = '3.4.5',
  8. springVersion = '4.3.5.RELEASE',
  9. ]
  10. dependencies = [
  11. "jsqlparser" : "com.github.jsqlparser:jsqlparser:1.1",
  12. "mybatis-spring": "org.mybatis:mybatis-spring:${mybatisSpringVersion}",
  13. "mybatis": "org.mybatis:mybatis:${mybatisVersion}",
  14. "spring-context-support":"org.springframework:spring-context-support:${springVersion}",
  15. "spring-jdbc":"org.springframework:spring-jdbc:${springVersion}",
  16. "spring-tx":"org.springframework:spring-tx:${springVersion}",
  17. "velocity":"org.apache.velocity:velocity-engine-core:2.0",
  18. ]
  19. }
  20. allprojects{
  21. group = 'com.baomidou'
  22. version = '2.1.5'
  23. }
  24. description = "Mybatis 增强工具包 - 只做增强不做改变,简化CRUD操作"
  25. subprojects{
  26. apply plugin: 'java'
  27. apply plugin: 'maven'
  28. apply plugin: 'signing'
  29. sourceCompatibility = "${javaVersion}"
  30. targetCompatibility = "${javaVersion}"
  31. tasks.withType(JavaCompile) {
  32. options.encoding = 'UTF-8'
  33. }
  34. repositories {
  35. mavenLocal()
  36. maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
  37. jcenter()
  38. }
  39. task sourcesJar(type: Jar, dependsOn: classes) {
  40. classifier = 'sources'
  41. from sourceSets.main.allSource
  42. }
  43. javadoc {
  44. options {
  45. encoding "UTF-8"
  46. charSet 'UTF-8'
  47. author true
  48. version true
  49. failOnError false
  50. links "http://docs.oracle.com/javase/7/docs/api"
  51. }
  52. }
  53. task javadocJar(type: Jar, dependsOn: javadoc) {
  54. classifier = 'javadoc'
  55. from 'build/docs/javadoc'
  56. }
  57. artifacts {
  58. archives sourcesJar
  59. archives javadocJar
  60. }
  61. signing {
  62. sign configurations.archives
  63. }
  64. // gradle clean build uploadArchives -Dun=用户名 -Dps=密码 -x test
  65. uploadArchives {
  66. repositories {
  67. mavenDeployer {
  68. beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
  69. def userName = System.getProperty("un")
  70. def passWord = System.getProperty("ps")
  71. repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
  72. authentication(userName: userName, password: passWord)
  73. }
  74. snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
  75. authentication(userName: userName, password: passWord)
  76. }
  77. pom.version = "$project.version"
  78. pom.artifactId = "$project.name"
  79. pom.groupId = "$project.group"
  80. pom.project {
  81. name 'mybatis-plus'
  82. packaging 'jar'
  83. description 'An enhanced toolkit of Mybatis to simplify development.'
  84. url 'https://github.com/baomidou/mybatis-plus'
  85. scm {
  86. connection 'scm:git@github.com:Codearte/gradle-nexus-staging-plugin.git'
  87. developerConnection 'scm:git@github.com:Codearte/gradle-nexus-staging-plugin.git'
  88. url 'https://github.com/baomidou/mybatis-plus'
  89. }
  90. licenses {
  91. license {
  92. name 'The Apache License, Version 2.0'
  93. url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
  94. }
  95. }
  96. developers {
  97. developer {
  98. id 'baomidou'
  99. name 'hubin'
  100. email 'jobob@qq.com'
  101. }
  102. }
  103. }
  104. }
  105. }
  106. }
  107. }