redhat-developer / redhat-developer/vscode-java

Could not run build action using Gradle distribution: Could not get unknown property

Open
#947 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Gradle
Dominant language
TypeScript
Stars
2.3k
Forks
546
Avg merge
20h 1m
Merged PRs (30d)
11

Description

If my build.gradle uses two external properties artifactory_user and artifactory_password, and I have them defined inside ~/.gradle/gradle.properties, VS Code does not look them up and fails:

buildscript {
    repositories {
        maven {
            url 'https://artifactory.example.com'
            credentials {
                username = "${artifactory_user}"
                password = "${artifactory_password}"
            }
        }
    }
}

Error message:

Could not run build action using Gradle distribution 'https://artifactory.example.com/gradle-cache/gradle-4.5-bin.zip'.
Build file '/Users/someuser/someproj/build.gradle' line: ...
A problem occurred evaluating root project 'someproj'.
Could not get unknown property 'artifactory_user' for Credentials [username: null] of type 
Environment
  • Operating System: macOS 10.14.5
  • JDK version: OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.212-b03, mixed mode)
  • Visual Studio Code version: 1.35.0
  • Java extension version: 0.46.0
Steps To Reproduce
  1. Define a couple of properties in your ~/.gradle/gradle.properties
  2. Use them in your build.gradle
Current Result
Could not run build action using Gradle distribution 'https://artifactory.example.com/gradle-cache/gradle-4.5-bin.zip'.
Build file '/Users/someuser/someproj/build.gradle' line: ...
A problem occurred evaluating root project 'someproj'.
Could not get unknown property 'artifactory_user' for Credentials [username: null] of type 
Expected Result

The artifactory_user and artifactory_password properties to be resolved.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure using the issue's build.gradle and ~/.gradle/gradle.properties setup, then start with the Gradle build action that evaluates the build file. Trace how the external properties are loaded during that action. Done means the artifactory_user and artifactory_password properties resolve successfully and the build action completes.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, vscode
Domain
build-system, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.