Upgrade to gradle 5.1.1 from 4.10 breaks overloading pom description(using new maven-plugin)

(Dean Hiller) #1

In upgrading to 5.1.1, I was also forced to switch from maven to maven-plugin due to bugs in signing. I have a subprojects { } section that defines the entire pom for ‘every’ single project(21 projects). Each project previously overloaded the description so I modified the tree to now look like this in each project to overload it

publishing.repositories.publications.mavenJava.pom {
description=‘NIO wrapper on top of core-channelmanager2 making creating a tcp server just 3 lines of code’
}

That now fails with “Could not get unknown property ‘publications’ for repository container of type org.gradle.api.internal.artifacts.dsl.DefaultRepositoryHandler”

My top level pom code is

publishing {  
  repositories {
     maven {
        name = 'sonatype'
        url = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
        credentials {
           username = sonatypeUsername
           password = sonatypePassword
        }
     }
     maven {
        name = 'local'
        url = "file://${buildDir}/repo"
     }
  }
  publications {
     mavenJava(MavenPublication) {
        from components.java
        pom {
            name = project.name
            description = "testing this out"
            //'Someone forgot to fill this in.  See http://stackoverflow.com/questions/38272550/how-to-fail-the-gradle-build-if-subproject-is-missing-a-property'
            url = 'https://github.com/${github_org}/${project_name}'
            licenses {
                license {
                    name = 'The Apache License, Version 2.0'
                    url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
                }
            }
            developers {
                developer {
                    id = 'dhiller'
                    name = 'Dean Hiller'
                }
            }
            scm {
                connection = "scm:git:https://github.com/${github_org}/${project_name}.git"
                developerConnection = "scm:git:git@github.com:${github_org}/${project_name}.git"
                url = "https://github.com/${github_org}/${project_name}.git"
            }
        }
           
        artifact sourcesJar
     }
  }
}

I also tried this in each project
description = “My description of this project”

and then in the pom file, I did
description = project.description

but that didn’t work either :frowning: and in fact did not even fail but generated a pom with an empty description.

And of course, sonatype won’t let me upload without a description so I am blocked on this.

0 Likes