2016-05-02 20 views
0

私はmule 3.7.3とjava8でEclipse Marsを使用しています。サンプルのミュールフローを作成し、それをtomcatにデプロイするためのwarファイルが必要です。 は、これは私がMavenのビルド後のwarファイルを得ることができるように私は私のpom.xmlに行う必要がありますどのような変更私のpom.xmltomcatのmule mavenアプリケーション

<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 

<modelVersion>4.0.0</modelVersion> 
<groupId>com.zz</groupId> 
<artifactId>sample</artifactId> 
<version>1.0.0-SNAPSHOT</version> 
<packaging>mule</packaging> 
<name>Mule sample Application</name> 

<properties> 
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> 

    <mule.version>3.7.3</mule.version> 
    <mule.tools.version>1.1</mule.tools.version> 
</properties> 

<build> 
    <plugins> 
     <plugin> 
      <groupId>org.mule.tools.maven</groupId> 
      <artifactId>mule-app-maven-plugin</artifactId> 
      <version>${mule.tools.version}</version> 
      <extensions>true</extensions> 
      <configuration> 
       <copyToAppsDirectory>true</copyToAppsDirectory> 
      </configuration> 
     </plugin> 
     <plugin> 
      <artifactId>maven-assembly-plugin</artifactId> 
      <version>2.2.1</version> 
      <configuration> 
       <descriptorRefs> 
        <descriptorRef>project</descriptorRef> 
       </descriptorRefs> 
      </configuration> 
     </plugin> 
     <plugin> 
      <groupId>org.codehaus.mojo</groupId> 
      <artifactId>build-helper-maven-plugin</artifactId> 
      <version>1.7</version> 
      <executions> 
       <execution> 
        <id>add-resource</id> 
        <phase>generate-resources</phase> 
        <goals> 
         <goal>add-resource</goal> 
        </goals> 
        <configuration> 
         <resources> 
          <resource> 
           <directory>src/main/app/</directory> 
          </resource> 
          <resource> 
           <directory>mappings/</directory> 
          </resource> 
         </resources> 
        </configuration> 
       </execution> 
      </executions> 
     </plugin> 
    </plugins> 
</build> 

<!-- Mule Dependencies --> 
<dependencies> 
    <!-- Xml configuration --> 
    <dependency> 
     <groupId>com.mulesoft.muleesb</groupId> 
     <artifactId>mule-core-ee</artifactId> 
     <version>${mule.version}</version> 
     <scope>provided</scope> 
    </dependency> 
    <!-- Xml configuration --> 
    <dependency> 
     <groupId>com.mulesoft.muleesb.modules</groupId> 
     <artifactId>mule-module-spring-config-ee</artifactId> 
     <version>${mule.version}</version> 
     <scope>provided</scope> 
    </dependency> 
    <!-- Mule Transports --> 
    <dependency> 
     <groupId>org.mule.transports</groupId> 
     <artifactId>mule-transport-file</artifactId> 
     <version>${mule.version}</version> 
     <scope>provided</scope> 
    </dependency> 
    <dependency> 
     <groupId>org.mule.transports</groupId> 
     <artifactId>mule-transport-http</artifactId> 
     <version>${mule.version}</version> 
     <scope>provided</scope> 
    </dependency> 
    <dependency> 
     <groupId>com.mulesoft.muleesb.transports</groupId> 
     <artifactId>mule-transport-jdbc-ee</artifactId> 
     <version>${mule.version}</version> 
     <scope>provided</scope> 
    </dependency> 
    <dependency> 
     <groupId>com.mulesoft.muleesb.transports</groupId> 
     <artifactId>mule-transport-jms-ee</artifactId> 
     <version>${mule.version}</version> 
     <scope>provided</scope> 
    </dependency> 
    <dependency> 
     <groupId>org.mule.transports</groupId> 
     <artifactId>mule-transport-vm</artifactId> 
     <version>${mule.version}</version> 
     <scope>provided</scope> 
    </dependency> 
    <!-- Mule Modules --> 
    <dependency> 
     <groupId>org.mule.modules</groupId> 
     <artifactId>mule-module-scripting</artifactId> 
     <version>${mule.version}</version> 
     <scope>provided</scope> 
    </dependency> 
    <dependency> 
     <groupId>org.mule.modules</groupId> 
     <artifactId>mule-module-xml</artifactId> 
     <version>${mule.version}</version> 
     <scope>provided</scope> 
    </dependency> 
    <!-- for testing --> 
    <dependency> 
     <groupId>org.mule.tests</groupId> 
     <artifactId>mule-tests-functional</artifactId> 
     <version>${mule.version}</version> 
     <scope>test</scope> 
    </dependency> 
</dependencies> 

<repositories> 
     <repository> 
     <id>Central</id> 
     <name>Central</name> 
     <url>http://repo1.maven.org/maven2/</url> 
     <layout>default</layout> 
    </repository> 
    <repository> 
     <id>mulesoft-releases</id> 
     <name>MuleSoft Releases Repository</name> 
     <url>http://repository.mulesoft.org/releases/</url> 
     <layout>default</layout> 
    </repository> 
</repositories> 
<pluginRepositories> 
    <pluginRepository> 
     <id>mulesoft-release</id> 
     <name>mulesoft release repository</name> 
     <layout>default</layout> 
     <url>http://repository.mulesoft.org/releases/</url> 
     <snapshots> 
      <enabled>false</enabled> 
     </snapshots> 
    </pluginRepository> 
</pluginRepositories> 

これは私のフローXML

<?xml version="1.0" encoding="UTF-8"?> 
<mule xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" 
    xmlns:spring="http://www.springframework.org/schema/beans" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd 
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd 
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd"> 
    <http:listener-config name="HTTP_Listener_Configuration" host="0.0.0.0" port="8081" doc:name="HTTP Listener Configuration"/> 
    <flow name="sampleFlow"> 
     <http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/> 
     <set-payload doc:name="Set Payload" value="HELLO SAMPLE"/> 
    </flow> 
</mule> 

です?

答えて

0

これは重複した質問だと思います。あなたはこの1を参照することができます。

Mule application into a deployable WAR

あなたがTomcatのと同じ手順を行うことができます。戦争が発生したら、それを展開することができます。

これが役に立ちます。

+0

既にチェックされています。しかし、それは私のために働いていない。 –

関連する問題