quarkiverse/quarkus-wiremock

Extension scanning in dev-mode does not find extensions defined in the test-classpath

Opened this issue · 7 comments

When running quarkus in dev-mode with the WireMock extension and extension scanning enabled, it does not load extensions which are defined under src/test. Only extensions residing under src/main are loaded.

@chberger This is being labeled as stale.

@chberger This is being closed due to inactivity.

When running quarkus in dev-mode with the WireMock extension and extension scanning enabled, it does not load extensions which are defined under src/test. Only extensions residing under src/main are loaded.

What do you mean by "extension scanning," and what is your expectation?

Thanks for taking the time to answer me. I would like to keep extensions in dev mode separate from the production code. So either like to have them found in 'src/test/java' or maybe a dedicated spot like 'src/wiremock/java'. What do you think?

Alright, I understand your point now. From what I gather, Quarkus uses a completely different classpath in development mode compared to test mode. Additionally, test dependencies aren't available while running in dev mode, which might explain why you're unable to access 'test' resources. I agree that we should ensure these resources don’t end up in the production build. Let me give it some thought ..

I guess the hibernate-orm extenstion has the same problem with the import.sql.
https://quarkus.io/guides/hibernate-orm#quarkus-hibernate-orm_quarkus-hibernate-orm-sql-load-script

Because of Quarkus' classpath design, the file must also be placed in src/main/resources. I suspect there's some underlying mechanism at play, and the file ultimately gets included in the production build. While I agree this isn't an ideal solution, avoiding it would require custom filtering, which can be quite complex—especially since there may be other legitimate resources if the user hasn't specified a custom WireMock subfolder.

Your right. Going to take this up with the team and see what they think of a dedicated location for dev mode user code.