How to specify gradle build execution order
<p>My project structure is :</p>

<pre><code>--Root project
  -- child 1
  * build.gradle
  * settings.gradle
  -- child 2
  * build.gradle
  * settings.gradle
  -- child 3
  * build.gradle
  * settings.gradle
</code></pre>

<p>Child 1 is dependent on jar file of child 2. Following is my build.gradle</p>

<pre><code>group = 'com.test.test'
description = """project1"""
dependencies{
compile project(':project2')
}
</code></pre>

<p>Settings.gradle</p>

<pre><code>rootProject.name = 'project1'
include ":Project2"
project(":Project2").projectDir = file("../Project2")
</code></pre>

<p>Is there any possibility in gradle to mention that project 2 should be executed before project1 and i can access project 2's dependency using something like </p>

<pre><code>compile group: 'com.test.test', name: 'project2', version:'1.0'
</code></pre>

<p>Note: I am using Maven plugin in my gradle file. So I hope the dependency of project 2 will be updated in .m2 folder and can be accessed by project 1</p>