Gradle is not adding dependencies to generated POM file

(niranjan.nanda) #1

I am using Gradle 4.5.1 in wrapper mode to build my app. The app is a simple module which generates a JAR artifact.

I have these dependencies defined under dependencies as compile configuration. The POM task is defined as this:

task writePom << {
	pom {
assemble.dependsOn writePom

The build goes through, but the content there’s no content generated in POM.

<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="" xmlns=""

Can anybody help what’s going on?

(Mark) #2

I’m not sure if this is similar, but I used the below to add something to the POM that was uploaded inside publishing.publications.maven :

 pom.withXml {
        asNode().appendNode('description', '{"GitHash":"' + "${revision}" + '"}')