build.gradle 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. plugins {
  2. id 'java'
  3. id 'maven-publish'
  4. }
  5. group = 'com.its'
  6. version = '0.0.1'
  7. sourceCompatibility = '1.8'
  8. targetCompatibility = '1.8'
  9. repositories {
  10. mavenCentral()
  11. }
  12. dependencies {
  13. implementation 'io.netty:netty-all:4.1.52.Final'
  14. }
  15. //processResources {
  16. // enabled = false
  17. //}
  18. //jar {
  19. // enabled = true
  20. //}
  21. test {
  22. useJUnitPlatform()
  23. }
  24. publishing {
  25. publications {
  26. mavenJava(MavenPublication) {
  27. from components.java
  28. }
  29. }
  30. repositories {
  31. maven {
  32. name = "customLocalRepo"
  33. println "its-cluster library install mvn repository..."
  34. def repoPath = org.gradle.internal.os.OperatingSystem.current().isWindows() ?
  35. "C:/java/repository" :
  36. "/Users/openvalue/Projects/java/repository"
  37. url = uri(repoPath)
  38. }
  39. /*
  40. * 참고: 더 표준적인 방법은 모든 프로젝트가 공유하는 기본 로컬 Maven 저장소(~/.m2/repository)를 사용하는 것입니다.
  41. * 그렇게 하려면 위 'maven' 블록 대신 아래 'mavenLocal()'을 사용하면 됩니다.
  42. * mavenLocal()
  43. */
  44. }
  45. }
  46. tasks.register('runInstallJarLibrary', Exec) {
  47. doFirst {
  48. println "its-cluster library install mvn repository..."
  49. def os = org.gradle.internal.os.OperatingSystem.current()
  50. workingDir = file('.')
  51. if (os.isWindows()) {
  52. commandLine 'cmd', '/C', 'start', 'install.bat'
  53. } else {
  54. commandLine 'sh', './install.sh'
  55. }
  56. }
  57. }
  58. jar.finalizedBy runInstallJarLibrary
  59. tasks.withType(JavaCompile).configureEach {
  60. options.encoding = 'UTF-8'
  61. options.compilerArgs << '-Xlint:unchecked'
  62. options.deprecation = true
  63. }