library.gradle 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. apply plugin: 'maven-publish'
  2. publishing {
  3. publications {
  4. maven(MavenPublication) {
  5. afterEvaluate { artifact(tasks.getByName("bundleReleaseAar")) }
  6. groupId = MAVEN_GROUNP_ID
  7. artifactId = 'push-umeng'
  8. version = '1.1.0'
  9. pom.withXml{
  10. def dependenciesNode = asNode().appendNode('dependencies')
  11. configurations.implementation.allDependencies.each {
  12. if (it.group != null && (it.name != null && "unspecified" != it.name) && it.version != null) {
  13. def dependencyNode = dependenciesNode.appendNode('dependency')
  14. dependencyNode.appendNode('groupId', it.group)
  15. dependencyNode.appendNode('artifactId', it.name)
  16. dependencyNode.appendNode('version', it.version)
  17. }
  18. }
  19. configurations.api.allDependencies.each {
  20. if (it.group != null && (it.name != null && "unspecified" != it.name) && it.version != null) {
  21. def dependencyNode = dependenciesNode.appendNode('dependency')
  22. dependencyNode.appendNode('groupId', it.group)
  23. dependencyNode.appendNode('artifactId', it.name)
  24. dependencyNode.appendNode('version', it.version)
  25. }
  26. }
  27. }
  28. }
  29. }
  30. repositories {
  31. maven {
  32. name = 'nexus'
  33. allowInsecureProtocol true
  34. //url MAVEN_PUBLIC_URL
  35. credentials {
  36. username = MAVEN_USERNAME
  37. password = MAVEN_PASSWORD
  38. }
  39. def releasesRepoUrl = MAVEN_PUBLIC_URL
  40. def snapshotRepoUrl = MAVEN_SNAPSHOTS_URL
  41. url = version.endsWith('SNAPSHOT') ? snapshotRepoUrl : releasesRepoUrl
  42. }
  43. }
  44. }
  45. //uploadArchives {
  46. // repositories {
  47. // mavenDeployer {
  48. // repository(url: MAVEN_PUBLIC_URL) {
  49. // authentication(userName: MAVEN_USERNAME, password: MAVEN_PASSWORD)
  50. // }
  51. // snapshotRepository(url: MAVEN_SNAPSHOTS_URL) {
  52. // authentication(userName: MAVEN_USERNAME, password: MAVEN_PASSWORD)
  53. // }
  54. // pom.groupId = MAVEN_GROUNP_ID
  55. // pom.artifactId = 'push-umeng'
  56. // pom.version = '1.0.9'
  57. // pom.packaging = 'aar'
  58. // }
  59. // }
  60. //}