jhipster / generator-jhipster-micronaut

Micronaut blueprint for JHipster

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Update to Micronaut 3

JasonTypesCodes opened this issue · comments

Overview of the feature request

Micronaut 3 has been released!! It would be good to update this blueprint to support it

Any updates on this? Is it still on?

As you can see from the bug bounty I added four months ago, I'm very interested in this feature.

@atomfrede I have time this week to bring this blueprint up to date. Where would you suggest I start?

Good question. I think creating a plain micronaut app e.g. with oauth would be a good start to see what has changed and afterwards update the templates.

I have managed to upgrade a mHipster app from Micronaut 2 to Micronaut 3. The changes are mostly related to Authentication classes(I even got the auth tests working as well based on the changes), and package name changes for javax.inject to jakarta.inject. If you need more feedback from me, please do let me know.

@kevintanhongann Excellent! That's wonderful to hear that success is possible. I'll reply to this thread if/when I run into issues.

additional dependencies required:

implementation("io.micronaut.rxjava3:micronaut-rxjava3:2.3.0")
implementation("io.micronaut.rxjava3:micronaut-rxjava3-http-client:2.3.0")

@kevintanhongann If you have the time to contribute to this issue, please do! Create a PR with the upgraded versions, add these dependencies, and let's see what happens!

Here's our contribution guide.

That's great news! Let's see how far we can get.

@atomfrede please have a look at what I did for an openid example. https://github.com/kevintanhongann/mhipster-openid-example, and it seems to me that my own project(in which it used JWT auth) has the same issue in the end for ./gradlew test

https://pastebin.com/6q96N65e

I think this is the last piece of the puzzle that needs to be solved before I can conclude the changes that I need to make to the generator.

Update: https://pastebin.com/c8NAu6pG

Update: Okay never mind. I was dumb. testCorsFilterOnApiPath() on the CorsTest was meant to fail, and fixed the application-test.yml by setting up a specific server port instead of a random one for the micronaut server.

I'm close. One last(hopefully) question. Where is the serverPort variable (where the root file is supposed to be located)? I believe the variable was supposed to register in the yml files being application-dev.yml and my application-test.yml but it didn't.

I think that is the last piece that I need to do to finalize my commit so that you guys can review my changes.

Here are my findings,

Normally most constants are trickling down from constant.cjs file to the sub files.
IMG_20220809_114347

except for frontendAppName, packageName, serverPort and baseName. I assume they're obtained from the prompt?

Then that could mean one thing - I should code a logic to check whether the serverPort exists from the prompt. If not, I should write a default 8080 into the yml files.

I don't think you need to worry about serverPort. It defaults to 8080 and is mostly there for microservices, so we can change the ports when generating a microservice apps (to avoid port conflicts). I don't think this blueprint supports microservice architectures, yet.

Exactly. No Microservice Support yet. Nice picture👍

PR submitted #267

What do you mean by "where"? Where it is defined? It should come from the main generator and you can use it in templates via <%= serverPort %> I think (need to check if it has been renamed or so, but I don't think so).