We can use maven plugin to install the artifact to local repository. After applying maven plugin, you can use install task to deploy the artifact to local repository.
apply plugin: 'maven'
After install task is executed the artifact is deployed to local maven repository as shown in below image.
To deploy the artifact to remote repository, you can use below task in build.gradle file.