title: How to add dependency JAR in java azure functions
body: <p>Is there a way to add third party jars  to Azure functions using JAVA. I would need to have the json-simple jar and jackson-databind jars to be available for the function at run time. Right now, My code throws a runtime exception(ClassNotFound Exception) as the function is not able to reference the jar during runtime because it is unavailable.</p>
  
  <p>I tried using maven-shade-plugin. It does create an executable jar including the external jars but the deployment still takes the original jar.</p>
  
  <p>Please suggest.</p>
  
  <p>Thanks.</p>
  
  <p>POM.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project xmlns="http://maven.apache.org/POM/4.0.0"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
      &lt;groupId&gt;com.sce.api.learning&lt;/groupId&gt;
      &lt;artifactId&gt;myApi&lt;/artifactId&gt;
      &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
      &lt;packaging&gt;jar&lt;/packaging&gt;
  
      &lt;name&gt;Azure Java Functions&lt;/name&gt;
  
      &lt;properties&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
          &lt;maven.compiler.source&gt;1.8&lt;/maven.compiler.source&gt;
          &lt;maven.compiler.target&gt;1.8&lt;/maven.compiler.target&gt;
          &lt;functionAppName&gt;mckapi-http-nov2&lt;/functionAppName&gt;
      &lt;/properties&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.microsoft.azure&lt;/groupId&gt;
              &lt;artifactId&gt;azure-functions-java-core&lt;/artifactId&gt;
              &lt;version&gt;1.0.0-beta-1&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Adding GSON dependancy --&gt;
          &lt;dependency&gt;
      &lt;groupId&gt;com.google.code.gson&lt;/groupId&gt;
      &lt;artifactId&gt;gson&lt;/artifactId&gt;
      &lt;version&gt;1.4&lt;/version&gt;
  &lt;/dependency&gt;
  
  &lt;dependency&gt;
      &lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt;
      &lt;artifactId&gt;jackson-databind&lt;/artifactId&gt;
      &lt;version&gt;2.6.3&lt;/version&gt;
  &lt;/dependency&gt;
  
  &lt;dependency&gt;
      &lt;groupId&gt;com.googlecode.json-simple&lt;/groupId&gt;
      &lt;artifactId&gt;json-simple&lt;/artifactId&gt;
      &lt;version&gt;1.1.1&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.json&lt;/groupId&gt;
      &lt;artifactId&gt;json&lt;/artifactId&gt;
      &lt;version&gt;20171018&lt;/version&gt;
  &lt;/dependency&gt;
  
          &lt;!-- Test --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;junit&lt;/groupId&gt;
              &lt;artifactId&gt;junit&lt;/artifactId&gt;
              &lt;version&gt;4.12&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  
      &lt;build&gt;
          &lt;pluginManagement&gt;
              &lt;plugins&gt;
                  &lt;plugin&gt;
                      &lt;artifactId&gt;maven-resources-plugin&lt;/artifactId&gt;
                      &lt;version&gt;3.0.2&lt;/version&gt;
                  &lt;/plugin&gt;
                  &lt;plugin&gt;
                      &lt;groupId&gt;com.microsoft.azure&lt;/groupId&gt;
                      &lt;artifactId&gt;azure-functions-maven-plugin&lt;/artifactId&gt;
                      &lt;version&gt;0.1.4&lt;/version&gt;
                  &lt;/plugin&gt;
              &lt;/plugins&gt;
          &lt;/pluginManagement&gt;
  
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;com.microsoft.azure&lt;/groupId&gt;
                  &lt;artifactId&gt;azure-functions-maven-plugin&lt;/artifactId&gt;
                  &lt;configuration&gt;
                      &lt;resourceGroup&gt;java-functions-group&lt;/resourceGroup&gt;
                      &lt;appName&gt;${functionAppName}&lt;/appName&gt;
                      &lt;region&gt;westus2&lt;/region&gt;
                      &lt;appSettings&gt;
                          &lt;property&gt;
                              &lt;name&gt;FUNCTIONS_EXTENSION_VERSION&lt;/name&gt;
                              &lt;value&gt;beta&lt;/value&gt;
                          &lt;/property&gt;
                      &lt;/appSettings&gt;
                  &lt;/configuration&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;id&gt;package-functions&lt;/id&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;package&lt;/goal&gt;
                          &lt;/goals&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;artifactId&gt;maven-resources-plugin&lt;/artifactId&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;id&gt;copy-resources&lt;/id&gt;
                          &lt;phase&gt;package&lt;/phase&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;copy-resources&lt;/goal&gt;
                          &lt;/goals&gt;
                          &lt;configuration&gt;
                              &lt;overwrite&gt;true&lt;/overwrite&gt;
                              &lt;outputDirectory&gt;${project.build.directory}/azure-functions/${functionAppName}
                              &lt;/outputDirectory&gt;
                              &lt;resources&gt;
                                  &lt;resource&gt;
                                      &lt;directory&gt;${project.basedir}&lt;/directory&gt;
                                      &lt;includes&gt;
                                          &lt;include&gt;host.json&lt;/include&gt;
                                          &lt;include&gt;local.settings.json&lt;/include&gt;
                                          **&lt;include&gt;**/*.jar&lt;/include&gt;**&lt;!-- This includes the jar files in the target/lib folder --&gt;
                                      &lt;/includes&gt;
                                  &lt;/resource&gt;
                              &lt;/resources&gt;
                          &lt;/configuration&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
              &lt;/plugin&gt;
  
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-shade-plugin&lt;/artifactId&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;phase&gt;package&lt;/phase&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;shade&lt;/goal&gt;
                          &lt;/goals&gt;
                          &lt;configuration&gt;
                          &lt;overwrite&gt;true&lt;/overwrite&gt;
                              &lt;outputDirectory&gt;${project.build.directory}/azure-functions/${functionAppName}
                              &lt;/outputDirectory&gt;
                &lt;shadedArtifactAttached&gt;false&lt;/shadedArtifactAttached&gt;
              &lt;/configuration&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
                  &lt;configuration&gt;
                      &lt;finalName&gt;${artifactId}-${version}&lt;/finalName&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
  
          &lt;/plugins&gt;
  
      &lt;/build&gt;
  
  &lt;/project&gt;
  </code></pre>