Skip to content

Project classes are missing in classpath #6

@anatoly-shuvalov

Description

@anatoly-shuvalov

Hello,

I have a weird issue when trying to use the plugin. I created a new project using one of the unit-tests poms (generate-mojo-full-pom.xml + dependencies) and sample classes (io.openapitools.swagger.*). However, when I'm trying build a project it generates an empty open-api.yaml:

openapi: 3.0.1
info:
  title: Title
  description: |-
    # Description
    This is some description to be included.
  termsOfService: Terms
  contact:
    name: My Name
    url: https://google.com
    email: e@mail.com
  license:
    name: MIT
    url: https://license
  version: 1.0.0
servers:
- url: https://services.example.it/base/path
  description: Example URL

I spent some time debugging the plugin and narrowed it down to io.openapitools.swagger.JaxRSScanner - looks like project classes are simply missing in the classpath despite compilation phase is passed already.

Maven also doesn't run the plugin by default unless I either add an "execution" section in the pom file or call it explicitly:
mvn clean package io.openapitools.swagger:swagger-maven-plugin:generate

Plugin's integration tests work fine for me - project classes are in the classpath.

I use macOS, Maven version is 3.5.4

Metadata

Metadata

Assignees

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