title: how to export a executable jar in gradle, and this jar can run as it include reference libraries
body: <p>how to export a executable jar in gradle, and this jar can run as it include reference libraries.</p>
  
  <p>build.gradle</p>
  
  <pre><code>apply plugin: 'java'
  
  manifest.mainAttributes("Main-Class" : "com.botwave.analysis.LogAnalyzer")
  
  repositories {
      mavenCentral()
  }
  
  dependencies {
      compile (
          'commons-codec:commons-codec:1.6',
          'commons-logging:commons-logging:1.1.1',
          'org.apache.httpcomponents:httpclient:4.2.1',
          'org.apache.httpcomponents:httpclient:4.2.1',
          'org.apache.httpcomponents:httpcore:4.2.1',
          'org.apache.httpcomponents:httpmime:4.2.1',
          'ch.qos.logback:logback-classic:1.0.6',
          'ch.qos.logback:logback-core:1.0.6',
          'org.slf4j:slf4j-api:1.6.0',
          'junit:junit:4.+'
      )
  }
  </code></pre>
  
  <p>after i run : gradle build</p>
  
  <p>it create the build folder, and i run the jar in build/libs/XXX.jar:</p>
  
  <p>java -jar build/libs/XXX.jar</p>
  
  <p>here is a execution says :</p>
  
  <pre><code>Exception in thread "main" java.lang.NoClassDefFoundError: ch/qos/logback/core/joran/spi/JoranException
  </code></pre>
  
  <p>how can i run it with the reference libraries?</p>