我最近开始使用 AnypointStudios 与 Mule 合作。现在我需要创建一个新的 Maven 基础 Mule 项目。我从来不需要这样做,所以我对如何使用 maven 设置和创建一个合适的 Mule 项目非常迷茫。有人可以帮助我吗?
谢谢你们。
我最近开始使用 AnypointStudios 与 Mule 合作。现在我需要创建一个新的 Maven 基础 Mule 项目。我从来不需要这样做,所以我对如何使用 maven 设置和创建一个合适的 Mule 项目非常迷茫。有人可以帮助我吗?
谢谢你们。
首先,如果您有权访问 MuleSoft Enterprise 存储库,则必须按照文档中的说明将存储库添加到 Maven settings.xml : https ://docs.mulesoft.com/mule-runtime/4.3/maven-reference#configure-maven-访问-mulesoft-enterprise-repository
如果你想创建一个新的 Maven 项目,最简单的方法是使用 Anypoint Studio。Studio 7.x(推荐)总是创建 Maven 项目。对于 Studio 6.x,您需要在创建项目时选择该选项,或者在创建项目后使用菜单选项迁移到 Maven 项目。它在Studio 6 Maven 文档中。
请注意,Studio 7.x 仅适用于 Mule 4.x,Studio 6.x 仅适用于 Mule 3.x。
很高兴您正在探索 Mulesoft。祝你好运。
根据您的问题,您是新手并想要创建一个新的 Mulesoft 项目。所以我希望您首先阅读这篇由我编写的文章https://dzone.com/articles/Step-by-step-guide-to-using-mule-esb,它将指导您进行设置并做好准备对于您的第一个骡子项目。
完成这篇文章后,然后在 Anypoint Studio 中创建一个新项目 new Project
注意:在所有 Maven 配置之后,检查位置C:\Users\yourPCName\.m2将创建一个文件夹,其中包含一个名为存储库的文件夹,第二个文件需要创建settings.xml,如果访问 MuleSoft Enterprise Repository,我们将使用该文件(例如需要访问nexus Artifactory。
例如,附在下面的 settings.xml 示例
<?xml version="1.0" encoding="UTF-8" standalone="no"?><settings xmlns="http://maven.apache.org/SETTINGS/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
<servers>
<server>
<id>id</id>
<username>username</username>
<password>password</password>
</server>
<server>
<id>mulesoft-release-local</id>
<username>username</username>
<password>password</password>
</server>
</servers>
<mirrors>
<mirror>
<id>id</id>
<mirrorOf>*</mirrorOf>
<name>name</name>
<url>URL of artifactory</url>
</mirror>
</mirrors>
</settings>
我希望这个答案会对你有所帮助。
谢谢