Given archetype will generate a comprehensive Mulesoft project structure with common parent project, sharing everything possible to share around Maven builds, Mule commons project containing various re-usable flows, Dataweave scripts and other Mule artifacts that can be shared across all your Mulesoft projects and typical API-led API applications for: experience, process and system layers.
Code generated by Netflexity’s Mule 4 (CloudHub) archetype offers the best Mulesoft foundation to build on top of, following best naming conventions and project architecture that took years of experience to put together. All you need to do is use it and extend if necessary to accommodate your project needs.
1. Install Java 8 JDK
2. Install and configure Maven (Mac OS instructions…)
I’m not gonna go into details on how to do this but the very high level steps are:
- Download maven
- Explode zip into your file system (use a location with no spaces. e.g.
- Create M2_HOME environment variable pointing to the new maven directory:
- Add M2_HOME/bin to the default PATH environment variable:
- Open a new terminal and test:
- Assuming all went well so far, maven will create a hidden folder name .m2 under your user home (e.g.
/Users/<USER>/.m2) that will be used to locally cache the different Maven dependencies your apps need
Now, let’s add Mulesoft Exchange repository for Netflexity to access archetype Maven dependency without building and installing it locally.
Add the following
<server> <id>Exchange-Netflexity</id> <username>netflexity-guest</username> <password>Mulesoft1</password> </server>
Add the following
<repositories> at the bottom of
<repository> <id>Exchange-Netflexity</id> <name>Exchange-Netflexity Repository</name> <url>https://maven.anypoint.mulesoft.com/api/v1/organizations/c2360a4c-f673-4d61-ab34-1a08c25dad57/maven</url> <layout>default</layout> </repository>
Generate Mule 4 Applications
Now you can utilize Netflexity’s Mulesoft CloudHub Archetype by running command below.
mvn archetype:generate -DarchetypeGroupId=c2360a4c-f673-4d61-ab34-1a08c25dad57 -DarchetypeArtifactId=mule-archetype -DarchetypeVersion=1.0.1 -DgroupId=com.[your-company-groupId] -DartifactId=[your-artifact-id] -Dversion=1.0.0[your-version]