Skip to content
This repository has been archived by the owner on Jun 7, 2021. It is now read-only.

Commit

Permalink
Update the README to be more current.
Browse files Browse the repository at this point in the history
  • Loading branch information
bobmcwhirter committed Oct 23, 2015
1 parent e85495e commit 411c181
Showing 1 changed file with 11 additions and 76 deletions.
87 changes: 11 additions & 76 deletions README.md
@@ -1,9 +1,9 @@

# Wildfly-Swarm
# WildFly Swarm

Wildfly-Swarm aims to provide a mechanism for building
applications as *fat jars*, with just enough of the
Wildfly application server wrapped around it to support
WildFly Swarm provides a mechanism for building
applications as *uber jars*, with just enough of the
WildFly application server wrapped around it to support
each application's use-case.

> Note: WildFly Swarm requires Maven 3.1.x or higher for building your application.
Expand Down Expand Up @@ -32,7 +32,7 @@ it in the wildfly-swarm mechanisms.
If you normally produce `myapp-1.0.war`, in your `target/` directory will
then also be present a `myapp-1.0-swarm.jar`.

In order to specify the portions of the Wildfly AS your application needs,
In order to specify the portions of the WildFly AS your application needs,
your `pom.xml` should specify some of the following dependencies within
the `org.wildfly.swarm` Maven group-id:

Expand All @@ -47,6 +47,7 @@ the `org.wildfly.swarm` Maven group-id:
* transactions
* undertow
* weld
* _and many more!_

# Server Configuration

Expand All @@ -56,77 +57,6 @@ Each module above can provide a default configuration. If you are satisfied
with the default configuration, no changes to your project's source files are
required.

## Customizing

### Write your own `main()`

If the default is unsatisfactory,
you may completely control the server configuration through a `main()` method in a class
specified through your `MANIFEST.MF` inside your `.war`.

package org.mycompany.myapp;

import org.wildfly.swarm.container.Container;
import org.wildfly.swarm.container.SocketBindingGroup;
import org.wildfly.swarm.logging.LoggingFraction;
import org.wildfly.swarm.undertow.UndertowFraction;

public class MyMain {

public static void main(String[] args) {
new Container()
.subsystem( new LoggingFraction()...
)
.subsystem( new UndertowFraction()...
)
.socketBindingGroup( new SocketBindingGroup()...
)
.start();
}
}

If you wish to simply override a portion of the default configuration, any
subsystem that is involved in your application but is otherwise not explicitly
configured will inherit the defaults.

For instance, if you application uses `jaxrs`, and you simply want to override the
default logging configuration:

package org.mycompany.myapp;

import org.wildfly.swarm.container.Container;
import org.wildfly.swarm.logging.LoggingFraction;

public class MyMain {

public static void main(String[] args) {
new Container()
.subsystem( new LoggingFraction()...
)
.start();
}
}

All other subsystems do not need to be configured if the defaults are satisfactory.

### Specify the main class in your `MANIFEST.MF`

To your POM, you need to add configuration of the `maven-war-plugin` to specify
the desired `Main-Class` inside your `.war.


<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>com.mycompany.myapp.MyMain</mainClass>
</manifest>
</archive>
</configuration>
</plugin>

# Running the `-swarm.jar`

The resulting `-swarm.jar` is fully self-contained and can be executed using a
Expand All @@ -139,3 +69,8 @@ The resulting `-swarm.jar` is fully self-contained and can be executed using a

For a more complete set of documentation, go to the [WildFly Swarm User's
Guide](https://wildfly-swarm.gitbooks.io/wildfly-swarm-users-guide/).

# Community

* We hang out in `#wildfly-swarm` on irc.freenode.net.
* Logs can be found [here](http://transcripts.jboss.org/channel/irc.freenode.org/%23wildfly-swarm/)

0 comments on commit 411c181

Please sign in to comment.