Hello, I just moved from gradle 1.10 to 1.11. In my team’s project, we are using the ‘maven’ plugin and ‘uploadArchives’ task to upload the assembled aar artifact to our maven repository. Everything was working fine until we moved to gradle 1.11 at which point the pom file generated by ‘uploadArchives’ was missing the entire dependencies section.
Here is a snippet of the build.gradle:
apply plugin: 'android-library'
apply plugin: 'maven'
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
compile group:'depgroup2', name:'departifact2', version: '1.+'
}
....
uploadArchives {
repositories {
mavenDeployer {
repository(url: <our maven repo URL>)
pom.groupId = 'group1'
pom.version = 'version1'
pom.artifactId = 'artifact1'
}
}
}
The generated pom from gradle 1.10 is below(expected output with dependencies):
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>group1</groupId>
<artifactId>artifact1</artifactId>
<version>version1</version>
<packaging>aar</packaging>
<dependencies>
<dependency>
<groupId>depgroup2</groupId>
<artifactId>departifact2</artifactId>
<version>1.+</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
However, with no other changes other than switching to gradle 1.11, the dependencies block is missing:
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>group1</groupId>
<artifactId>artifact1</artifactId>
<version>version1</version>
<packaging>aar</packaging>
</project>
What I found from trying several things is that if I do not set a custom value on any of the pom objects in build.gradle (pom.groupId, pom.version, pom.artifactId), then the dependencies block shows up. If I set any of them, the dependencies block disappears. Is this a known issue in 1.11?