-
Notifications
You must be signed in to change notification settings - Fork 47
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
Some project dependencies are missing when scanning the project #25
Comments
Hmm... Been a while since I looked into this but the Mojo is actually declared as I will look into this - but I agree that these should be included by default. |
I think that Btw. I have created a pull request that attempts to fix this issue (it fixed the issue on my test project, I hope it would work in general). |
When the swagger-maven-plugin scans the project for swagger resources, the classloader it uses to load classes is missing the scanned project's dependencies, and thus may fail with
ClassNotFoundException
or similar. This can be worked around by explicitly listing all dependencies of the project in plugin's dependencies section, but for large projects there can be many dependencies, so adding all required ones may be tedious, and the plugin should handle this automatically if possible.I have put up a simple project that demonstrates this: swagger-maven-project-with-dependencies.zip
I think this can be solved by not adding just
project.getBuild().getOutputDirectory()
to theURLClassLoader
, but also the resources provided byproject.getCompileClasspathElements()
andproject.getRuntimeClasspathElements()
.The text was updated successfully, but these errors were encountered: