Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mapper-locations logic is broken in container deployments if locations match existing package path #264

Open
franck102 opened this issue Feb 21, 2023 · 0 comments

Comments

@franck102
Copy link

MyBatisRecorder fails to resolve the mapper XML files if a location is also a package name. This hit me when doing my first container build, where Quarkus generates some synthetic classes in a separate jar - pls see example below.

This could be addressed in documentation, using locations that don't clash with package names resolves the issue.

  • Configuration:
    quarkus.mybatis.mapper-locations=com/acme/core/mapping,...

  • Where Quarkus should find the XML mapper file:

Thread.currentThread().getContextClassLoader().getResource("com/acme/core/mapping/account-mapper.xml")
jar:file:/deployments/lib/main/com.acme.ep-core-1.0-SNAPSHOT.jar!/com/acme/core/mapping/account-mapper.xml
  • Where it goes instead with the logic in buildFromMapperLocations:
Thread.currentThread().getContextClassLoader().getResource("com/acme/core/mapping")
jar:file:/deployments/quarkus/generated-bytecode.jar!/com/acme/core/mapping
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant