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

FileResolver doesn't detect .java files #38

Open
Z13NDELS opened this issue Nov 6, 2020 · 3 comments
Open

FileResolver doesn't detect .java files #38

Z13NDELS opened this issue Nov 6, 2020 · 3 comments

Comments

@Z13NDELS
Copy link

Z13NDELS commented Nov 6, 2020

I have added jpa2ddl to a project where I also ahve source classes.
jpa2ddl generates nothing, even if configuration is very similar to the one in example.
After debuggging, I found out that FileResolver#listClassNamesInPackage(...) associates the package name to the source folder of my classes (and not the classes folder). As a consequence, contained files are .java which the pathMatcher object can't recognize as .class. And in turn, this prevent my classes from being recognized and creates an empty schema.

Possible solutions are

  1. Tweak the contect class loader to not use the src/main/java folder but the target/classes one
  2. Change the pathMatcher to match .java and .class files. This one is way easier.
@jkubrynski
Copy link
Member

Do you use maven or gradle tool?

@Z13NDELS
Copy link
Author

I've used maven

@jkubrynski
Copy link
Member

By default the plugin runs in the process-classes phase which is executed after compiling all classes. The classpath contains the target as well as the src directory. Could you please provide us with the https://stackoverflow.com/help/minimal-reproducible-example ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants