-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 595fb21
Showing
9 changed files
with
191 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://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>com.smilecoms.sales</groupId> | ||
<artifactId>credit-purchase</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
<packaging>war</packaging> | ||
<properties> | ||
<maven.compiler.target>1.8</maven.compiler.target> | ||
<version.wildfly>23.0.0.Final</version.wildfly> | ||
<failOnMissingWebXml>false</failOnMissingWebXml> | ||
<maven.compiler.source>1.8</maven.compiler.source> | ||
<final.name>credit-purchase</final.name> | ||
</properties> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.eclipse.microprofile</groupId> | ||
<artifactId>microprofile</artifactId> | ||
<version>4.0.1</version> | ||
<type>pom</type> | ||
<scope>provided</scope> | ||
</dependency> | ||
</dependencies> | ||
<build> | ||
<finalName>credit-purchase</finalName> | ||
</build> | ||
<profiles> | ||
<profile> | ||
<id>wildfly</id> | ||
<activation> | ||
<activeByDefault>true</activeByDefault> | ||
</activation> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.wildfly.plugins</groupId> | ||
<artifactId>wildfly-jar-maven-plugin</artifactId> | ||
<version>1.0.0.Alpha4</version> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>package</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
<configuration> | ||
<feature-pack-location>wildfly@maven(org.jboss.universe:community-universe)#${version.wildfly}</feature-pack-location> | ||
<layers> | ||
<layer>jaxrs</layer> | ||
</layers> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.jboss.spec.javax.ws.rs</groupId> | ||
<artifactId>jboss-jaxrs-api_2.0_spec</artifactId> | ||
<version>1.0.1.Final</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
</dependencies> | ||
<repositories> | ||
<repository> | ||
<id>jboss-public-repository</id> | ||
<name>JBoss Public Maven Repository Group</name> | ||
<url>https://repository.jboss.org/nexus/content/groups/public/</url> | ||
</repository> | ||
<repository> | ||
<id>Red Hat GA</id> | ||
<name>Red Hat GA</name> | ||
<url>https://maven.repository.redhat.com/ga/</url> | ||
</repository> | ||
</repositories> | ||
</profile> | ||
</profiles> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# MicroProfile generated Application | ||
|
||
## Introduction | ||
|
||
MicroProfile Starter has generated this MicroProfile application for you. | ||
|
||
The generation of the executable jar file can be performed by issuing the following command | ||
|
||
mvn clean package | ||
|
||
This will create an executable jar file **credit-purchase-wildfly.jar** within the _target_ maven folder. This can be started by executing the following command | ||
|
||
java -jar target/credit-purchase-wildfly.jar | ||
|
||
|
||
|
||
To launch the test page, open your browser at the following URL | ||
|
||
http://localhost:8080/index.html | ||
|
||
|
||
|
||
## Specification examples | ||
|
||
By default, there is always the creation of a JAX-RS application class to define the path on which the JAX-RS endpoints are available. | ||
|
||
Also, a simple Hello world endpoint is created, have a look at the class **HelloController**. | ||
|
||
More information on MicroProfile can be found [here](https://microprofile.io/) | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
11 changes: 11 additions & 0 deletions
11
src/main/java/com/smilecoms/sales/credit/purchase/CreditpurchaseRestApplication.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.smilecoms.sales.credit.purchase; | ||
|
||
import javax.ws.rs.ApplicationPath; | ||
import javax.ws.rs.core.Application; | ||
|
||
/** | ||
* | ||
*/ | ||
@ApplicationPath("/data") | ||
public class CreditpurchaseRestApplication extends Application { | ||
} |
18 changes: 18 additions & 0 deletions
18
src/main/java/com/smilecoms/sales/credit/purchase/HelloController.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.smilecoms.sales.credit.purchase; | ||
|
||
import javax.inject.Singleton; | ||
import javax.ws.rs.GET; | ||
import javax.ws.rs.Path; | ||
|
||
/** | ||
* | ||
*/ | ||
@Path("/hello") | ||
@Singleton | ||
public class HelloController { | ||
|
||
@GET | ||
public String sayHello() { | ||
return "Hello World"; | ||
} | ||
} |
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd" | ||
bean-discovery-mode="all"> | ||
</beans> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Eclipse MicroProfile demo</title> | ||
</head> | ||
<body> | ||
|
||
<h2>MicroProfile</h2> | ||
|
||
<a href="data/hello" target="_blank" >Hello JAX-RS endpoint</a> <br/> | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
</body> | ||
</html> |