此内容没有您所选择的语言版本。

7.2. Deploy a WAR file for SwitchYard


To prepare a WAR file for deployment to SwitchYard, the SwitchYard component dependencies (switchyard-*.jar) must be excluded as they are provided by the Fuse Service Works container. There are two methods of excluding the SwitchYard dependencies:
  1. Mark the SwitchYard dependencies as provided.
    To do this, edit the pom.xml file for the WAR file. Mark the switchyard-*.jar dependiencies as provided.
    <dependency>
      <groupId>org.switchyard</groupId>
      <artifactId>switchyard-api</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.switchyard.components</groupId>
      <artifactId>switchyard-component-bean</artifactId>
      <scope>provided</scope>
    </dependency>
    ...
    Copy to Clipboard Toggle word wrap
    Next, configure switchyard-plugin in the pom.xml file:
    <plugin>
      <groupId>org.switchyard</groupId>
      <artifactId>switchyard-plugin</artifactId>
      <configuration>
        ...
        <!-- Output to war directory -->
        <outputFile>${project.build.directory}/${project.build.finalName}/WEB-INF/switchyard.xml</outputFile>
      </configuration>
      <executions>
        <execution>
          <goals>
            <goal>configure</goal>
          </goals>
        </execution>
      </executions>
    </plugin>
    Copy to Clipboard Toggle word wrap
  2. Configure the Maven WAR plugin to exclude SwitchYard dependencies
    An alternative to marking the SwitchYard dependencies as provided, is to use the Maven WAR plugin to exclude SwitchYard dependencies. Edit the pom.xml file to include the following entry:
    <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>
    Copy to Clipboard Toggle word wrap
Note
The preferred method is option 1, Mark the SwitchYard dependencies as provided.
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat