Skip to content
This repository has been archived by the owner on Apr 28, 2024. It is now read-only.

Commit

Permalink
upgrading to the latest 2.0
Browse files Browse the repository at this point in the history
... replacing all the non-idiomatic examples with standard Bootique
  • Loading branch information
andrus committed Apr 28, 2024
1 parent 1e87539 commit 4469998
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 74 deletions.
17 changes: 6 additions & 11 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: verify
name: 'build test'

on: [pull_request, push]

Expand All @@ -8,19 +8,14 @@ jobs:

steps:
- name: Checkout...
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up JDK...
uses: actions/setup-java@v1
uses: actions/setup-java@v4
with:
java-version: 11

- name: Retrieve mvn repo cache...
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: maven-${{ runner.os }}-${{ hashFiles('**/pom.xml') }}
restore-keys: maven-${{ runner.os }}
distribution: 'temurin'
cache: 'maven'

- name: Build and test...
run: mvn verify
run: mvn -ntp clean verify
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Here is how to build it:

Now you can check the options available in your app:

java -jar target/bootique-undertow-demo-1.0-SNAPSHOT.jar
java -jar target/bootique-undertow-demo-2.0.jar

Option Description
------ -----------
Expand All @@ -44,7 +44,7 @@ Now you can check the options available in your app:

Run Undertow server:

java -jar target/bootique.undertow.demo-1.0-SNAPSHOT.jar
java -jar target/bootique.undertow.demo-2.0.jar

Then open [http://localhost:8080/api/](http://localhost:8080/api/) to do GET/POST requests on the server.

Expand Down
12 changes: 3 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,37 +12,31 @@

<groupId>io.bootique.undertow.demo</groupId>
<artifactId>bootique-undertow-demo</artifactId>
<version>1.0-SNAPSHOT</version>
<version>2.0</version>
<packaging>jar</packaging>

<name>Bootique + Undertow Demo</name>

<properties>
<main.class>io.bootique.undertow.demo.Application</main.class>
<main.class>io.bootique.undertow.demo.App</main.class>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.bootique.bom</groupId>
<artifactId>bootique-bom</artifactId>
<version>2.0.B1</version>
<version>2.0.1</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>io.bootique</groupId>
<artifactId>bootique</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.bootique.undertow</groupId>
<artifactId>bootique-undertow</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.bootique.logback</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
package io.bootique.undertow.demo;

import io.bootique.Bootique;
import io.bootique.di.BQModule;
import io.bootique.di.Binder;
import io.bootique.undertow.handlers.RootHandler;
import io.undertow.server.HttpHandler;

/**
* @author Ibragimov Ruslan
* Entry point of application.
*/
public class ApplicationModule implements BQModule {
public class App implements BQModule {

public static void main(String[] args) {
Bootique
.app(args)
.autoLoadModules()
.module(App.class)
.exec()
.exit();
}

@Override
public void configure(Binder binder) {

Expand Down
17 changes: 0 additions & 17 deletions src/main/java/io/bootique/undertow/demo/Application.java

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion src/test/java/io/bootique/undertow/demo/EchoHandlerIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class EchoHandlerIT {
public void testRuntime() {
testFactory
.app("--server", "--config=classpath:static.yml")
.moduleProvider(new ApplicationModuleProvider())
.module(App.class)
.run();
}

Expand Down

0 comments on commit 4469998

Please sign in to comment.