https://thorntail.io/
https://thorntail.io/generator/
HelloWorldEndpoin.java
RestApplication
mvn install
mvn thorntail:run
Check the project
http://localhost:8080/hello
https://thorntail.io/generator/
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.dave</groupId>
<artifactId>demo-thorntail</artifactId>
<name>Thorntail Example</name>
<version>1.0.0-SNAPSHOT</version>
<packaging>war</packaging>
<properties>
<version.thorntail>2.2.0.Final</version.thorntail>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<failOnMissingWebXml>false</failOnMissingWebXml>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.thorntail</groupId>
<artifactId>bom-all</artifactId>
<version>${version.thorntail}</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<finalName>demo</finalName>
<plugins>
<plugin>
<groupId>io.thorntail</groupId>
<artifactId>thorntail-maven-plugin</artifactId>
<version>${version.thorntail}</version>
<executions>
<execution>
<goals>
<goal>package</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>io.thorntail</groupId>
<artifactId>jaxrs</artifactId>
</dependency><dependency>
<groupId>io.thorntail</groupId>
<artifactId>jpa</artifactId>
</dependency>
</dependencies>
</project>
HelloWorldEndpoin.java
package com.dave.demothorntail.rest;
import javax.ws.rs.Path;
import javax.ws.rs.core.Response;
import javax.ws.rs.GET;
import javax.ws.rs.Produces;
@Path("/hello")
public class HelloWorldEndpoint {
@GET
@Produces("text/plain")
public Response doGet() {
return Response.ok("Hello from Thorntail!").build();
}
}
RestApplication
package com.dave.demothorntail.rest;
import javax.ws.rs.ApplicationPath;
import javax.ws.rs.core.Application;
@ApplicationPath("/")
public class RestApplication extends Application {
}
mvn install
mvn thorntail:run
[INFO] Starting .war
Fri Oct 26 16:40:36 CEST 2018 INFO [org.wildfly.swarm.bootstrap] (main) Dependencies not bundled; resolving from M2REPO.
2018-10-26 16:40:42,986 INFO [org.wildfly.swarm] (main) THORN0013: Installed fraction: JAX-RS - STABLE io.thorntail:jaxrs:2.2.0.Final
2018-10-26 16:40:42,997 INFO [org.wildfly.swarm] (main) THORN0013: Installed fraction: Logging - STABLE io.thorntail:logging:2.2.0.Final
2018-10-26 16:40:42,997 INFO [org.wildfly.swarm] (main) THORN0013: Installed fraction: Undertow - STABLE io.thorntail:undertow:2.2.0.Final
2018-10-26 16:40:42,999 INFO [org.wildfly.swarm] (main) THORN0013: Installed fraction: Elytron - STABLE io.thorntail:elytron:2.2.0.Final
2018-10-26 16:40:43,000 INFO [org.wildfly.swarm] (main) THORN0013: Installed fraction: JPA - STABLE io.thorntail:jpa:2.2.0.Final
2018-10-26 16:40:43,000 INFO [org.wildfly.swarm] (main) THORN0013: Installed fraction: Datasources - STABLE io.thorntail:datasources:2.2.0.Final
2018-10-26 16:40:43,001 INFO [org.wildfly.swarm] (main) THORN0013: Installed fraction: JCA - STABLE io.thorntail:jca:2.2.0.Final
2018-10-26 16:40:43,001 INFO [org.wildfly.swarm] (main) THORN0013: Installed fraction: Transactions - STABLE io.thorntail:transactions:2.2.0.Final
2018-10-26 16:40:46,101 WARN [org.wildfly.swarm.datasources] (main) THORN1005: Not creating a default datasource due to lack of JDBC driver
2018-10-26 16:40:47,061 INFO [org.jboss.msc] (main) JBoss MSC version 1.2.7.SP1
2018-10-26 16:40:47,304 INFO [org.jboss.as] (MSC service thread 1-1) WFLYSRV0049: Thorntail 2.2.0.Final (WildFly Core 3.0.8.Final) starting
2018-10-26 16:40:47,554 INFO [org.wildfly.swarm] (MSC service thread 1-1) THORN0019: Install MSC service for command line args: []
2018-10-26 16:40:50,300 INFO [org.wildfly.security] (ServerService Thread Pool -- 12) ELY00001: WildFly Elytron version 1.1.6.Final
2018-10-26 16:40:50,374 WARN [org.jboss.as.txn] (ServerService Thread Pool -- 16) WFLYTX0013: The node-identifier attribute on the /subsystem=transactions is set to the default value. This is a danger for environments running multiple servers. Please make sure the attribute value is unique.
2018-10-26 16:40:50,375 INFO [org.jboss.as.jaxrs] (ServerService Thread Pool -- 15) WFLYRS0016: RESTEasy version 3.0.24.Final
2018-10-26 16:40:50,388 INFO [org.jboss.as.naming] (ServerService Thread Pool -- 23) WFLYNAM0001: Activating Naming Subsystem
2018-10-26 16:40:50,454 INFO [org.jboss.as.security] (ServerService Thread Pool -- 20) WFLYSEC0002: Activating Security Subsystem
2018-10-26 16:40:50,459 INFO [org.xnio] (ServerService Thread Pool -- 24) XNIO version 3.5.4.Final
2018-10-26 16:40:50,754 INFO [org.wildfly.extension.undertow] (MSC service thread 1-2) WFLYUT0003: Undertow 1.4.18.Final starting
2018-10-26 16:40:50,792 INFO [org.xnio.nio] (ServerService Thread Pool -- 24) XNIO NIO Implementation Version 3.5.4.Final
2018-10-26 16:40:50,804 INFO [org.jboss.as.security] (MSC service thread 1-2) WFLYSEC0001: Current PicketBox version=5.0.2.Final
2018-10-26 16:40:50,988 INFO [org.jboss.as.connector] (MSC service thread 1-3) WFLYJCA0009: Starting JCA Subsystem (WildFly/IronJacamar 1.4.6.Final)
2018-10-26 16:40:51,511 INFO [org.wildfly.extension.io] (ServerService Thread Pool -- 24) WFLYIO001: Worker 'default' has auto-configured to 4 core threads with 32 task threads based on your 2 available processors
2018-10-26 16:40:51,583 INFO [org.wildfly.extension.undertow] (MSC service thread 1-2) WFLYUT0012: Started server default-server.
2018-10-26 16:40:51,610 INFO [org.jboss.as.naming] (MSC service thread 1-4) WFLYNAM0003: Starting Naming Service
2018-10-26 16:40:51,691 INFO [org.wildfly.extension.undertow] (MSC service thread 1-2) WFLYUT0006: Undertow HTTP listener default listening on [0:0:0:0:0:0:0:0]:8080
2018-10-26 16:40:52,282 INFO [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0212: Resuming server
2018-10-26 16:40:52,285 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: Thorntail 2.2.0.Final (WildFly Core 3.0.8.Final) started in 5331ms - Started 143 of 161 services (32 services are lazy, passive or on-demand)
2018-10-26 16:40:52,789 INFO [org.wildfly.swarm.runtime.deployer] (main) deploying demo.war
2018-10-26 16:40:52,839 INFO [org.jboss.as.server.deployment] (MSC service thread 1-4) WFLYSRV0027: Starting deployment of "demo.war" (runtime-name: "demo.war")
2018-10-26 16:40:53,364 WARN [org.jboss.as.dependency.private] (MSC service thread 1-3) WFLYSRV0018: Deployment "deployment.demo.war" is using a private module ("org.jboss.jts") which may be changed or removed in future versions without notice.
2018-10-26 16:40:53,364 WARN [org.jboss.as.dependency.private] (MSC service thread 1-3) WFLYSRV0018: Deployment "deployment.demo.war" is using a private module ("org.jboss.ironjacamar.jdbcadapters") which may be changed or removed in future versions without notice.
2018-10-26 16:40:53,365 WARN [org.jboss.as.dependency.private] (MSC service thread 1-3) WFLYSRV0018: Deployment "deployment.demo.war" is using a private module ("org.jboss.jts") which may be changed or removed in future versions without notice.
2018-10-26 16:40:53,365 WARN [org.jboss.as.dependency.private] (MSC service thread 1-3) WFLYSRV0018: Deployment "deployment.demo.war" is using a private module ("org.jboss.ironjacamar.jdbcadapters") which may be changed or removed in future versions without notice.
2018-10-26 16:40:53,645 INFO [org.wildfly.extension.undertow] (MSC service thread 1-3) WFLYUT0018: Host default-host starting
2018-10-26 16:40:54,005 INFO [org.jboss.resteasy.resteasy_jaxrs.i18n] (ServerService Thread Pool -- 12) RESTEASY002225: Deploying javax.ws.rs.core.Application: class com.dave.demothorntail.rest.RestApplication
2018-10-26 16:40:54,036 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool -- 12) WFLYUT0021: Registered web context: '/' for server 'default-server'
2018-10-26 16:40:54,200 INFO [org.jboss.as.server] (main) WFLYSRV0010: Deployed "demo.war" (runtime-name : "demo.war")
2018-10-26 16:40:54,216 INFO [org.wildfly.swarm] (main) THORN99999: Thorntail is Ready
Check the project
http://localhost:8080/hello
No comments:
Post a Comment