如何将botbuilder-java导入现有的Spring Boot应用程序?

huangapple go评论76阅读模式
英文:

How to import botbuilder-java into existing Spring Boot application?

问题

我想使用微软推出的新的botbuilder-java SDK,该SDK允许使用Java与Microsoft Teams进行交互,尤其是与Spring Boot集成。

你可以在这里找到该SDK:botbuilder-java

我知道这是一个预览版本的库。然而,我找不到任何相应的Maven插件来进行导入。
那么,我应该如何将这个SDK导入到我的现有Spring Boot应用程序中呢?

谢谢

英文:

I would like to use the new botbuilder-java SDK from Microsoft allowing to work with Microsoft Teams with Java and more especially with Spring Boot.

The SDK can be found here: botbuilder-java

I know this is a preview library. However, I could not find any corresponding maven plugin to import.
So how should I import this SDK into my existing Spring Boot app?

Thank you

答案1

得分: 1

所以最终,我发现我们需要将这些条目添加到pom.xml文件中:

        <dependency>
            <groupId>com.microsoft.bot</groupId>
            <artifactId>bot-schema</artifactId>
            <version>[4.6.0,)</version>
        </dependency>
        <dependency>
            <groupId>com.microsoft.bot</groupId>
            <artifactId>bot-connector</artifactId>
            <version>[4.6.0,)</version>
        </dependency>
        <dependency>
            <groupId>com.microsoft.bot</groupId>
            <artifactId>bot-integration-core</artifactId>
            <version>[4.6.0,)</version>
        </dependency>
        <dependency>
            <groupId>com.microsoft.bot</groupId>
            <artifactId>bot-integration-spring</artifactId>
            <version>[4.6.0,)</version>
        </dependency>
        <dependency>
            <groupId>com.microsoft.bot</groupId>
            <artifactId>bot-builder</artifactId>
            <version>[4.6.0,)</version>
        </dependency>
        <dependency>
            <groupId>com.microsoft.bot</groupId>
            <artifactId>bot-dialogs</artifactId>
            <version>[4.6.0,)</version>
        </dependency>
        <dependency>
            <groupId>com.microsoft.bot</groupId>
            <artifactId>bot-ai-luis-v3</artifactId>
            <version>[4.6.0,)</version>
        </dependency>
        <dependency>
            <groupId>com.microsoft.bot</groupId>
            <artifactId>bot-applicationinsights</artifactId>
            <version>[4.6.0,)</version>
        </dependency>

您可能需要设置适合您需求的版本。

然后我所做的是将他们的BotController的实现复制并放置在我的项目中作为资源(即端点控制器),以便我可以更改端点名称。
您还需要从样本文件夹复制一些文件以执行您需要的任务。

英文:

So finally, I found out we need to add these entries to the pom.xml:

        &lt;dependency&gt;
            &lt;groupId&gt;com.microsoft.bot&lt;/groupId&gt;
            &lt;artifactId&gt;bot-schema&lt;/artifactId&gt;
            &lt;version&gt;[4.6.0,)&lt;/version&gt;
        &lt;/dependency&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;com.microsoft.bot&lt;/groupId&gt;
            &lt;artifactId&gt;bot-connector&lt;/artifactId&gt;
            &lt;version&gt;[4.6.0,)&lt;/version&gt;
        &lt;/dependency&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;com.microsoft.bot&lt;/groupId&gt;
            &lt;artifactId&gt;bot-integration-core&lt;/artifactId&gt;
            &lt;version&gt;[4.6.0,)&lt;/version&gt;
        &lt;/dependency&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;com.microsoft.bot&lt;/groupId&gt;
            &lt;artifactId&gt;bot-integration-spring&lt;/artifactId&gt;
            &lt;version&gt;[4.6.0,)&lt;/version&gt;
        &lt;/dependency&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;com.microsoft.bot&lt;/groupId&gt;
            &lt;artifactId&gt;bot-builder&lt;/artifactId&gt;
            &lt;version&gt;[4.6.0,)&lt;/version&gt;
        &lt;/dependency&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;com.microsoft.bot&lt;/groupId&gt;
            &lt;artifactId&gt;bot-dialogs&lt;/artifactId&gt;
            &lt;version&gt;[4.6.0,)&lt;/version&gt;
        &lt;/dependency&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;com.microsoft.bot&lt;/groupId&gt;
            &lt;artifactId&gt;bot-ai-luis-v3&lt;/artifactId&gt;
            &lt;version&gt;[4.6.0,)&lt;/version&gt;
        &lt;/dependency&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;com.microsoft.bot&lt;/groupId&gt;
            &lt;artifactId&gt;bot-applicationinsights&lt;/artifactId&gt;
            &lt;version&gt;[4.6.0,)&lt;/version&gt;
        &lt;/dependency&gt;

You may need to set the versions that suit best your needs.

Then what I did is that I copied the implementation of their BotController and put it as Resource (i.e. endpoint controller) in my project so I could change the endpoint name.
You will also need to copy some files from the samples folder to perform the tasks you need.

huangapple
  • 本文由 发表于 2020年9月9日 23:35:13
  • 转载请务必保留本文链接:https://go.coder-hub.com/63814961.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定