Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
tmolokomme committed Jun 11, 2021
0 parents commit 595fb21
Show file tree
Hide file tree
Showing 9 changed files with 191 additions and 0 deletions.
78 changes: 78 additions & 0 deletions pom.xml
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>
47 changes: 47 additions & 0 deletions readme.md
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/)


















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 {
}
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 added src/main/resources/.gitkeep
Empty file.
1 change: 1 addition & 0 deletions src/main/resources/META-INF/microprofile-config.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Empty file added src/main/webapp/.gitkeep
Empty file.
6 changes: 6 additions & 0 deletions src/main/webapp/WEB-INF/beans.xml
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>
30 changes: 30 additions & 0 deletions src/main/webapp/index.html
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>

0 comments on commit 595fb21

Please sign in to comment.