You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2017/11/07 20:37:03 UTC

[GitHub] csantanapr opened a new issue #2942: Docs: Add example on how to add dependencies for Java

csantanapr opened a new issue #2942: Docs: Add example on how to add dependencies for Java
URL: https://github.com/apache/incubator-openwhisk/issues/2942
 
 
   It would be good is the Java section at least shows one way to build the jar using external dependencies.
   
   Since we all in OpenWhisk are fans of gradle ?  maybe we can do one using gradle.
   
   Here is a good example from @rabbah 
   https://github.com/rabbah/wsk-qr/blob/master/build.gradle
   ```
   
   apply plugin: 'java'
   
   version = '1.0'
   
   repositories {
       mavenCentral()
   }
   
   configurations {
       provided
       compile.extendsFrom provided
   }
   
   dependencies {
       provided 'com.google.code.gson:gson:2.6.2'
       compile 'com.google.zxing:core:3.3.0'
       compile 'com.google.zxing:javase:3.3.0'
   }
   
   jar {
       dependsOn configurations.runtime
   
       from {
           (configurations.runtime - configurations.provided).collect {
               it.isDirectory() ? it : zipTree(it)
           }
       }
   }
   ```
   then build jar for Action
   ```
   gradle jar
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services