I use gradle to build android library and push it to remote maven repository. Is there some way to get resulting pom
and aar
files and copy it, for example, to root of the project?
Here is the task for publishing to maven (it's in library project build.gradle
)
uploadArchives {
configuration = configurations.archives
repositories.mavenDeployer {
repository(url: constants.snapshotUrl) {
authentication(userName: userName, password: password)
pom.groupId = constants.groupId
pom.artifactId = constants.libUIArtifactIdName
pom.version = constants.projectVersion
}
pom.whenConfigured { pom ->
pom.dependencies.forEach { dep ->
if (dep.getVersion() == "unspecified") {
dep.setGroupId(constants.groupId)
dep.setVersion(constants.projectVersion)
}
}
}
}
}
Are you using
maven
plugin? If so you'll find generated poms under${project.buildDir}/poms
and artifacts e.g. frominstall
task configuration.Also
doLast
foruploadArchives
can be probably utilised.