Skip to content

Teamcity plugin no longer honors plugin-sourced credentials. #572

Closed
@DanielJRutledge

Description

@DanielJRutledge

Describe the bug
Teamcity plugin is no longer able to publish gradle artifacts with the Project uses Artifactory Plugin" box checked. It appears that the Teamcity builds are no longer honoring the credentials stored in the plugin and using those stored in the artifactory block of the build.gradle file instead.

To Reproduce
Define a build which uses the artifactory gradle plugin and publishes some artifacts using the artifactory gradle plugin. Define a Teamcity build and publish using the Teamcity artifactory plugin with the "Project uses Artifactory Plugin" box checked.

Sample build.gradle block:

    dependencies {
        classpath "com.pros.ppss:ppss-gradle-plugin:${ppssVersion}"
        classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:latest.release'
    }
...
artifactory {
        contextUrl = "${artifactoryBase}"
        resolve {
            repository {
                repoKey = isReleaseBuild ? 'maven-onprem-release' : 'maven-onprem-dev'
                username = artifactory_user
                password = artifactory_password
            }
        }
        publish {
            repository {
                repoKey = isReleaseBuild ? 'maven-onprem-release' : 'maven-onprem-dev'
                // credentials are missing as they will be injected by the Jfrog CLI, publishing is never done by a local machine.
            }
            defaults {
                publications ('ALL_PUBLICATIONS')
            }
        }
    }

This intended for local use; the publish credentials are supposed to be sourced from the Teamcity plugin. Until this morning, Teamcity did so, but now it is attempting to publish without any credentials according to the build.gradle file.

Expected behavior
We would expect a successful publish, provided the correct credentials are supplied to the agent.

Screenshots
Note that we currently have the "Project uses Artifactory Plugin" box checked in the Teamcity Artifactory plugin. We would expected the credentials present in the artifactory block of the build.gradle file to be overriden, but as of the latest gradle artifactory plugin release, they are not.
image

Versions

  • Gradle Artifactory plugin version: 4.24.22
  • Operating system: RHEL 7
  • Artifactory Version: 7.27.9
  • Teamcity Artifactory Plugin: 2.8.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    gradle bugCreate a report to help us improve

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions