MuleSoft Accelerators - Setup Guide icon

MuleSoft Accelerators - Setup Guide

(1 review)

Build environment

All Mule applications run under the Java Runtime Environment (JRE). Application components are built and deployed using Maven, a popular software management tool used in DevOps environments. MuleSoft also provides an Ecipse-based Integrated Development Environment (IDE) called Anypoint Studio, which is used for developing Mule applications in a graphical environment. While Studio can also be used for building, testing, and deploying applications, the instructions provided in the Accelerator documentation assume the use of Maven except where noted.

Software requirements

The MuleSoft Accelerators for Salesforce Clouds are built on Mule 4 and Studio 7. Assets may work with other versions of Mule and Studio, but no assurances can be given. Here is a list of the minimum software requirements for working with Accelerator assets:

  • Anypoint Studio 7.7.0 or higher
  • Mule Runtime 4.3.0 or higher (included with Studio)
  • Latest AdoptOpenJDK 8 release
  • Latest Maven 3.6.x release
  • Latest Postman 7.x release (for API testing)

Workstation setup

Perform the following steps to prepare your workstation for building, deploying, and testing Accelerator assets. These instructions assume some basic knowledge of using Maven and Eclipse-based products.

Installing

  1. Download and install the latest 64-bit version of the OpenJDK 8 release from https://adoptopenjdk.net. On Windows, add or update the JAVA_HOME environment variable to point to the installation root directory (e.g., C:\Program Files\Java\jdk1.8.0_265) and append %JAVA_HOME%\bin to the PATH variable.

  2. Download and install the latest Apache Maven 3.6.x release from http://maven.apache.org/download.cgi. Add or update the MAVEN_HOME environment variable to point to the installation root directory (e.g., C:\Utilities\apache-maven-3.6.3) and append %MAVEN_HOME%\bin ($MAVEN_HOME/bin on Linux/MacOS) to the PATH variable.

  3. Download and install the latest 64-bit version of the Anypoint Studio 7 release from https://www.mulesoft.com/lp/dl/studio. Do not install the product under a folder containing spaces in the name.

  4. Launch Studio and create a new workspace for the accelerator assets. Do not locate the workspace under a folder containing spaces in the name.

Configuring the Accelerator build

  1. Download the Accelerator Common Build asset from Exchange and unpack the archive to a temporary directory. The directory should contain a single Studio project folder called accelerator-common-build.

  2. Import the project folder into Studio using the General/Existing Projects into Workspace wizard (not the Anypoint Studio project wizard). If the project does not import as accelerator-common-build, you can select the project in the Package Explorer view and press F2 to rename it:

    sfc-doc-setupguide_01.png

  3. Copy the contents of the settings-accelerators.xml file to your local Maven settings.xml file, which is usually located under $HOME/.m2 on Linux/MacOS hosts and %USERPROFILE%\.m2 on Windows hosts; create a new file if it does not exist. You may also choose to keep the file separate and specify the -s <filename> option when running Maven commands; in Studio you will also need to override the user settings path (under Anypoint Studio/Maven/User Settings in the Preferences dialog).

  4. For now, update the server entries to specify your own usernames and passwords for the two Exchange repositories (anypoint-exchange-v2 and accelerator-exchange). If you want to run MUnit tests from the command line, you will also need to provide separate credentials for the MuleSoft Nexus EE repository (mule-enterprise).

Testing the configuration

Having proper values in the Maven settings file is critical for being able to resolve, build and deploy components using Maven.

To verify your workstation setup, import any Accelerator implementation template asset into Studio. You can either manually download the asset from Exchange and import it using the Packaged mule application (jar) wizard or you can launch the Exchange viewer in Studio to browse and open one directly.

Once the project has been imported, verify that the project name in Studio matches the name element in the pom.xml file. If it does not (which is usually the case when importing from a downloaded archive), press F2 to rename it accordingly; this will make it easier to use the build scripts later on. Ignore any warnings or errors for now.

Open your favorite shell and navigate to the project root folder (e.g., C:\workspaces\accelerators\accelerator-jira-sys-api). Run the command mvn clean. If the command completes successfully (the message BUILD SUCCESS appears) then you are good to go. If any errors are reported, they must be resolved before continuing; consult the Troubleshooting section below for help with some common issues.

In Studio, close the project, wait until Studio has finished processing any tasks, and then open it again. Ensure the project builds with no errors.

Troubleshooting

If the mvn clean command does not complete successfully, or if Studio reports errors for the imported project, something in your setup is either missing or incorrect. The following table provides some common issues that may be encountered along with some suggested resolution steps:

IssuePossible CauseResolution
Maven cannot find one or more dependenciesCredentials provided for the server entries may be invalid; if they are correct, it is possible Maven cached an earlier attempt to download the dependenciesFirst verify your credentials and then add then run mvn clean -U to force Maven to update all dependencies. You can also force an update by removing cached dependencies from the .m2/repository folder. If all else fails, download the POM Parent and Common Core assets and install them locally as per the Additional customization page.
Studio reports "null" version errorsStudio is not resolving the parent POM correctlyIf the mvn clean command succeeded, close the project and then reopen it. If that does not work, try restarting Studio. As a last resort, delete the project (but not the files) from Studio and then re-import it.
Error reported during project renameStudio has locked one or more filesVerify the new project folder contains the same files as the old one. Close Studio, delete the old project folder, then launch Studio again.
Studio reports "cannot import as Mule project" errorThe wrong wizard was used to import the projectIf the project still appears in the Package Explorer view you can ignore the error. If not, try the import again with a different import wizard.

Reviews

TypeCustom
OrganizationMuleSoft
Published by
MuleSoft Solutions
Published onMay 10, 2021
Asset overview

Asset versions for 1.5.x

Asset versions
VersionActions
1.5.1
1.5.0