慧函数生成代码应用到 IDEA 遇到依赖包问题怎么办?
以“将 map 转换为 json”需求为例,在慧函数界面生成代码。

生成后的代码复制到 IDEA 中,我们可以看到复制进来有导入包报错。

首先解决 com.feisuanyz.flow 引入失败的问题,前往飞算云智官网

从开发者学院【文档中心】的 Java 全自动开发工具进入到当前页面。

在该页面查看第 7 点自定义操作指南中的 7.1 自定义函数文档。文档中有描述如何导入 com.feisuanyz.flow 依赖包的示例。


下面我们来按操作文档操作,
步骤一:进入慧函数界面,单击右上角工具,下载加载项开发包。

步骤二:将下载好的加载项开发包移动到对应的目录,并解压压缩包。


步骤三:打开编译项目的工具。

步骤四:编辑 pom 文件,添加“加载项开发包”的依赖,复制下列格式

粘贴后,根据文档中有关于 ${version}和 ${加载项开发包解压路径}解读取修改值


替换对应参数,然后刷新下 maven 就可以了加载进来,可以看见关于 com.feisuanyz.flow 就消除了。

下面我们再来引入 com.fasterxml.jackson 这个包。

点开平台找慧函数生成的代码,我们找到对应的依赖包,然后复制到 pom 文件中就可以了。



下载免费使用:http://suo.im/d6Zgf
评论