If you are reading this blog I assume you are already familiar with the Axon Framework basics. If not, please visit “Axon Part 1: An Introduction to Axon Framework” to get started with Axon.
Initializers are the tools that help us start off with our project right away by automating some of the tasks which we need to go through every time we create a new project. Tasks such as creating the structure for various project artifacts, creating a build file, determining maven coordinates, and picking the right dependency versions can be boring and repetitive.
You might have heard about a similar tool known as Spring Initializr which provides a user-friendly web UI to create and configure and generate Spring based applications. Unfortunately, Axon Framework is not available in the Spring Initializr.
Hence, comes the scope of AxonIQ Initializr.
What is the AxonIQ Initializr?
It is a simple and intuitive web application that creates an Axon Project structure based on some basic specifications.
The AxonIQ Initializr is based on the widely used Spring Initializr project and mostly works in a similar fashion.
The AxonIQ Initializr is open-source which means you can even fork the AxonIQ Initializr and customize it to your own requirements.
- Open your browser and visit: https://start.axoniq.io/. You’ll be greeted with a page like the one shown below.
- Once opened you can start by providing your application metadata(i.e GroupID, ArtifactID, Name, Package Name).
- Next you can choose your project settings:
- Under Project you need to specify your preferred build tool(i.e. Maven or Gradle).
- Under Language you can choose from either Java or Kotlin.
- Furthermore, you can specify your Java version.
- Once done, you can specify the dependencies that your project requires by clicking on the plus button on the top right corner.
- Here you can search for your dependencies and add or remove them as required. By Default Axon Framework and Axon Test dependencies are included in every project.
- Now we are completed with the setup. Just click on the “Download” button on the bottom left to download your project. Once downloaded, just unzip the file and open your project on your favourite IDE. Now you can start adding your own code!!
There are also other ways to access AxonIQ Initializr without using the web UI.
For the command line fans:
You can simply open up your command line application or even within your IDE and use the following command:
curl https://start.axoniq.io/starter.zip -d dependencies=(dependencies) -o (projectname).zip
In this command replace “dependencies” with the name of your required dependencies separated by comma and replace “projectname” with your preferred project name.
For the IntelliJ IDEA fans:
Note: This is for ultimate version only.
- Go to “New Project” and select the Spring Initializr option on the left.
Now, you need to change the server URL by clicking on the gear icon next to the URL.
Set it to: https://start.axoniq.io/
Now you can set your project settings and continue with your project.
For Eclipse fans:
You need to have the Spring Tools Add-On installed from the Marketplace if you don’t have it already.
- Go to the “New Project” dialog and select “Spring Starter Project” from the Spring Boot option. It will bring up a dialog box as shown below.
- Here you need to change the “Service URL” to https://start.axoniq.io/
- Now you can customize the project settings according to your needs.
For more knowledge about Axon and various other technologies, please visit: Knoldus Blogs