Skip to content

Instantly share code, notes, and snippets.

@seratch
Last active April 18, 2020 01:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seratch/20556d2b586a399d5ed607ed4c7b720b to your computer and use it in GitHub Desktop.
Save seratch/20556d2b586a399d5ed607ed4c7b720b to your computer and use it in GitHub Desktop.
How to run Bolt app with Quarkus - remove quarkus-universe-bom
quarkus.http.port=3000
quarkus.log.level=INFO
quarkus.log.category."com.slack.api".level=DEBUG
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'
}
<?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>
pluginManagement {
repositories {
mavenLocal()
mavenCentral()
gradlePluginPortal()
}
plugins {
id 'io.quarkus' version "1.3.2.Final"
}
}
rootProject.name='code-with-quarkus'
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