2016-11-11 89 views
1

我按照此文檔將mule應用程序部署到cloudhub - >https://docs.mulesoft.com/mule-user-guide/v/3.8/mule-maven-plugin將Maven腳本部署到cloudhub

當我運行「命令mvn軟件包部署」,我得到這個錯誤如下:

[錯誤]未能執行目標org.apache.maven.plugins:行家 - 部署 - 插件:2.8.2:部署失敗:存儲庫元素未在POM裏面的distributionManagement元素中或在-DaltDeploymentRepository = id :: layout :: url參數中指定 - > [Help 1]

pom .xml

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

<properties> 
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> 
    <mule.version>3.8.1</mule.version> 
    <mule.tools.version>1.2</mule.tools.version> 
    <munit.version>1.2.1</munit.version> 
    <mule.munit.support.version>3.8.0</mule.munit.support.version> 
    <!-- This is the domain where the app will be 
    deployed: i.e. mydomain.cloudhub.io --> 
    <cloudhub.domain>mydomain</cloudhub.domain> 
</properties> 

<build> 
    <plugins> 
    <plugin> 
     <groupId>org.mule.tools.maven</groupId> 
     <artifactId>mule-maven-plugin</artifactId> 
     <version>2.1.1</version> 
     <!-- <configuration> 
      <deploymentType>standalone</deploymentType> 
      <muleVersion>${mule.version}</muleVersion> 
     </configuration> --> 
     <configuration> 
      <deploymentType>cloudhub</deploymentType> 
      <muleVersion>3.8.2</muleVersion> 
      <username>username</username> 
      <password>mypassword</password> 
      <applicationName>myapplication-maven-1.0</applicationName> 
      <!-- <businessGroup>engineering\devops</businessGroup> --> 
      <target>CloudHub</target> 
      <!-- One of: server, serverGroup, cluster --> 
      <domain>${cloudhub.domain}</domain> 
      <targetType>server</targetType> 
      <environment>DEVELOPMENT</environment> 
     </configuration> 
     <executions> 
      <execution> 
       <id>deploy</id> 
       <phase>deploy</phase> 
       <goals> 
        <goal>deploy</goal> 
       </goals> 
      </execution> 
     </executions> 
    </plugin> 
     <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> 
      <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> 
         <resource> 
           <directory>src/main/api/</directory> 
          </resource> 
         </resources> 
        </configuration> 
       </execution> 
      </executions> 
     </plugin> 
    <!-- <plugin> 
      <groupId>com.mulesoft.munit.tools</groupId> 
      <artifactId>munit-maven-plugin</artifactId> 
      <version>${munit.version}</version> 
      <executions> 
       <execution> 
        <id>test</id> 
        <phase>test</phase> 
        <goals> 
         <goal>test</goal> 
        </goals> 
       </execution> 
      </executions> 
      <configuration> 
       <coverage> 
        <runCoverage>true</runCoverage> 
        <formats> 
         <format>html</format> 
        </formats> 
       </coverage> 
      </configuration> 
     </plugin> --> 
    </plugins> 
    <testResources> 
     <testResource> 
      <directory>src/test/munit</directory> 
     </testResource> 
    <testResource> 
      <directory>src/test/resources</directory> 
     </testResource> 
    </testResources> 
</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> --> 
<dependency> 
     <groupId>org.mule.modules</groupId> 
     <artifactId>mule-module-apikit</artifactId> 
     <version>${mule.version}</version> 
     <scope>provided</scope> 
    </dependency> 
<!-- <dependency> 
     <groupId>com.mulesoft.munit</groupId> 
     <artifactId>mule-munit-support</artifactId> 
     <version>${mule.munit.support.version}</version> 
     <scope>test</scope> 
    </dependency> --> 
<!-- <dependency> 
     <groupId>com.mulesoft.munit</groupId> 
     <artifactId>munit-runner</artifactId> 
     <version>${munit.version}</version> 
     <scope>test</scope> 
    </dependency> --> 
<!-- <dependency> 
    <groupId>org.mule.modules</groupId> 
    <artifactId>mule-module-objectstore</artifactId> 
    <version>${mule.version}</version> 
</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> 

我也看到了這樣的警告:

[INFO] ---騾子-APP-Maven的插件:1.2:安裝(默認安裝)@ MyApplication的---沒有設定[警告] MULE_HOME,不復制所有MyApplication -1.0.0-SNAPSHOT.zip

請讓我知道如何解決這個錯誤。

感謝

回答

1

按照plugin documentation

This will also trigger the default deploy goal of the maven-deploy-plugin. If you are not deploying to a Maven repository as part of your build, you can prevent the plugin execution by using:

<plugin> 
    <groupId>org.apache.maven.plugins</groupId> 
    <artifactId>maven-deploy-plugin</artifactId> 
    <configuration> 
    <skip>true</skip> 
    </configuration> 
</plugin> 

關於其他的消息,那就是mule-app-maven-plugin一項功能,可以讓你在生成的構件複製到本地服務器騾子。如果您使用mule-maven-plugin來部署您的應用程序,則不必擔心這一點。

+0

太完美了! – Gana