我在Java中创建了我的第一个Azure函数,因为我需要使用特定的外部jar文件。我在VS Code工作,我在文档中找到了一个关于使用外部库的简短参考。 Third-party libraries。
但是我没有让导入工作。使用外部库或更详细的分步文档获得VS Code Java Azure Functions项目的示例会很棒。
在maven项目中,所有依赖项都由pom.xml处理。我们可以使用maven存储库来下载依赖项,也可以从本地目录添加它。以下可以安装jar到本地maven存储库。
参考文献:http://maven.apache.org/general.html#importing-jars https://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html
mvn install:install-file
-Dfile=<path-to-file>
-DgroupId=<group-id>
-DartifactId=<artifact-id>
-Dversion=<version>
-Dpackaging=<packaging>
-DgeneratePom=true
Where: <path-to-file> the path to the file to load
<group-id> the group that the file should be registered under
<artifact-id> the artifact name for the file
<version> the version of the file
<packaging> the packaging of the file e.g. jar