# Cannot access gradle.properties properties in external script plugin buildscript

**URL:** <https://discuss.gradle.org/t/cannot-access-gradle-properties-properties-in-external-script-plugin-buildscript/37427>\
**Category:** Help/Discuss\
**Created:** [August 28, 2020, 2:24pm UTC](https://discuss.gradle.org/t/cannot-access-gradle-properties-properties-in-external-script-plugin-buildscript/37427 "2020-08-28T14:24:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sneakyguy6](https://avatars.discourse-cdn.com/v4/letter/s/87869e/32.png) [@Sneakyguy6](https://discuss.gradle.org/u/Sneakyguy6)\
**Post date:** [August 28, 2020, 2:24pm UTC](https://discuss.gradle.org/t/cannot-access-gradle-properties-properties-in-external-script-plugin-buildscript/37427/1 "2020-08-28T14:24:45Z")

</div>

I keep getting a ‘groovy.lang.MissingPropertyException: Could not get unknow property ‘gitUsername’ for Credentials [username: null] of type org.gradle.internal.credentials.DefaultPasswordCredentials\_Decorated’.

I am trying to add an external maven repository which has a plugin that I need. This is a private repository and so requires a username and password. These values are stored in the gradle.properties file. I want to use the properties defined in gradle.properties in the buildscript block in my external script plugin. To be clear, the properties seem to be found if I define the repository in build.gradle however I want to define it in an external script plugin.

This is my current setup:  
build.gradle

```gradle
buildscript {
  apply from: 'other.gradle', to: buildscript
}

```

other.gradle:

```gradle
buildscript {
  repositories {
    maven {
      name = "GithubPackages"
      url = "maven.pkg.github.com/Sneakyguy6/Repo"
      credentials {
        username gitUsername //error
        password gitPassword //error
      }
    }
  }
}

```

I am using gradle 6.6
