Upload multiple aar 's to Nexus using jenkins - gradle release -
i need upload multiple aar's generated multi module project. project structure follows.
project root |--main app |--sub-module1 |--sub-module2 |--sub-module3
each sub module generates aar files need upload release version of aars nexus not want apks uploaded nexus.i passing nexus url , cred jenkins.
here root build.gradle
release { failoncommitneeded = false failonpublishneeded = true failonsnapshotdependencies = true failonunversionedfiles = false failonupdateneeded = true revertonfail = true precommittext = '' pretagcommitmessage = '[gradle release plugin] - pre tag commit: ' tagcommitmessage = '[gradle release plugin] - creating tag: ' newversioncommitmessage = '[gradle release plugin] - new version commit: ' tagtemplate = '$version' versionpropertyfile = './gradle.properties' versionproperties = [] buildtasks = ['uploadallarchives'] scmadapters = [ net.researchgate.release.gitadapter ] git { requirebranch = '' } } task ("uploadallarchives") { dolast{ println 'uploadallarchives' subprojects.each { subproject-> if(!subproject.name.contains('app') && !rootproject) it.uploadarchives.execute(); } } }
publish-build.gradle
apply plugin: 'maven' uploadarchives { repositories { mavendeployer { repository(url: (project.hasproperty('repourl') ? repourl : sonatyperepo)) { authentication(username: sonatypeusername, password: sonatypepassword) pom.groupid = sonatypegroupid pom.artifactid = project.name pom.version = version } } } }
sub-modules build.gradle:
apply from: '../publish-build.gradle'
gradle clean build uploadarchives
uploads snapshot aars nexus.
gradle release
- release not upload nexus build successful.
could please me missing?
you can't use normal maven
plugin android projects. have use one: https://github.com/dcendents/android-maven-gradle-plugin
also uploadallarchives task redundant, run gradle uploadarchives
root project.
Comments
Post a Comment