Aleksey Moren
Aleksey Moren

Reputation: 11

How to make quarkus multi-module project

I have a project:

\--- Project ':backend'
     +--- Project ':backend:api'
     \--- Project ':backend:shared'

In root module I have configured common dependencies and quarkus plugin Module API contains services, resources and all needed for web server

Module shared contains repositories and entities

project build successfully, but wroks strangely

Questions:

  1. Is it best practice to define common libraries and framework plugin/dependicies between modules
  2. Do I correct start a api module to develop new features?
  3. How I can fix issue with no stopped server? I want when I start project it works, when I cancel it, it should stop.

Thanks

when I try to start a API with gradle :backend:api:build :backend:api:quarkusDev, it works, but after stop a server still running and I can send requests. I think it can be because shared module starts also and after cancel gradle task on api, shared still running. When I try to run again it doesn't work, because port 8080 used, and I need to remove it by 'kill -9 $(lsof -t -i :8080)'

Upvotes: 1

Views: 412

Answers (1)

Sergey
Sergey

Reputation: 46

It seems to me that splitting into 'shared' and 'api' modules might not be necessary in your case. They appear to be interconnected, forming part of a unified solution within this section of the project. I believe it's more appropriate to divide the business domains into distinct modules—each module dedicated to solving specific problems or addressing particular areas.

I think it's good to define common libraries and framework plugins/dependencies between modules.

Configuring the startup and shutdown of servers should ideally reside in the root, determining what needs to be initiated. When the root is started, all the required modules should begin, and when it's stopped, everything stops. There might be modules in the project that aren't directly linked to the root but handle parallel processes. These could produce artifacts or can be started as a separate project when necessary, necessitating separate completion. However, if modules are interconnected, they should commence from a unified entry point.

Upvotes: 0

Related Questions