2. Prerequisites
Check that you have:
● Maven installed in your system
● The following repository in your settings.xml:
<repository>
<id>mulesoft-releases</id>
<name>MuleSoft Releases</name>
<url>http://repository-master.mulesoft.org/releases/</url>
</repository>
3. Archetype
Used to have an skeleton of an APIKit project.
How to use it:
● Go to the folder where you want to have your APIKit project
● Run the following command:
mvn archetype:generate -DarchetypeGroupId=org.mule.tools -DarchetypeArtifactId=apikit-archetype -
DgroupId=org.mule -DartifactId=HelloWorld -Dversion=1.0 -DmuleVersion=3.7.0 -B
4. Archetype
Explanation of the command:
● -DarchetypeGroupId=org.mule.tools : Group id of the archetype. Always use this name
● -DarchetypeArtifactId=apikit-archetype : Name of the artifact. Always use this name
● -DarchetypeVersion=1.7.2 (Optional) APIKit Version
● -DgroupId=org.mule GroupId of the project that you will generate
● -DartifactId=HelloWorld : ArtifactId of the project that you will generate
● -Dversion=1.0 : Version of the project that you will generate
● -DmuleVersion=3.7.0 : Mule version that you will use when running the project. This parameter will let
the archetype know if the project should be generated using inbound-endpoint or listeners.
● -B : (Optional) Batch mode. When using this parameter, the skeleton will be created without asking
questions.
5. Archetype
The directories and files that the archetype will generate, will appear in the following
way:
|-- pom.xml
`-- src
`-- main
|-- api
| `-- api.raml
|-- app
| `-- mule-config.xml
|-- java
`-- resources
`-- api.properties
6 directories, 4 files
6. Scaffolder
This program will let you generate the necessary flows into your mule-config.xml file,
based on your RAML description of your API.
How it works:
After creating your skeleton of your project using the Archetype, go to the api.raml file
and complete it with your API description.
Go to the root of your project, and run the following command:
mvn org.mule.tools:apikit-maven-plugin:create
7. Scaffolder
● After running the command, you will be able to see the changes in your mule-
config.xml file.
● All the necessary flows will be there, including the examples of your responses (in
case you mentioned them in your RAML file).
● This process can be done any times you need.