build.gradle.kts 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. import java.time.Duration
  2. import nebula.plugin.release.git.opinion.Strategies
  3. plugins {
  4. id("idea")
  5. id("com.github.ben-manes.versions")
  6. id("com.diffplug.spotless")
  7. id("io.github.gradle-nexus.publish-plugin")
  8. id("nebula.release")
  9. }
  10. release {
  11. defaultVersionStrategy = Strategies.getSNAPSHOT()
  12. }
  13. nebulaRelease {
  14. addReleaseBranchPattern("""v\d+\.\d+\.x""")
  15. }
  16. nexusPublishing {
  17. packageGroup.set("io.opentelemetry")
  18. repositories {
  19. sonatype {
  20. username.set(System.getenv("SONATYPE_USER"))
  21. password.set(System.getenv("SONATYPE_KEY"))
  22. }
  23. }
  24. connectTimeout.set(Duration.ofMinutes(5))
  25. clientTimeout.set(Duration.ofMinutes(5))
  26. transitionCheckOptions {
  27. // We have many artifacts so Maven Central takes a long time on its compliance checks. This sets
  28. // the timeout for waiting for the repository to close to a comfortable 50 minutes.
  29. maxRetries.set(300)
  30. delayBetween.set(Duration.ofSeconds(10))
  31. }
  32. }
  33. // Enable after verifying Maven Central publishing once through manual closing
  34. // tasks.release.finalizedBy tasks.closeAndReleaseRepository
  35. description = "OpenTelemetry instrumentations for Java"
  36. spotless {
  37. // this formatting is applied at the root level, as some of these files are not in a submodules
  38. // and would be missed otherwise
  39. format("misc") {
  40. target(".gitignore", "*.md", "docs/**/*.md")
  41. indentWithSpaces()
  42. trimTrailingWhitespace()
  43. endWithNewline()
  44. }
  45. }