Packaging
SwitchYard supports the following packaging types for deployment:
-
JAR : the default packaging type for SY apps
-
WAR : useful when you want to include additional libraries with your application and/or you have web application resources (e.g. JSPs, JSF, etc.).
-
EAR : supports multiple application modules in a single deployment along with additional libraries.
For an example of packaging as a WAR, check out the helpdesk quickstart. Pay particular attention to the configuration of the maven-war-plugin to include the SY descriptor and exclude dependencies in the WEB-INF/lib directory which are already available in the SwitchYard runtime.
<plugin>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<packagingExcludes>
WEB-INF/lib/*.jar,
WEB-INF/classes/META-INF/switchyard.xml
</packagingExcludes>
<webResources>
<resource>
<directory>target/classes/META-INF</directory>
<targetPath>WEB-INF</targetPath>
<includes>
<include>switchyard.xml</include>
</includes>
</resource>
</webResources>
</configuration>
</plugin>
EAR deployments allow multiple SwitchYard applications to be included in a single deployable archive. Keep in mind that the SY applications included in an EAR are still considered separate applications from a lifecycle and visibility (both class loading and service) standpoint. For an example of deploying a SwitchYard application as an EAR, check out ear-deployment quickstart.