这是我在 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>
不确定我在第一个配置中做错了什么。