Over a million developers have joined DZone.

Using Microsofia-boot to Ease the Deployment Automation

DZone's Guide to

Using Microsofia-boot to Ease the Deployment Automation

Microsofia-boot solves the problem of the JAR artifacts' deployment at the deployment phase and allows us to use the same ecosystem as the development phase.

· DevOps Zone ·
Free Resource

DevOps involves integrating development, testing, deployment and release cycles into a collaborative process. Learn more about the 4 steps to an effective DevSecOps infrastructure.

In order to achieve continuous integration, one of the several things that should be done is easing deployment automation. 

Let's take the case where we are developing using the Java language and Maven is used as the build system. Once the development phase is done, tests are passed, and the release is done, we have several artifacts with which we want to patch the production: JARs, configuration files, database patches, etc.

Microsofia-boot solves the problem of the JAR artifacts' deployment at the deployment phase just like Maven solves the problem of the JAR dependencies at the development phase.

Simply put, it allows us to use the same ecosystem as the development phase (Maven Artifact repositories, artifacts dependencies) at the deployment phase by just having:

  • One JAR containing all needed dependencies, microsofia-boot.jar.

  • One settings file that has the same structure as the Maven setting.

The deployment phase can then be reduced to the following steps:

  • Once artifacts are released, deploy to the production repository with the new version.

  • Update the version used by the microsofia-boot settings file to the new version.

And that's it! It will download the new versions, build the graph of class loaders, and run your application.

If we prefer not to use a Maven Artifact repository in production, Maven can assemble all of the dependencies so that they can be embedded in an installer. Microsofia-boot can also help here with the offline mode.

Command line usage:

D:\microsofia-boot>d:\java\jdk1.8.0_60\bin\java -jar microsofia-boot.jar -h
usage: boot
 -c,--class <classname>   Class that contains the main to run
 -d,--dump                Dumps the dependency graph to the console
 -h,--help                Prints this help
 -s,--settings <arg>      Settings file path. Default is ./settings.xml
 -t,--template            Dumps a dummy example of settings.xml

Settings file sample:

  <!-- Local Maven repository where the artifacts will be downloaded -->

   | Default: false

  <!-- Root artifact that will be used to create the graph of artifacts.
       The graph of artifacts should contain the class that contains the static main 
       method that you want to invoke

  <!-- List of proxies. Only one should be active -->

  <!-- List of mirrors -->

  <!-- List of repositories -->

Read the 4-part DevOps testing eBook to learn how to detect problems earlier in your DevOps testing processes.

continuous deployment ,continuous integration ,devops ,microsofia-boot

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}