Search code examples
javaspring-bootbotframework

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


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


Solution

  • So finally, I found out we need to add these entries to the 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>
    

    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.