0

这是我在 POM 中的构建细节:

<build>
   <plugins>
      <plugin>
         <groupId>org.mule.tools.maven</groupId>
         <artifactId>mule-maven-plugin</artifactId>
         <version>${mule.maven.plugin.version}</version>
         <extensions>true</extensions>
         <configuration>
            <deploymentType>${deploymentType}</deploymentType>
            <muleVersion>${muleVersion}</muleVersion>
            <redeploy>${redeploy}</redeploy>
            <businessGroup>${businessGroup}</businessGroup>
            <username>${username}</username>
            <password>${password}</password>
            <applicationName>${applicationName}</applicationName>
            <environment>${environment}</environment>
            <region>${region}</region>
            <workers>${workers}</workers>
            <workerType>${workerType}</workerType>
            <uri>${anypoint.uri}</uri>
         </configuration>
         <executions>
            <execution>
               <id>deploy</id>
               <phase>deploy</phase>
               <goals>
                  <goal>deploy</goal>
               </goals>
            </execution>
         </executions>
      </plugin>
      <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-compiler-plugin</artifactId>
         <version>3.7.0</version>
         <configuration>
            <compilerArgs>
               <args>-parameters</args>
            </compilerArgs>
         </configuration>
      </plugin>
   </plugins>
</build>

这些是我的属性:

<properties>
   <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
   <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
   <app.runtime>4.2.1</app.runtime>
   <mule.maven.plugin.version>3.2.7</mule.maven.plugin.version>
   <deploymentType>cloudhub</deploymentType>
   <muleVersion>4.2.1</muleVersion>
   <redeploy>true</redeploy>
   <businessGroup>****</businessGroup>
   <username>****</username>
   <password>****</password>
   <applicationName>****</applicationName>
   <environment>Sandbox</environment>
   <region>us-east-1</region>
   <workers>1</workers>
   <workerType>Micro</workerType>
   <anypoint.uri>https://anypoint.mulesoft.com</anypoint.uri>
</properties>

以下是我的终端命令:

mvn clean deploy -DmuleDeploy -X 我收到以下错误:

[ERROR] Failed to execute goal org.mule.tools.maven:mule-maven-plugin:3.2.7:deploy (default-deploy) on project helloworld: Deployment configuration is not valid, : No deployment configuration was defined. Aborting. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.mule.tools.maven:mule-maven-plugin:3.2.7:deploy (default-deploy) on project helloworld: Deployment configuration is not valid,

如果我使用以下配置,它会在 cloudhub 中成功部署:

<configuration>
   <cloudHubDeployment>
      <uri>${anypoint.uri}</uri>
      <muleVersion>${muleVersion}</muleVersion>
      <businessGroup>${businessGroup}</businessGroup>
      <username>${username}</username>
      <password>${password}</password>
      <applicationName>${applicationName}</applicationName>
      <environment>${environment}</environment>
      <region>${region}</region>
      <workers>${workers}</workers>
      <workerType>${workerType}</workerType>
   </cloudHubDeployment>
</configuration>

不确定我在第一个配置中做错了什么。

4

1 回答 1

0

第一个示例中的配置适用于 Mule 3.x的旧版 Mule Maven 插件( 2.2.x或更早版本)。Mule 4.x (3.3.x) 的版本始终使用第二个示例的格式。请参阅https://docs.mulesoft.com/mule-runtime/4.2/mmp-concept#deploying-to-cloudhub上的文档

Mule 3 (2.3.x) 的最新版本的 Mule Maven 插件使用与 Mule 4 版本相同的格式

总之,第一个示例已经过时并且与 Mule 4 部署不兼容。

于 2019-11-20T21:36:04.290 回答