Skip to content

Some project dependencies are missing when scanning the project #25

@tosix1988

Description

@tosix1988

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 the URLClassLoader, but also the resources provided by project.getCompileClasspathElements() and project.getRuntimeClasspathElements().

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions