I use the "maven" plugin to upload artifacts created using the Gradle build to the Maven central repository. I am using a task similar to the following:
uploadArchives { repositories { mavenDeployer { beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } pom.project { name 'Example Application' packaging 'jar' url 'http://www.example.com/example-application' scm { connection 'scm:svn:http://foo.googlecode.com/svn/trunk/' url 'http://foo.googlecode.com/svn/trunk/' } licenses { license { name 'The Apache License, Version 2.0' url 'http://www.apache.org/licenses/LICENSE-2.0.txt' } } } } } }
However, the POM file created by this task does not correctly report dependencies that were excluded in my Gradle build file. For instance:
dependencies { compile('org.eclipse.jgit:org.eclipse.jgit.java7:3.5.2.201411120430-r') { exclude module: 'commons-logging' } compile('com.upplication:s3fs:0.2.8') { exclude module: 'commons-logging' } }
How to eliminate dependencies that are properly managed in the resulting POM file?
source share