# How to construct gradle wrapper in diff folder

**URL:** <https://discuss.gradle.org/t/how-to-construct-gradle-wrapper-in-diff-folder/23237>\
**Category:** Help/Discuss\
**Created:** [July 9, 2017, 5:35am UTC](https://discuss.gradle.org/t/how-to-construct-gradle-wrapper-in-diff-folder/23237 "2017-07-09T05:35:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jnorthr](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/jnorthr/32/139_2.png) [@jnorthr](https://discuss.gradle.org/u/jnorthr)\
**Post date:** [July 9, 2017, 5:35am UTC](https://discuss.gradle.org/t/how-to-construct-gradle-wrapper-in-diff-folder/23237/1 "2017-07-09T05:35:36Z")

</div>

So we can  
Cd **newstuff**  
Into a folder that already has gradle wrapper.  
But i need to ship copy of wrapper/new wrapper in folder above **newstuff**  
So i really want to  
**Gradlew wrapper …/**  
Ideas pls 🙂️

---

<div class="post-metadata">

**Author:** ![jjustinic](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/jjustinic/32/9005_2.png) [@jjustinic](https://discuss.gradle.org/u/jjustinic)\
**Post date:** [July 9, 2017, 11:51pm UTC](https://discuss.gradle.org/t/how-to-construct-gradle-wrapper-in-diff-folder/23237/2 "2017-07-09T23:51:16Z")

</div>

The default `wrapper` task creates the wrapper in the project directory. However, there’s nothing that forces the location of the wrapper to be the project directory with the default task, or you can configure your own.

Don’t cd into newstuff, just use the `gradlew` in newstuff:

```bash
newstuff/gradlew wrapper

```

Or cd into newstuff, but explicitly set the project directory:

```bash
./gradlew wrapper -p ../

```

Or configure your own wrapper task with the parent directory instead of the project directory in the newstuff project:

```groovy
task wrapper(type: Wrapper) {
    jarFile = "${projectDir.getParent()}/gradle/wrapper/gradle-wrapper.jar"
    scriptFile = "${projectDir.getParent()}/gradlew"
}

```
