我试图将自定义策略部署到Exchange,但结果是:
[INFO] Scanning for projects...
[INFO]
[INFO] -----< 7de36ab5-1c25-4cd4-89e8-ec315f34b341:message-header-policy >-----
[INFO] Building message-header-policy 1.0.3
[INFO] ----------------------------[ mule-policy ]-----------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.446 s
[INFO] Finished at: 2018-10-16T15:01:04+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Could not find goal 'deploy-file' in plugin org.mule.tools.maven:mule-maven-plugin:3.1.6 among available goals clean, compile, deploy, generate-resources, generate-sources, generate-test-resources, generate-test-sources, initialize, package, process-classes, process-resources, process-sources, site, test-compile, undeploy, validate -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoNotFoundException
我的pom文件是:
http://maven.apache.org/maven-v4_0_0.xsd“> 4.0.0
<groupId>organizationid</groupId>
<artifactId>message-header-policy</artifactId>
<version>1.0.3</version>
<packaging>mule-policy</packaging>
<name>message-header-policy</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<app.runtime>4.1.3</app.runtime>
<exchange.url>https://maven.eu1.anypoint.mulesoft.com/api/v1/organizations/organizationid/maven</exchange.url>
<mule.maven.plugin.version>3.1.6</mule.maven.plugin.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.mule.tools.maven</groupId>
<artifactId>mule-maven-plugin</artifactId>
<version>${mule.maven.plugin.version}</version>
<executions>
<execution>
<id>upload-template</id>
<phase>deploy</phase>
<goals>
<goal>deploy-file</goal>
</goals>
<configuration>
<repositoryId>Repository</repositoryId>
<url>${exchange.url}</url>
<file>${project.basedir}/${project.artifactId}.yaml</file>
<generatePom>false</generatePom>
<artifactId>${project.artifactId}</artifactId>
<groupId>${project.groupId}</groupId>
<version>${project.version}</version>
<packaging>yaml</packaging>
<classifier>mule-policy</classifier>
</configuration>
</execution>
</executions>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.mule.connectors</groupId>
<artifactId>mule-http-connector</artifactId>
<version>1.3.1</version>
<classifier>mule-plugin</classifier>
</dependency>
<dependency>
<groupId>org.mule.connectors</groupId>
<artifactId>mule-sockets-connector</artifactId>
<version>1.1.1</version>
<classifier>mule-plugin</classifier>
</dependency>
<dependency>
<groupId>com.mulesoft.anypoint</groupId>
<artifactId>mule-http-policy-transform-extension</artifactId>
<version>1.1.0</version>
<classifier>mule-plugin</classifier>
</dependency>
</dependencies>
<repositories>
<repository>
<id>anypoint-exchange</id>
<name>Anypoint Exchange</name>
<url>https://maven.eu1.anypoint.mulesoft.com/api/v1/maven</url>
<layout>default</layout>
</repository>
<repository>
<id>mulesoft-releases</id>
<name>MuleSoft Releases Repository</name>
<url>https://repository.mulesoft.org/releases/</url>
<layout>default</layout>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>mulesoft-releases</id>
<name>mulesoft release repository</name>
<layout>default</layout>
<url>https://repository.mulesoft.org/releases/</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
<distributionManagement>
<repository>
<id>Repository</id>
<name>Corporate Repository</name>
<url>${exchange.url}</url>
<layout>default</layout>
</repository>
</distributionManagement>
organizationid是我们组织的GUID ....
我基于此页上的文档: https://docs.mulesoft.com/api-manager/2.x/policy-scope-size-concept
答案 0 :(得分:0)
您需要在maven settings.xml中添加Exchange凭据
<servers>
<server>
<id>Repository</id>
<username>myusername</username>
<password>mypassword</password>
</server>
希望有帮助