"Some dependencies need to be added to pom.xml" 在 AnyPoint Studio 中

"Some dependencies need to be added to pom.xml" in AnyPoint Studio

我正在 Anypoint Studio (MULE) 中编写一个基本的 REST 连接器。我有一个连接器,其中包含一个 @RestCall returns 一个使用推荐的 jsonschema2pojo 工具生成的 JSON2POJO 对象。

根据文档,我相信我不应该向我的 pom.xml 文件添加任何额外的依赖项。

但是,当尝试 Install/Upgrade 连接器时,我收到以下错误消息:

[ERROR] C:\Users\Nbarnier\AnypointStudio\workspace\brightpearl-connector\src\main\java\com\briteskies\mule\brightpearl\BrightpearlConnector.java:27: Some dependencies need to be added to the pom.xml in order to complete the generate-sources lifecycle phase:
public abstract class BrightpearlConnector
                ^

  <dependency>
     <artifactId>mule-transport-http</artifactId>
     <groupId>org.mule.transports</groupId>
     <version>[3.0.0,4.0.0)</version>
     <scope>compile</scope>
  </dependency>

显然我已经尝试添加此处显示的 <dependency>,但这会导致以下错误:

Failed to execute goal on project brightpearl-connector: Could not resolve dependencies for project com.briteskies.mule:brightpearl-connector:mule-module:1.0.0-SNAPSHOT: Failed to collect dependencies at org.mule.transports:mule-transport-http:jar:3.3.4-SNAPSHOT: Failed to read artifact descriptor for org.mule.transports:mule-transport-http:jar:3.3.4-SNAPSHOT: Failure to find org.mule:mule:pom:3.3.4-20141128.150754-35 in http://repository.mulesoft.org/snapshots/ was cached in the local repository, resolution will not be reattempted until the update interval of mulesoft-snapshots has elapsed or updates are forced

如何编译它?

不要使用这样的范围:[3.0.0,4.0.0)

Mu​​le 中的内部 API 有重要的变化,如果您 运行 一个版本反对另一个版本,可能会导致传输中断。

而是要具体。如果你的目标是 Mule 3.5.0 运行时,那么使用:

<dependency>
   <artifactId>mule-transport-http</artifactId>
   <groupId>org.mule.transports</groupId>
   <version>3.5.0</version>
   <scope>compile</scope>
</dependency>