Tencent/tinker · warning · GradleException

Please specify '$name' option in gradle project properties.

Error message

Please specify '$name' option in gradle project properties.

What it means

GradleException from gradle/PublishArtifact.gradle: the WeChat/Maven publishing configuration requires a set of POM_* project properties, and one named in the error is missing. The checkAndGetOption helper fails the build immediately when publishing tasks run without the property defined.

Source

Thrown at gradle/PublishArtifact.gradle:5

apply from: rootProject.file('gradle/WeChatPublish.gradle')

def checkAndGetOption(name) {
    if (!project.hasProperty(name)) {
        throw new GradleException("Please specify '$name' option in gradle project properties.")
    }
    return project[name]
}

wechatPublish {
    pom {
        name = checkAndGetOption('POM_NAME')
        description = checkAndGetOption('POM_DESCRIPTION')
        url = checkAndGetOption('POM_URL')

        scm {
            url = checkAndGetOption('POM_SCM_URL')
        }

        licenses {
            license {
                name = checkAndGetOption('POM_LICENCE_NAME')
                url = checkAndGetOption('POM_LICENCE_URL')

View on GitHub (pinned to 1b7ea02c23)

Solutions

  1. Add the missing property (named in the message) to gradle.properties or pass -P<name>=value
  2. If you do not intend to publish, avoid invoking publish/upload lifecycle tasks
  3. For maintainers: publish from the release environment whose gradle.properties carries the full POM_* set

Example fix

# before (gradle.properties)
POM_NAME=Tinker

# after (gradle.properties)
POM_NAME=Tinker
POM_DESCRIPTION=Tinker hotpatch
POM_URL=https://github.com/Tencent/tinker
POM_SCM_URL=https://github.com/Tencent/tinker.git
Defensive patterns

Strategy: validation

Validate before calling

// build.gradle / CI check before publish tasks
def requiredPomProps = ['POM_NAME','POM_DESCRIPTION','POM_URL','POM_SCM_URL','POM_SCM_CONNECTION']
def missing = requiredPomProps.findAll { !project.hasProperty(it) }
if (!missing.isEmpty()) {
    throw new GradleException("Missing publish properties: " + missing.join(', ') + " — add to gradle.properties or skip publish tasks")
}

Prevention

When it happens

Trigger: Running publish/upload tasks (e.g., ./gradlew publishToMavenLocal or bintray upload) on a module applying PublishArtifact.gradle without the required POM_NAME, POM_DESCRIPTION, POM_URL, POM_SCM_URL, etc., defined in gradle.properties or via -P flags.

Common situations: Contributors or CI building the Tinker project itself (not app consumers) triggering publish tasks without the release engineer's gradle.properties; forks renaming publishing config; migrating publishing to another plugin while old tasks remain.

Related errors


AI-assisted analysis of Tencent/tinker@1b7ea02c23 (2026-08-14). Data as JSON: /api/errors/f57c81ef4096c2d1. Report an issue: GitHub.