title: Gradle + OSGi Liferay7 module, include transitive dependencies
body: <p>I've built a sample module with the following structure and dependencies:</p>
  
  <pre><code>osgi-lfr-module
  +--- module0
  |     \--- org.apache.commons:commons-lang3:3.5
  +--- module1
  |     \--- module0
  \--- module2
        +--- module1
        \--- org.apache.commons:commons-collections4:4.1
  </code></pre>
  
  <p>I want to build a single <code>jar</code> to deploy in Liferay 7 containing modules 0, 1 and 2 and 3rd party dependencies. I know it's not the recommended approach, but I'm would like to know how to achieve it. </p>
  
  <p><code>module2/build.gradle</code> file is:</p>
  
  <pre><code>buildscript {
      dependencies {
          classpath 'com.liferay:com.liferay.gradle.plugins:2.0.10'
      }   
  }
  
  apply plugin: "com.liferay.plugin"
  
  sourceCompatibility = "1.8"
  targetCompatibility = "1.8"
  
  dependencies {
      compile project(':module1')
  
      compile group: 'org.apache.commons', name: 'commons-collections4', version: '4.1'
  }
  </code></pre>
  
  <p>I've followed the steps from <a href="https://web.liferay.com/es/web/user.26526/blog/-/blogs/osgi-module-dependencies" rel="nofollow">OSGi Module Dependencies</a>. Up until now, I'm able to add direct dependencies in <code>module2/bnd.bnd</code>:</p>
  
  <pre><code>Bundle-Version: 1.0.0
  Export-Package: com.test.module2, com.test.module1, com.test.module0
  Bundle-ClassPath: \
      .,\
      lib/module1.jar,\
      lib/commons-collections4.jar
  -includeresource: \
      lib/module1.jar=module1-1.0.0.jar,\
      lib/commons-collections4.jar=commons-collections4-4.1.jar
  </code></pre>
  
  <p>But if I try to add transitive deps, like <code>module0</code>:</p>
  
  <pre><code>Bundle-ClassPath: \
      .,\
      lib/module0.jar,\
      lib/module1.jar,\
      lib/commons-collections4.jar
  -includeresource: \
      lib/module0.jar=module0-1.0.0.jar,\
      lib/module1.jar=module1-1.0.0.jar,\
      lib/commons-collections4.jar=commons-collections4-4.1.jar
  </code></pre>
  
  <p>Build fails with the following error:</p>
  
  <pre><code>:module2:jar
  [Input file does not exist: module0-1.0.0.jar]
  [No sub JAR or directory lib/module0.jar]
  </code></pre>
  
  <p>Can anyone help me to find out what I'm doing wrong? And, is there any way less manual to add transitive dependencies?</p>
  
  <p>Thanks in advance for your help.</p>