Guest User

Untitled

a guest
Jul 23rd, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.98 KB | None | 0 0
  1. settings.gradle:
  2. includeFlat 'projA','projB','projC'
  3.  
  4. projA-build.gradle:
  5. compile project(":projB")
  6.  
  7. Could not resolve all dependencies for configuration ':runtime'.
  8. Could not find master:restclient:4.0-SNAPSHOT.
  9.  
  10. subprojects {
  11. afterEvaluate { Project proj ->
  12. def is_snap = false
  13. def reltype = "releases"
  14. def artifact_name = sprintf("%s-%s.jar"
  15. ,project['name']
  16. ,project['version'])
  17. def nexus_release_path = sprintf("%s/nexus/content/repositories/releases/%s/%s/%s/%s"
  18. ,project['nexus_url']
  19. ,project['groupId'].replaceAll("\.","/")
  20. ,project['name']
  21. ,project['version']
  22. ,artifact_name
  23. )
  24.  
  25. if(project.version.contains("SNAPSHOT")){
  26. reltype = "snapshots"
  27. is_snap = true
  28. }
  29.  
  30. uploadArchives {
  31. // only try the upload if it's not already there
  32. onlyIf {
  33. try {
  34. def artifact_exists = new URL(nexus_release_path).bytes
  35. // if we get here then the artifact existed and we only want to
  36. // build if this is a snapshot version
  37. is_snap || false
  38. } catch (FileNotFoundException e) {
  39. // this means we couldn't find the artifact in nexus
  40. if(!is_snap){
  41. println "NOTE ==> Don't forget to create new git tag for $artifact_name!"
  42. }
  43. true
  44. }
  45. }
  46.  
  47. repositories {
  48. mavenDeployer {
  49. repository(url: "${project.nexus_url}/nexus/content/repositories/$reltype") {
  50. authentication(userName: project.nexus_user, password: project.nexus_password)
  51. }
  52. pom.version = "${project['version']}"
  53. pom.artifactId = "${project.name}"
  54. pom.groupId = "${groupId}"
  55. }
  56. }
  57. }
  58. ...
  59. }
Add Comment
Please, Sign In to add comment