1

I'm building an SDK using Quarkus. I want to have two main features in the SDK:

  1. the SDK provides a high-level API to work with a 3rd party system
  2. the SDK makes it possible to build a native image

Using Quarkus in a project directly makes all of that possible. However, I started having some problem when using Quarkus as a transitive dependency. Example source code can be found here.

Here, test-sdk is the SDK itself, providing the API.

test-parent is a parent POM, which makes it possible to build a native image.

test-project a project which uses test-parent and test-sdk. I'd like test-project to be unaware of Quarkus.

When I run mvn clean package -Dnative in test-project, a native image is built. However, when I run it, I don't see the expected stdout logs from test-sdk here.

When all of this is a single project, I get the expected output. So it looks like @QuarkusMain defined in the dependency (here) doesn't really work.

My question is: are my expectations wrong? Is there a way to make it work this way?

Haris Osmanagić
  • 1,249
  • 12
  • 28

1 Answers1

2

Yes, it can, the only caveat is that you tell Quarkus to "index" that dependency. https://stackoverflow.com/a/55513723/2504224 provides a few different way that can be achieved

geoand
  • 60,071
  • 24
  • 172
  • 190