SpringBoot to Micronaut - Application Class

By Sergio del Amo - Tue, 27 Apr 2021 07:45:56 GMT

Tags: #micronaut #springboot

SpringBoot and Micronaut applications contain a simple application class which starts the application for you.

SpringBoot:

package scorekeep;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class Application {

	public static void main(String[] args) {
		SpringApplication.run(Application.class, args);
	}
}

Micronaut:

package scorekeep;

import io.micronaut.runtime.Micronaut;

public class Application {

	public static void main(String[] args) {
		Micronaut.run(Application.class, args);
	}
}

Except for the @SpringBootApplication annotation both classes are almost identical.