Last active
April 18, 2020 01:17
-
-
Save seratch/20556d2b586a399d5ed607ed4c7b720b to your computer and use it in GitHub Desktop.
How to run Bolt app with Quarkus - remove quarkus-universe-bom
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
quarkus.http.port=3000 | |
quarkus.log.level=INFO | |
quarkus.log.category."com.slack.api".level=DEBUG |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plugins { | |
id 'java' | |
id 'io.quarkus' | |
} | |
repositories { | |
mavenLocal() | |
mavenCentral() | |
} | |
dependencies { | |
implementation 'io.quarkus:quarkus-undertow:1.3.2.Final' | |
implementation 'com.slack.api:bolt-servlet:1.0.6' | |
} | |
group 'org.acme' | |
version '1.0.0-SNAPSHOT' | |
compileJava { | |
options.encoding = 'UTF-8' | |
} | |
compileTestJava { | |
options.encoding = 'UTF-8' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" | |
xmlns="http://maven.apache.org/POM/4.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>org.acme</groupId> | |
<artifactId>code-with-quarkus</artifactId> | |
<version>1.0.0-SNAPSHOT</version> | |
<properties> | |
<compiler-plugin.version>3.8.1</compiler-plugin.version> | |
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | |
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> | |
<quarkus-plugin.version>1.3.2.Final</quarkus-plugin.version> | |
<quarkus.platform.version>1.3.2.Final</quarkus.platform.version> | |
</properties> | |
<dependencies> | |
<dependency> | |
<groupId>io.quarkus</groupId> | |
<artifactId>quarkus-undertow</artifactId> | |
<version>${quarkus.platform.version}</version> | |
</dependency> | |
<dependency> | |
<groupId>com.slack.api</groupId> | |
<artifactId>bolt-servlet</artifactId> | |
<version>1.0.6</version> | |
</dependency> | |
</dependencies> | |
<build> | |
<plugins> | |
<plugin> | |
<groupId>io.quarkus</groupId> | |
<artifactId>quarkus-maven-plugin</artifactId> | |
<version>${quarkus-plugin.version}</version> | |
<executions> | |
<execution> | |
<goals> | |
<goal>build</goal> | |
</goals> | |
</execution> | |
</executions> | |
</plugin> | |
<plugin> | |
<artifactId>maven-compiler-plugin</artifactId> | |
<version>${compiler-plugin.version}</version> | |
</plugin> | |
</plugins> | |
</build> | |
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pluginManagement { | |
repositories { | |
mavenLocal() | |
mavenCentral() | |
gradlePluginPortal() | |
} | |
plugins { | |
id 'io.quarkus' version "1.3.2.Final" | |
} | |
} | |
rootProject.name='code-with-quarkus' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package hello; | |
import com.slack.api.bolt.App; | |
import com.slack.api.bolt.servlet.SlackAppServlet; | |
import javax.servlet.annotation.WebServlet; | |
import java.io.IOException; | |
@WebServlet("/slack/events") | |
public class SlackApp extends SlackAppServlet { | |
private static final long serialVersionUID = 1L; | |
public SlackApp() throws IOException { super(initSlackApp()); } | |
public SlackApp(App app) { super(app); } | |
private static App initSlackApp() throws IOException { | |
App app = new App(); | |
app.command("/hello", (req, ctx) -> { | |
ctx.respond("respond also works"); | |
return ctx.ack("What's up?"); | |
}); | |
return app; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment