# Using command line properties in the configuration phase

**URL:** <https://discuss.gradle.org/t/using-command-line-properties-in-the-configuration-phase/15973>\
**Category:** Help/Discuss\
**Created:** [April 5, 2016, 1:45pm UTC](https://discuss.gradle.org/t/using-command-line-properties-in-the-configuration-phase/15973 "2016-04-05T13:45:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eric\_Francis](https://avatars.discourse-cdn.com/v4/letter/e/edb3f5/32.png) [@Eric\_Francis](https://discuss.gradle.org/u/Eric_Francis)\
**Post date:** [April 5, 2016, 1:45pm UTC](https://discuss.gradle.org/t/using-command-line-properties-in-the-configuration-phase/15973/1 "2016-04-05T13:45:31Z")

</div>

I’m trying to do `./gradlew myTask -PmyProp=foo`

I want to access `$myProp` inside of a `copy` task. Is there a way to do this?

```
task myTask(type: Copy) {
  from: "${myProp}/"
  into: "${myProp}/bar"
}

```

Please link to the relevant document is this problem has already been solved.

---

<div class="post-metadata">

**Author:** ![Lance\_Java](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/lance_java/32/787_2.png) [@Lance\_Java](https://discuss.gradle.org/u/Lance_Java)\
**Post date:** [April 5, 2016, 1:58pm UTC](https://discuss.gradle.org/t/using-command-line-properties-in-the-configuration-phase/15973/2 "2016-04-05T13:58:14Z")

</div>

There’s a few options:

- `${myProp}`
- `${properties.myProp}`
- `${project.properties.myProp}`
- `${gradle.startParameter.projectProperties.myProp}`
- `${project.gradle.startParameter.projectProperties.myProp}`
