Guest User

Untitled

a guest
Dec 14th, 2017
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.75 KB | None | 0 0
  1. publishing {
  2. publications {
  3. maven(MavenPublication) {
  4. groupId 'com.umer' //You can either define these here or get them from project conf elsewhere
  5. artifactId 'myLibrary'
  6. version project.version
  7. artifact "$buildDir/outputs/aar/myLibrary-release.aar" //aar artifact you want to publish
  8.  
  9. //generate pom nodes for dependencies
  10. pom.withXml {
  11. def dependenciesNode = asNode().appendNode('dependencies')
  12. configurations.compile.allDependencies.each { dependency ->
  13. def dependencyNode = dependenciesNode.appendNode('dependency')
  14. dependencyNode.appendNode('groupId', dependency.group)
  15. dependencyNode.appendNode('artifactId', dependency.name)
  16. dependencyNode.appendNode('version', dependency.version)
  17. }
  18. }
  19. }
  20. }
  21.  
  22. //publish to filesystem repo
  23. repositories{
  24. maven {
  25. url "C:\Users\Umer\AndroidStudioProjects\android\myLibrary\artifacts"
  26. }
  27. }
  28. }
  29.  
  30. dependencies {
  31. provided ('com.umer.myLibrary:myLibrary-1.1')
  32. }
  33.  
  34. buildscript {
  35.  
  36. repositories {
  37. google()
  38. jcenter()
  39. }
  40. dependencies {
  41. classpath 'com.android.tools.build:gradle:3.0.0'
  42.  
  43.  
  44. // NOTE: Do not place your application dependencies here; they belong
  45. // in the individual module build.gradle files
  46. }
  47. }
  48.  
  49. allprojects {
  50. repositories {
  51. google()
  52. jcenter()
  53. flatDir {
  54. dirs 'libs'
  55. }
  56. maven {
  57. url 'http:/GIT_LAB_IP_ADDRESS/dev/myLibrary/tree/remoteRepoPublication/artifacts'
  58. credentials {
  59. username = "myUserName"
  60. password = "myPassword"
  61. }
  62. }
  63. }
  64. }
  65.  
  66. task clean(type: Delete) {
  67. delete rootProject.buildDir
  68. }
  69.  
  70. systemProp.http.proxyHost=127.0.0.1
  71. systemProp.https.proxyPort=12345
  72. org.gradle.jvmargs=-Xmx1536m
  73. systemProp.https.proxyHost=127.0.0.1
  74. systemProp.http.proxyPort=12345
  75.  
  76. Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.umer.myLibrary:myLibrary-1.1:.
  77.  
  78. Could not resolve com.umer.myLibrary:myLibrary-1.1:.
  79. Required by:
  80. project :app
  81. > Could not resolve com.umer.myLibrary:myLibrary-1.1:.
  82. > Could not get resource 'http://GIT_LAB_IP_ADDRESS/dev/myLibrary/tree/remoteRepoPublication/artifacts/com/umer/myLibrary/myLibrary-1.1//myLibrary-1.1-.pom'.
  83. > Could not HEAD 'http://GIT_LAB_IP_ADDRESS/dev/myLibrary/tree/remoteRepoPublication/artifacts/com/umer/myLibrary/myLibrary-1.1//myLibrary-1.1-.pom'.
  84. > Connect to 127.0.0.1:12345 [/127.0.0.1] failed: Connection refused: connect
  85. > Connection refused: connect
Add Comment
Please, Sign In to add comment