Skip to content

Commit

Permalink
feat: bump Micronaut to 4.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
alejandropg committed Jul 11, 2024
1 parent d516469 commit ff40ef1
Show file tree
Hide file tree
Showing 8 changed files with 136 additions and 140 deletions.
22 changes: 16 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,38 @@ The purpose of this module is to easily add [Micronaut](https://micronaut.io/) s
[Since Micronaut 2.0 this module is based on the official Micronaut pom-parent](https://docs.micronaut.io/2.0.0/guide/index.html#whatsNew),
and this module defines some more Maven
properties with typical values or package versions. Just simply are defaults values that you can override in your
project `pom.xml` to change the default behaviour.
project `pom.xml` to change the default behavior.

In this module you can find the configuration of some typical Maven plugins that are used with Micronaut.
Please refer to the `pom.xml` of this module to see these configurations.

This is a Maven base module just to define some common defaults, so is preferred that you don not use it directly
This is a Maven base module just to define some common defaults, so is preferred that you do not use it directly
and instead in your project you should use one of:

- [micronaut-java-parent](https://github.com/archimedes-projects/archimedes-maven-micronaut/tree/main/micronaut-java-parent) - only Java project
- [micronaut-kotlin-parent](https://github.com/archimedes-projects/archimedes-maven-micronaut/tree/main/micronaut-kotlin-parent) - only Kotlin project
- [micronaut-kotlin-java-parent](https://github.com/archimedes-projects/archimedes-maven-micronaut/tree/main/micronaut-kotlin-parent/micronaut-kotlin-java-parent) - project that mix Java and Kotlin sources


# JDK 17
# JDK 21

Because JDK 17 is the actual LTS version, since version 3.3.2 of this module JDK 17 is used by default.
Because JDK 21 is the actual LTS version, since version 4.5.0 of this module, JDK 21 is used by default.

If you want to use another JDK version you can define it in your module `pom.xml` using the properties:

```xml
<properties>
<jdk.version>11</jdk.version>
<release.version>11</release.version>
<jdk.version>17</jdk.version>
<release.version>17</release.version>
</properties>
```

# Micronaut Maven plugin

Since versión 4.5.0 of this module, the official Micronaut Maven plugin is used.
This simplifies the Maven configuration and allows using in your projects some invaluable features such as:

- [Integration with Micronaut Test Resources](https://micronaut-projects.github.io/micronaut-maven-plugin/latest/examples/test-resources.html) to automatically create needed Docker containers during integration tests,
- [Package the application as `docker` or `native-image` or...](https://micronaut-projects.github.io/micronaut-maven-plugin/latest/examples/package.html) with zero additional configuration,
- [Run the application in development mode](https://micronaut-projects.github.io/micronaut-maven-plugin/latest/examples/run.html) with `mvn mn:run`,
- ...
30 changes: 2 additions & 28 deletions micronaut-java-parent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ If you want to add Micronaut support in your Maven Java project, you need just t
<parent>
<groupId>io.archimedesfw.maven.micronaut</groupId>
<artifactId>micronaut-java-parent</artifactId>
<version>3.8.7</version>
<version>4.5.0</version>
</parent>

<groupId>com.example</groupId>
Expand All @@ -25,7 +25,7 @@ If you want to add Micronaut support in your Maven Java project, you need just t
...
```

As you can see in the example the version of this module correspond with the Micronaut version that you want to use.
As you can see in the example, the version of this module corresponds with the Micronaut version that you want to use.

## Integration tests

Expand Down Expand Up @@ -62,29 +62,3 @@ This module preconfigure the [Lombok](https://projectlombok.org/) annotation pro
</dependencies>
...
```

## Typical Micronaut plugins

There are several Maven plugins that are usually used with Micronaut. If you want to use some already configured plugins you just need to activate it in your project `pom.xml`.

For example to generate an auto-executable jar you can use:

```xml
<properties>
...
<exec.mainClass>com.example.Application</exec.mainClass>
...
</properties>

<build>
<plugins>
...
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
</plugin>
...
</plugins>
</build>
...
```
23 changes: 17 additions & 6 deletions micronaut-java-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
<parent>
<groupId>io.archimedesfw.maven.micronaut</groupId>
<artifactId>micronaut-base-parent</artifactId>
<version>3.8.7</version>
<version>4.5.0</version>
</parent>

<artifactId>micronaut-java-parent</artifactId>
<packaging>pom</packaging>

<properties>
<lombok.version>1.18.26</lombok.version>
<lombok.version>1.18.34</lombok.version>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -43,20 +43,26 @@
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
</path>

<path>
<groupId>io.micronaut</groupId>
<artifactId>micronaut-inject-java</artifactId>
<version>${micronaut.version}</version>
<version>${micronaut.core.version}</version>
</path>
<path>
<groupId>io.micronaut</groupId>
<artifactId>micronaut-validation</artifactId>
<version>${micronaut.version}</version>
<artifactId>micronaut-graal</artifactId>
<version>${micronaut.core.version}</version>
</path>
<path>
<groupId>io.micronaut.validation</groupId>
<artifactId>micronaut-validation-processor</artifactId>
<version>${micronaut.validation.version}</version>
</path>
<path>
<groupId>io.micronaut</groupId>
<artifactId>micronaut-http-validation</artifactId>
<version>${micronaut.version}</version>
<version>${micronaut.core.version}</version>
</path>
<path>
<groupId>io.micronaut.data</groupId>
Expand All @@ -68,6 +74,11 @@
<artifactId>micronaut-security-annotations</artifactId>
<version>${micronaut.security.version}</version>
</path>
<path>
<groupId>io.micronaut.serde</groupId>
<artifactId>micronaut-serde-processor</artifactId>
<version>${micronaut.serialization.version}</version>
</path>
<path>
<groupId>io.micronaut.openapi</groupId>
<artifactId>micronaut-openapi</artifactId>
Expand Down
48 changes: 2 additions & 46 deletions micronaut-kotlin-parent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ If you want to add Micronaut support in your Maven Kotlin project, you need just
<parent>
<groupId>io.archimedesfw.maven.micronaut</groupId>
<artifactId>micronaut-kotlin-parent</artifactId>
<version>3.8.7</version>
<version>4.5.0</version>
</parent>

<groupId>com.example</groupId>
Expand All @@ -25,9 +25,8 @@ If you want to add Micronaut support in your Maven Kotlin project, you need just
...
```

As you can see in the example the version of this module correspond with the Micronaut version that you want to use.
As you can see in the example, the version of this module corresponds with the Micronaut version that you want to use.

This module allow you to mix Kotlin and Java source files in the same Maven module, the firs one in `src/main/kotlin` and the other in `src/main/java` (and the equivalent `src/test/kotlin` and `src/test/java` for the test sources).

## Integration tests

Expand All @@ -47,46 +46,3 @@ If you want to run integration tests in your project you just need to activate d
</build>
...
```

## Lombok

This module preconfigure the [Lombok](https://projectlombok.org/) annotation processor to be compatible with micronaut, so if you want to use **Lombok in your Java sources** you just need to activate the library dependency in you project `pom.xml`.

```xml
...
<dependencies>
...
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
...
</dependencies>
...
```

## Typical Micronaut plugins

There are several Maven plugins that are usually used with Micronaut. If you want to use some already configured plugins you just need to activate it in your project `pom.xml`.

For example to generate an auto-executable jar you can use:

```xml
<properties>
...
<exec.mainClass>com.example.Application</exec.mainClass>
...
</properties>

<build>
<plugins>
...
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
</plugin>
...
</plugins>
</build>
...
```
32 changes: 3 additions & 29 deletions micronaut-kotlin-parent/micronaut-kotlin-java-parent/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Micronaut Maven Kotlin parent

The purpose of this module is to easily add [Micronaut](https://micronaut.io/) support to your **Maven Kotlin projects**.
The purpose of this module is to easily add [Micronaut](https://micronaut.io/) support to your **Maven Kotlin + Java projects**.

You can find a **complete example** of how ot use this parent pom in: [micronaut-kotlin-parent-example](https://github.com/archimedes-projects/archimedes-maven-micronaut-examples/tree/main/micronaut-kotlin-parent-example)

Expand All @@ -15,7 +15,7 @@ If you want to add Micronaut support in your Maven Kotlin project, you need just
<parent>
<groupId>io.archimedesfw.maven.micronaut</groupId>
<artifactId>micronaut-kotlin-parent</artifactId>
<version>3.8.7</version>
<version>4.5.0</version>
</parent>

<groupId>com.example</groupId>
Expand All @@ -25,7 +25,7 @@ If you want to add Micronaut support in your Maven Kotlin project, you need just
...
```

As you can see in the example the version of this module correspond with the Micronaut version that you want to use.
As you can see in the example, the version of this module corresponds with the Micronaut version that you want to use.

This module allow you to mix Kotlin and Java source files in the same Maven module, the firs one in `src/main/kotlin` and the other in `src/main/java` (and the equivalent `src/test/kotlin` and `src/test/java` for the test sources).

Expand Down Expand Up @@ -64,29 +64,3 @@ This module preconfigure the [Lombok](https://projectlombok.org/) annotation pro
</dependencies>
...
```

## Typical Micronaut plugins

There are several Maven plugins that are usually used with Micronaut. If you want to use some already configured plugins you just need to activate it in your project `pom.xml`.

For example to generate an auto-executable jar you can use:

```xml
<properties>
...
<exec.mainClass>com.example.Application</exec.mainClass>
...
</properties>

<build>
<plugins>
...
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
</plugin>
...
</plugins>
</build>
...
```
23 changes: 17 additions & 6 deletions micronaut-kotlin-parent/micronaut-kotlin-java-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
<parent>
<groupId>io.archimedesfw.maven.micronaut</groupId>
<artifactId>micronaut-kotlin-parent</artifactId>
<version>3.8.7</version>
<version>4.5.0</version>
</parent>

<artifactId>micronaut-kotlin-java-parent</artifactId>
<packaging>pom</packaging>

<properties>
<lombok.version>1.18.26</lombok.version>
<lombok.version>1.18.34</lombok.version>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -108,20 +108,26 @@
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
</path>

<path>
<groupId>io.micronaut</groupId>
<artifactId>micronaut-inject-java</artifactId>
<version>${micronaut.version}</version>
<version>${micronaut.core.version}</version>
</path>
<path>
<groupId>io.micronaut</groupId>
<artifactId>micronaut-validation</artifactId>
<version>${micronaut.version}</version>
<artifactId>micronaut-graal</artifactId>
<version>${micronaut.core.version}</version>
</path>
<path>
<groupId>io.micronaut.validation</groupId>
<artifactId>micronaut-validation-processor</artifactId>
<version>${micronaut.validation.version}</version>
</path>
<path>
<groupId>io.micronaut</groupId>
<artifactId>micronaut-http-validation</artifactId>
<version>${micronaut.version}</version>
<version>${micronaut.core.version}</version>
</path>
<path>
<groupId>io.micronaut.data</groupId>
Expand All @@ -133,6 +139,11 @@
<artifactId>micronaut-security-annotations</artifactId>
<version>${micronaut.security.version}</version>
</path>
<path>
<groupId>io.micronaut.serde</groupId>
<artifactId>micronaut-serde-processor</artifactId>
<version>${micronaut.serialization.version}</version>
</path>
<path>
<groupId>io.micronaut.openapi</groupId>
<artifactId>micronaut-openapi</artifactId>
Expand Down
Loading

0 comments on commit ff40ef1

Please sign in to comment.