Customize gradle directory structure

4 06 2010

I started using gradle very recently. It is so much more easy to understand than maven. I guess I am not intelligent enough for maven. Gradle also follows a very similar directory structure to maven. But I wanted to change it as per my projects directory structure.


All I had to do was customize the sourceSets.

sourceSets {
main {
java {
srcDir 'src'
test {
java {
srcDir 'test'

I could not find this information straight away (especially the test sources location). So I am posting it here for future reference.




5 responses

24 05 2011
Jijesh Mohan

Hi Hari

It was a great help for me. I was also searching the same . Thanks..

24 05 2011

Thanks dude 🙂

3 05 2014

All fine. Except it’s wrong 😦

28 07 2014

Been a while since I wrote this up. Would be happy to update it if you could let me know what is wrong.

28 07 2014

Thanks, should be the first line of the gradle documentation 🙂

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: