# Where does a properties file go?

**URL:** <https://discuss.gradle.org/t/where-does-a-properties-file-go/23798>\
**Category:** Help/Discuss\
**Created:** [August 18, 2017, 6:27pm UTC](https://discuss.gradle.org/t/where-does-a-properties-file-go/23798 "2017-08-18T18:27:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![THUFIR](https://avatars.discourse-cdn.com/v4/letter/t/ee7513/32.png) [@THUFIR](https://discuss.gradle.org/u/THUFIR)\
**Post date:** [August 18, 2017, 6:27pm UTC](https://discuss.gradle.org/t/where-does-a-properties-file-go/23798/1 "2017-08-18T18:27:47Z")

</div>

Where would I place `foo.properties` so that gradle will pick up on the file?

```
thufir@doge:~/NetBeansProjects/props_gradle$ 
thufir@doge:~/NetBeansProjects/props_gradle$ gradle init --type java-library
:wrapper
:init

BUILD SUCCESSFUL

Total time: 4.869 secs
thufir@doge:~/NetBeansProjects/props_gradle$ 
thufir@doge:~/NetBeansProjects/props_gradle$ tree
.
├── build.gradle
├── gradle
│ └── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── settings.gradle
└── src
    ├── main
    │ └── java
    │ └── Library.java
    └── test
        └── java
            └── LibraryTest.java

7 directories, 8 files
thufir@doge:~/NetBeansProjects/props_gradle$ 

```

I’d want the `properties` file to be picked so that it can be parsed, of course. Preferably in `META-INF` but not necessarily so:

> <https://stackoverflow.com/questions/45758528/how-to-load-a-properties-file-from-the-meta-inf-directory>

---

<div class="post-metadata">

**Author:** ![Schalk\_Cronje](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/schalk_cronje/32/6511_2.png) [@Schalk\_Cronje](https://discuss.gradle.org/u/Schalk_Cronje)\
**Post date:** [August 19, 2017, 1:24pm UTC](https://discuss.gradle.org/t/where-does-a-properties-file-go/23798/2 "2017-08-19T13:24:51Z")

</div>

Not sure what you’re asking.

**Do you want `foo.properties` to be bundled in your jar ?** Then place it it under `src/main/resources` or `src/main/resources/META-INF`. Anything from there will firstly be copied by the `processResources` task then later bundled by the `jar` task.

**Do you want Gradle to make use of values in `foo.properties` ?** In that case you need the [Java PropFile plugin](https://plugins.gradle.org/search?term=com.admc.javaPropFile).

---

<div class="post-metadata">

**Author:** ![THUFIR](https://avatars.discourse-cdn.com/v4/letter/t/ee7513/32.png) [@THUFIR](https://discuss.gradle.org/u/THUFIR)\
**Post date:** [August 19, 2017, 1:40pm UTC](https://discuss.gradle.org/t/where-does-a-properties-file-go/23798/3 "2017-08-19T13:40:46Z")

</div>

Thanks for confirming, appreciated.

Tangential: why doesn’t `gradle init --type java-library` create the, or some, `resources` directories?

---

<div class="post-metadata">

**Author:** ![Schalk\_Cronje](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/schalk_cronje/32/6511_2.png) [@Schalk\_Cronje](https://discuss.gradle.org/u/Schalk_Cronje)\
**Post date:** [August 19, 2017, 1:46pm UTC](https://discuss.gradle.org/t/where-does-a-properties-file-go/23798/4 "2017-08-19T13:46:14Z")

</div>

> [@THUFIR](#):
>
> Tangential: why doesn’t gradle init --type java-library create the, or some, resources directories?

I guess it is because whoever wrote the specific recipe for the Build Init plugin did not think of that. It would make for a good little PR. Code is here → [https://github.com/gradle/gradle/tree/master/subprojects/build-init/src/main/java/org/gradle/buildinit/plugins/internal](https://github.com/gradle/gradle/tree/master/subprojects/build-init/src/main/java/org/gradle/buildinit/plugins/internal)

---

<div class="post-metadata">

**Author:** ![THUFIR](https://avatars.discourse-cdn.com/v4/letter/t/ee7513/32.png) [@THUFIR](https://discuss.gradle.org/u/THUFIR)\
**Post date:** [August 20, 2017, 4:18am UTC](https://discuss.gradle.org/t/where-does-a-properties-file-go/23798/5 "2017-08-20T04:18:25Z")

</div>

heh, dude I’m just trying to make gradle do what I want. bit beyond me 🙂

thanks for the reply tho.
