Skip to content

Micronaut

Obviously you need a valid Micronaut project. If you do not have it already, you should create it from IntelliJ.

In case you are using maven:

<dependency>
<groupId>io.mateu</groupId>
<artifactId>micronaut-core</artifactId>
<version>2.4.94</version>
</dependency>
<!-- you need the one below if you want to also serve the static content -->
<dependency>
<groupId>io.mateu</groupId>
<artifactId>vaadin-lit</artifactId>
<!--
available artifacts are: redhat-lit, sapui5-lit, redwood-lit and vaadin-lit
-->
<version>2.4.94</version>
</dependency>

You also need to add the annotation processor:

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<annotationProcessorPaths combine.children="append">
<path>
<groupId>io.mateu</groupId>
<artifactId>annotation-processor-micronaut</artifactId>
<version>2.4.94</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
</plugins>
</build>

Or, in case you are using Gradle:

implementation("io.mateu:micronaut-core:2.4.94")
implementation("io.mateu:vaadin-lit:2.4.94")
annotationProcessor("io.mateu:annotation-processor-micronaut:2.4.94")

And add the following annotations to your application:

@Introspected(packages = "io.mateu.dtos")
@SerdeImport(packageName = "io.mateu.dtos")
@Import(packages = {
"io.mateu",
"io.mateu.core.application",
"io.mateu.core.application.getui",
"io.mateu.core.application.createjourney",
"io.mateu.core.application.runaction",
"io.mateu.core.domain",
"io.mateu.core.domain.fragmentmapper",
"io.mateu.core.domain.reflection"
},
annotated = "*")
public class Application {
public static void main(String[] args) {
Micronaut.run(Application.class, args);
}
}

Also, in case you added the frontend dependency, in the application.properties file you need to add the following properties:

micronaut.router.static-resources.assets.mapping=/**
micronaut.router.static-resources.assets.paths=classpath\:static

Nothing special is required. Just annotate your class with @UI:

package com.example.demo;
import io.mateu.uidl.annotations.UI;
@UI("")
public class HelloWorld {
}

When you run you spring boot application, you will find your ui at http:localhost:8080 (for the code above) as expected: