How to use with maven-publish plugin ?
I want to publish my android library on Bitbucket, But as i found in gradle version 7.x maven plugin has removed and now we need to use maven-publish instead, So how we can migrate below script to make workable with maven-publish plugin:
uploadArchives {
configuration = configurations.deployLibrary
repositories.mavenDeployer {
repository(url: 'git:master://[email protected]:<org-name>/<repo-name>.git')
snapshotRepository(url: "git:snapshots://https://YOUR_USERNAME:[email protected]/YOUR_COMPANY/repo-snapshot.git")
pom.project {
groupId = "com.it.validator"
version = "0.0.1"
artifactId = "ev"
packaging "aar"
}
}
}
@devsideal I am facing the same challenge are you able to find any solution?
I don't think this is possible any more, see this comment: https://github.com/gradle/gradle/issues/14750#issuecomment-784358228
TLDR; maven-publish does not use wagon anymore
I ended up writing a shell script that clones the repo, runs gradle to publish into that repo and then commit & push:
#!/bin/bash
if [ ! -d maven-repo ]; then
git clone <your url>
fi
cd maven-repo
git pull
cd ..
./gradlew publish
cd maven-repo
git add .
git commit -m "deploy <name of your project>"
git push
An arguably better alternative would be to stick with gradle<=6