Skip to content

Commit 698bcbf

Browse files
authoredJun 26, 2018
Added Docs
1 parent d799a7d commit 698bcbf

File tree

1 file changed

+61
-2
lines changed

1 file changed

+61
-2
lines changed
 
+61-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,61 @@
1-
# microservice-starter-wildflyswarm
2-
Microservice Starter project based on Wildfly Swarm
1+
2+
# Microservice Starter based on Wildfly Swarm
3+
4+
Wildfly Swarm is lightweight container for deploying apps and services using various JEE specification. It supports full project lifecycle using its own maven dependency management and build plugin.
5+
6+
7+
### Packaging
8+
9+
Wildfly Swarm provides its own maven support to package the code and it's all dependency as Uber jar including the container itself. For this, you need to add following build plugin.
10+
11+
```
12+
<build>
13+
<plugins>
14+
<plugin>
15+
<groupId>org.wildfly.swarm</groupId>
16+
<artifactId>wildfly-swarm-plugin</artifactId>
17+
<version>2018.3.3</version>
18+
<executions>
19+
<execution>
20+
<goals><goal>package</goal></goals>
21+
</execution>
22+
</executions>
23+
</plugin>
24+
</plugins>
25+
</build>
26+
```
27+
28+
### Deployment
29+
30+
Wildfly Swarm is an embeddable container that provide support for multiple deployment options. It can deploy Web, JAXRS and EJB containers. You can add specific fraction for deploying only required container.
31+
32+
```
33+
<dependency>
34+
<groupId>org.wildfly.swarm</groupId>
35+
<artifactId>jaxrs</artifactId>
36+
<version>2018.3.3</version>
37+
</dependency>
38+
```
39+
40+
### Launcher
41+
42+
Wildfly Swarm container can be launched using standard as well customer launchers.
43+
44+
- Standard - Just run following maven goal on project.
45+
46+
```
47+
mvn wildfly-swarm:run
48+
```
49+
50+
- Custom - Add an Application class to programmatically invoke and deploy containers.
51+
52+
```
53+
Swarm swarm = new Swarm();
54+
swarm.start();
55+
56+
JAXRSArchive deployment = ShrinkWrap.create(JAXRSArchive.class);
57+
deployment.addClass(HelloWorldResource.class);
58+
swarm.deploy(deployment);
59+
60+
```
61+
Note : Here we are using [ShrinkWrap](https://developer.jboss.org/wiki/ShrinkWrap) API to programmatically create deployable archive on runtime.

0 commit comments

Comments
 (0)
Please sign in to comment.