Guest User

Untitled

a guest
Jan 11th, 2019
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. buildscript.dependencies {
  2. classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4+"
  3. }
  4.  
  5. apply plugin: 'maven-publish'
  6. apply plugin: "com.jfrog.artifactory"
  7.  
  8. repo = version.endsWith('SNAPSHOT') ? 'mvn-libs-snapshot' : 'mvn-public-local'
  9. artifactory {
  10. contextUrl = "${artifactory_contextUrl}"
  11. publish {
  12. repository {
  13. repoKey = repo
  14. username = artifactoryUser // user and password depending upon repo
  15. password = artifactoryPassword
  16. maven = true
  17. }
  18. defaults {
  19. publications ('mavenJava')
  20. publishBuildInfo = true //Publish build-info to Artifactory (true by default)
  21. publishArtifacts = true //Publish artifacts to Artifactory (true by default)
  22. }
  23. }
  24. resolve {
  25. repository {
  26. repoKey = 'mvn-libs-snapshot'
  27. username = "${artifactory_user}"
  28. password = "${artifactory_password}"
  29. maven = true
  30. }
  31. }
  32. }
  33.  
  34. publishing {
  35. publications {
  36. mavenJava(MavenPublication) {
  37. from components.java // publishes default original java sources jar
  38. artifact shadowJar // fat jar will be uploaded
  39. artifact distZip // publishes a zip file output this task
  40.  
  41. // Multiple tasks can be published
  42. def allEnvs = deploymentEnvALL.split(',')
  43. allEnvs.each {
  44. def env ->
  45. artifact "zip_$env" { // custom zip tasks containing env specific deployment configs
  46. classifier = "$env-configs"
  47. }
  48. }
  49. }
  50. }
  51. }
Add Comment
Please, Sign In to add comment