Micronaut
Step 1: Have a Micronaut project
Section titled “Step 1: Have a Micronaut project”Obviously you need a valid Micronaut project. If you do not have it already, you should create it from IntelliJ.
Step 2: Add Mateu dependencies
Section titled “Step 2: Add Mateu dependencies”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")Step 3: Add some configuration
Section titled “Step 3: Add some configuration”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\:staticStep 4: Create your Mateu UI
Section titled “Step 4: Create your Mateu UI”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:
