How to add dependency JAR in java azure functions

后端 未结 2 2057
Happy的楠姐
Happy的楠姐 2020-12-20 17:52

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

2条回答
  •  忘掉有多难
    2020-12-20 18:24

    The latest version of pom.xml generated by the azure-functions-archetype that you use to prepare the Azure Function project (see this link for more details) seems to already include the plugin to copy dependencies.

    My pom.xml includes the following plugin by default, and it seems to copy the dependencies that I have specified into the ${stagingDirectory}/lib automatically.

    
        org.apache.maven.plugins
        maven-dependency-plugin
        
            
                copy-dependencies
                prepare-package
                
                    copy-dependencies
                
                
                    ${stagingDirectory}/lib
                    false
                    false
                    true
                    runtime
                    azure-functions-java-library
                
            
        
    
    

提交回复
热议问题