KOS Maven archetypes

To create a new KOS project you can use our maven archetypes to quickly get started. 

The archetypes are available at https://github.com/kosdev-code/kos-maven-archetypes. You can make them available on your local machine quickly by cloning the repo and running the install script like so.

git clone https://github.com/kosdev-code/kos-maven-archetypes
cd kos-maven-archetyps
./install_archetypes.sh

We currently have four archetypes for different kinds of projects and use cases. The archetypes are system-app, app, sdk-app, and multi-module.

To create a new project you can run the following and replace the artifactId with whichever archetype you want to create. 

mvn archetype:generate \
-DarchetypeGroupId=com.kos.archetypes \
-DarchetypeArtifactId=<artifactId> 

With each archetype you will get the whole project structure needed to get started. There will be a README.md that will tell you all that needs to be setup. The archetypes provide a github folder to quickly get setup with build automation, see How to Setup Build Automation. These archetypes help you start building KABs quickly, using the kos-maven-plugin, see How to use the KOS Maven Plugin.

What each archetype does

system-app

This archetype is for creating a system app, which is the starting point of any KOS device. This is used if you’re developing the core functionality of the device.

app

This archetype is for creating an application. This is used by most developers especially third party vendors to supplement the system app with additional functionality, for instance device management solutions, remote access solutions, additional hardware integrations.

sdk-app

This archetype makes use of the kos sdk tooling to create sdks for apps. This allows apps to work together as opposed to being completely sandboxed. For instance a hardware manufacturer may create an app and sdk so that the hardware can be easily integrated. The system app could then pull in that sdk and easily make use of the hardware.

multi-module

This archetype is just an example of how a single project can produce multiple kabs, it’s more an example of what you can do with Maven, than a KOS concept. The archetype will generate a data directory and an app directory. The data directory could store assets, JSONs, or whatever else you need for your app and Maven will turn it into a kab. The app directory is the scaffolding for a system app that you can fill in. The benefit is that one command will build multiple kabs ensuring you always have the latest changes when you build.