Modifying your archive
In our previous examples, each time we created the Swarm
instance and applied some configuration on top of it, we used the no-argument deploy
method. This method takes the archive generated by the standard Maven build and deploys it on the previously configured container. This is not the only version of the deploy
method, though. You are able to create your own archive (or archives) and deploy them to the Swarm container. How? It is possible using the ShrinkWrap
API.
The ShrinkWrap API
If you have ever worked with WildFly AS, and, especially, its testing framework Arquillian, you are probably also familiar with the ShrinkWrap
API, which is used to build application archives before they are deployed in the test environment. However, if you have never used it, don't worry—the API is very simple and straightforward.
The central class in the API is the org.jboss.shrinkwrap.api.Archive
instance. It is an abstract class that represents the archive. The concrete implementations...